<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>G.R.Y.S. &#187; Python</title>
	<atom:link href="http://www.grys.it/index.php/tag/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.grys.it</link>
	<description>...giusto per divertirsi</description>
	<lastBuildDate>Sun, 29 Jan 2012 23:12:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Project Euler #20</title>
		<link>http://www.grys.it/index.php/2009/12/project-euler-20/</link>
		<comments>http://www.grys.it/index.php/2009/12/project-euler-20/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 14:44:38 +0000</pubDate>
		<dc:creator>gian</dc:creator>
				<category><![CDATA[Project Euler]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.grys.it/?p=709</guid>
		<description><![CDATA[Problema numero 20
Altro problema che tratta di numeri enormi, concettualmente semplice: chiede di trovare la somma delle cifre del fattoriale di 100 (100!)
Soluzione Python

  
    
      
    
    
      download: Problema numero 20 (156B)
  [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://projecteuler.net/index.php?section=problems&amp;id=20" target="_blank">Problema numero 20</a></p>
<p>Altro problema che tratta di numeri enormi, concettualmente semplice: chiede di trovare la somma delle cifre del fattoriale di 100 (100!)</p>
<p><strong>Soluzione Python</strong><br />
<table style="border: 1px solid #CCC;" cellpadding="3" width="100%">
  <tr>
    <td width="35">
      <img src="http://www.grys.it/wp-content/plugins/downloads-manager/img/icons/default.gif" alt="http://www.grys.it/wp-content/plugins/downloads-manager/img/icons/default.gif">
    </td>
    <td>
      <b>download:</b> <a href="http://www.grys.it/?file_id=23">Problema numero 20</a> <small>(156B)</small><br />
      <b>added:</b> 21/12/2009 <br />
      <b>clicks:</b> 423 <br />
      <b>description:</b>  <br />
    </td>
  </tr>
</table></p>
<p>Risultato: <strong>648</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.grys.it/index.php/2009/12/project-euler-20/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project Euler #19</title>
		<link>http://www.grys.it/index.php/2009/12/project-euler-19/</link>
		<comments>http://www.grys.it/index.php/2009/12/project-euler-19/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 14:42:16 +0000</pubDate>
		<dc:creator>gian</dc:creator>
				<category><![CDATA[Project Euler]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.grys.it/?p=707</guid>
		<description><![CDATA[Problema numero 19
Problema molto semplice da risolvere in Python. Chiede di trovare il numero di Domeniche tra il 1 Gennaio 1901 e il 31 Dicembre 2000
Soluzione Python

  
    
      
    
    
      download: Problema numero [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://projecteuler.net/index.php?section=problems&amp;id=19" target="_blank">Problema numero 19</a></p>
<p>Problema molto semplice da risolvere in Python. Chiede di trovare il numero di Domeniche tra il 1 Gennaio 1901 e il 31 Dicembre 2000</p>
<p><strong>Soluzione Python</strong><br />
<table style="border: 1px solid #CCC;" cellpadding="3" width="100%">
  <tr>
    <td width="35">
      <img src="http://www.grys.it/wp-content/plugins/downloads-manager/img/icons/default.gif" alt="http://www.grys.it/wp-content/plugins/downloads-manager/img/icons/default.gif">
    </td>
    <td>
      <b>download:</b> <a href="http://www.grys.it/?file_id=22">Problema numero 19</a> <small>(258B)</small><br />
      <b>added:</b> 21/12/2009 <br />
      <b>clicks:</b> 420 <br />
      <b>description:</b>  <br />
    </td>
  </tr>
</table></p>
<p>Risultato: <strong>171</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.grys.it/index.php/2009/12/project-euler-19/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project Euler #18</title>
		<link>http://www.grys.it/index.php/2009/12/project-euler-18/</link>
		<comments>http://www.grys.it/index.php/2009/12/project-euler-18/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 14:40:03 +0000</pubDate>
		<dc:creator>gian</dc:creator>
				<category><![CDATA[Project Euler]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.grys.it/?p=703</guid>
		<description><![CDATA[Problema numero 18
Problema apparentemente banale. Chiede di trovare il percorso che ottiene la somma massima del triangolo fornito, muovendosi da un numero ad uno dei due adiacenti nella riga sottostante. Sembra intuitivo che basti selezionare sempre il numero successivo maggiore per trovare il percorso maggiore, ma è ovviamente errato, in quanto si chiede il totale [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://projecteuler.net/index.php?section=problems&amp;id=18" target="_blank">Problema numero 18</a></p>
<p>Problema apparentemente banale. Chiede di trovare il percorso che ottiene la somma massima del triangolo fornito, muovendosi da un numero ad uno dei due adiacenti nella riga sottostante. Sembra intuitivo che basti selezionare sempre il numero successivo maggiore per trovare il percorso maggiore, ma è ovviamente errato, in quanto si chiede il totale del percorso e non il totale dei massimi. La soluzione è di partire dall&#8217;ultima riga e procedere all&#8217;inverso.</p>
<p><strong>Soluzione Python</strong><br />
<table style="border: 1px solid #CCC;" cellpadding="3" width="100%">
  <tr>
    <td width="35">
      <img src="http://www.grys.it/wp-content/plugins/downloads-manager/img/icons/default.gif" alt="http://www.grys.it/wp-content/plugins/downloads-manager/img/icons/default.gif">
    </td>
    <td>
      <b>download:</b> <a href="http://www.grys.it/?file_id=21">Problema numero 18</a> <small>(661B)</small><br />
      <b>added:</b> 21/12/2009 <br />
      <b>clicks:</b> 398 <br />
      <b>description:</b>  <br />
    </td>
  </tr>
</table></p>
<p>Soluzione: <strong>1074</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.grys.it/index.php/2009/12/project-euler-18/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project Euler #17</title>
		<link>http://www.grys.it/index.php/2009/12/project-euler-17/</link>
		<comments>http://www.grys.it/index.php/2009/12/project-euler-17/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 14:25:43 +0000</pubDate>
		<dc:creator>gian</dc:creator>
				<category><![CDATA[Project Euler]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.grys.it/?p=699</guid>
		<description><![CDATA[Problema numero 17
Problema che per i non anglofoni può essere un po&#8217; ostico. Chiede di trovare con quante lettere possono essere espressi i numeri da 1 a 1000. In pratica si deve trasformare ogni numero nel corrispondente letterario, calcolarne le lettere e sommare il tutto.
Soluzione Python

  
    
    [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://projecteuler.net/index.php?section=problems&amp;id=17" target="_blank">Problema numero 17</a></p>
<p>Problema che per i non anglofoni può essere un po&#8217; ostico. Chiede di trovare con quante lettere possono essere espressi i numeri da 1 a 1000. In pratica si deve trasformare ogni numero nel corrispondente letterario, calcolarne le lettere e sommare il tutto.</p>
<p><strong>Soluzione Python</strong><br />
<table style="border: 1px solid #CCC;" cellpadding="3" width="100%">
  <tr>
    <td width="35">
      <img src="http://www.grys.it/wp-content/plugins/downloads-manager/img/icons/default.gif" alt="http://www.grys.it/wp-content/plugins/downloads-manager/img/icons/default.gif">
    </td>
    <td>
      <b>download:</b> <a href="http://www.grys.it/?file_id=20">Problema numero 17</a> <small>(1.24KB)</small><br />
      <b>added:</b> 21/12/2009 <br />
      <b>clicks:</b> 394 <br />
      <b>description:</b>  <br />
    </td>
  </tr>
</table></p>
<p>Risultato: <strong>21124</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.grys.it/index.php/2009/12/project-euler-17/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project Euler #16</title>
		<link>http://www.grys.it/index.php/2009/12/project-euler-16/</link>
		<comments>http://www.grys.it/index.php/2009/12/project-euler-16/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 12:12:55 +0000</pubDate>
		<dc:creator>gian</dc:creator>
				<category><![CDATA[Project Euler]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.grys.it/?p=695</guid>
		<description><![CDATA[Problema numero 16
Problema con un unico punto interessante: calcolare 2^1000, che ovviamente in python è banale. Il resto è banale, visto che si chiede di trovare la somma delle cifre.
Soluzione Python

  
    
      
    
    
     [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://projecteuler.net/index.php?section=problems&amp;id=16" target="_blank">Problema numero 16</a></p>
<p>Problema con un unico punto interessante: calcolare 2^1000, che ovviamente in python è banale. Il resto è banale, visto che si chiede di trovare la somma delle cifre.</p>
<p><strong>Soluzione Python</strong><br />
<table style="border: 1px solid #CCC;" cellpadding="3" width="100%">
  <tr>
    <td width="35">
      <img src="http://www.grys.it/wp-content/plugins/downloads-manager/img/icons/default.gif" alt="http://www.grys.it/wp-content/plugins/downloads-manager/img/icons/default.gif">
    </td>
    <td>
      <b>download:</b> <a href="http://www.grys.it/?file_id=19">Problema numero 16</a> <small>(118B)</small><br />
      <b>added:</b> 21/12/2009 <br />
      <b>clicks:</b> 356 <br />
      <b>description:</b>  <br />
    </td>
  </tr>
</table></p>
<p>Risultato: <strong>1366</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.grys.it/index.php/2009/12/project-euler-16/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project Euler #15</title>
		<link>http://www.grys.it/index.php/2009/12/project-euler-15/</link>
		<comments>http://www.grys.it/index.php/2009/12/project-euler-15/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 11:03:38 +0000</pubDate>
		<dc:creator>gian</dc:creator>
				<category><![CDATA[Project Euler]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.grys.it/?p=689</guid>
		<description><![CDATA[Problema numero 15
Problema interessante. Nell&#8217;esempio da l&#8217;impressione di essere facilmente risolvibile, ma in effetti richiede un po&#8217; di nozioni matematiche. Chiede di trovare quanti percorsi sono possibili dall&#8217;angolo superiore sinistro all&#8217;angolo inferiore destro di un quadrato da 20&#215;20. Il Triangolo di Pascal dice la sua in questo caso, visto che la soluzione al problema può [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://projecteuler.net/index.php?section=problems&amp;id=15" target="_blank">Problema numero 15</a></p>
<p>Problema interessante. Nell&#8217;esempio da l&#8217;impressione di essere facilmente risolvibile, ma in effetti richiede un po&#8217; di nozioni matematiche. Chiede di trovare quanti percorsi sono possibili dall&#8217;angolo superiore sinistro all&#8217;angolo inferiore destro di un quadrato da 20&#215;20. Il Triangolo di Pascal dice la sua in questo caso, visto che la soluzione al problema può essere trovata usandolo. In generale appare alla riga 2*n, colonna n del triangolo di Pascal.</p>
<p><strong>Soluzione Python</strong><br />
<table style="border: 1px solid #CCC;" cellpadding="3" width="100%">
  <tr>
    <td width="35">
      <img src="http://www.grys.it/wp-content/plugins/downloads-manager/img/icons/default.gif" alt="http://www.grys.it/wp-content/plugins/downloads-manager/img/icons/default.gif">
    </td>
    <td>
      <b>download:</b> <a href="http://www.grys.it/?file_id=18">Problema numero 15</a> <small>(423B)</small><br />
      <b>added:</b> 21/12/2009 <br />
      <b>clicks:</b> 371 <br />
      <b>description:</b>  <br />
    </td>
  </tr>
</table></p>
<p>Risultato: <strong>137846528820</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.grys.it/index.php/2009/12/project-euler-15/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project Euler #14</title>
		<link>http://www.grys.it/index.php/2009/12/project-euler-14/</link>
		<comments>http://www.grys.it/index.php/2009/12/project-euler-14/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 09:54:00 +0000</pubDate>
		<dc:creator>gian</dc:creator>
				<category><![CDATA[Project Euler]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.grys.it/?p=685</guid>
		<description><![CDATA[Problema numero 14
Problema divertente, che si può prestare a diverse ottimizzazioni (che ovviamente non ho fatto  ). Chiede di trovare quale numero sotto 1000000, genera la più lunga sequenza di numeri, date le due condizioni. Un attacco di forza bruta è ovviamente possibile ed in questo caso è anche praticabile. Un&#8217;ottimizzazione interessante da fare [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://projecteuler.net/index.php?section=problems&amp;id=14" target="_blank">Problema numero 14</a></p>
<p>Problema divertente, che si può prestare a diverse ottimizzazioni (che ovviamente non ho fatto <img src='http://www.grys.it/wp-includes/images/smilies/icon_razz.gif' alt=':-P' class='wp-smiley' /> ). Chiede di trovare quale numero sotto 1000000, genera la più lunga sequenza di numeri, date le due condizioni. Un attacco di forza bruta è ovviamente possibile ed in questo caso è anche praticabile. Un&#8217;ottimizzazione interessante da fare è quella di memorizzare i risultati intermedi, tenendo conto di quanto è lunga la sequenza generata, così da poter evitare di ricalcolare le sequenze per numeri che sono già noti.</p>
<p><strong>Soluzione Python</strong><br />
<table style="border: 1px solid #CCC;" cellpadding="3" width="100%">
  <tr>
    <td width="35">
      <img src="http://www.grys.it/wp-content/plugins/downloads-manager/img/icons/default.gif" alt="http://www.grys.it/wp-content/plugins/downloads-manager/img/icons/default.gif">
    </td>
    <td>
      <b>download:</b> <a href="http://www.grys.it/?file_id=17">Problema numero 14</a> <small>(344B)</small><br />
      <b>added:</b> 21/12/2009 <br />
      <b>clicks:</b> 336 <br />
      <b>description:</b>  <br />
    </td>
  </tr>
</table></p>
<p>Risultato: <strong>837799</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.grys.it/index.php/2009/12/project-euler-14/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project Euler #13</title>
		<link>http://www.grys.it/index.php/2009/12/project-euler-13/</link>
		<comments>http://www.grys.it/index.php/2009/12/project-euler-13/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 16:45:11 +0000</pubDate>
		<dc:creator>gian</dc:creator>
				<category><![CDATA[Project Euler]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.grys.it/?p=681</guid>
		<description><![CDATA[Problema numero 13
Chiede di trovare le prime 10 cifre del risultato della somma dei 100 numeri di 50 cifre forniti. Nonostante in python sia possibile usare direttamente i numeri forniti come cifre, alla fine ho optato per un programma che sommasse manualmente i numeri. Niente di speciale tutto sommato. La difficoltà secondo me è tutta [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://projecteuler.net/index.php?section=problems&amp;id=13" target="_blank">Problema numero 13</a></p>
<p>Chiede di trovare le prime 10 cifre del risultato della somma dei 100 numeri di 50 cifre forniti. Nonostante in python sia possibile usare direttamente i numeri forniti come cifre, alla fine ho optato per un programma che sommasse manualmente i numeri. Niente di speciale tutto sommato. La difficoltà secondo me è tutta nella gestione dei numeri.</p>
<p><strong>Soluzione Python</strong><br />
<table style="border: 1px solid #CCC;" cellpadding="3" width="100%">
  <tr>
    <td width="35">
      <img src="http://www.grys.it/wp-content/plugins/downloads-manager/img/icons/default.gif" alt="http://www.grys.it/wp-content/plugins/downloads-manager/img/icons/default.gif">
    </td>
    <td>
      <b>download:</b> <a href="http://www.grys.it/?file_id=16">Problema numero 13</a> <small>(5.76KB)</small><br />
      <b>added:</b> 21/12/2009 <br />
      <b>clicks:</b> 370 <br />
      <b>description:</b>  <br />
    </td>
  </tr>
</table></p>
<p>Risultato: <strong>5537376230</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.grys.it/index.php/2009/12/project-euler-13/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project Euler #12</title>
		<link>http://www.grys.it/index.php/2009/12/project-euler-12/</link>
		<comments>http://www.grys.it/index.php/2009/12/project-euler-12/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 15:34:25 +0000</pubDate>
		<dc:creator>gian</dc:creator>
				<category><![CDATA[Project Euler]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.grys.it/?p=678</guid>
		<description><![CDATA[Problema numero 12
Si comincia a fare qualcosa di diverso. Il problema chiede di trovare il primo numero triangolare ad avere più di 500 divisori. Il numero triangolare viene generato sommando i numeri naturali.
L&#8217;unica accortezza è stata quella di ottimizzare il ciclo di ricerca dei divisori, usando due accorgimenti, dato il dividendo

si può ciclare sono fino [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://projecteuler.net/index.php?section=problems&amp;id=12" target="_blank">Problema numero 12</a></p>
<p>Si comincia a fare qualcosa di diverso. Il problema chiede di trovare il primo numero triangolare ad avere più di 500 divisori. Il numero triangolare viene generato sommando i numeri naturali.</p>
<p>L&#8217;unica accortezza è stata quella di ottimizzare il ciclo di ricerca dei divisori, usando due accorgimenti, dato il dividendo</p>
<ol>
<li>si può ciclare sono fino alla radice quadrata +1 del dividendo</li>
<li>una volta trovato un divisore,  si può conteggiare anche il quoziente come un divisore</li>
</ol>
<p><strong>Soluzione Python</strong><br />
<table style="border: 1px solid #CCC;" cellpadding="3" width="100%">
  <tr>
    <td width="35">
      <img src="http://www.grys.it/wp-content/plugins/downloads-manager/img/icons/default.gif" alt="http://www.grys.it/wp-content/plugins/downloads-manager/img/icons/default.gif">
    </td>
    <td>
      <b>download:</b> <a href="http://www.grys.it/?file_id=15">Problema 12</a> <small>(407B)</small><br />
      <b>added:</b> 21/12/2009 <br />
      <b>clicks:</b> 373 <br />
      <b>description:</b>  <br />
    </td>
  </tr>
</table></p>
<p>Risultato: <strong>76576500</strong></p>
<p><strong><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.grys.it/index.php/2009/12/project-euler-12/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project Euler #11</title>
		<link>http://www.grys.it/index.php/2009/12/project-euler-11/</link>
		<comments>http://www.grys.it/index.php/2009/12/project-euler-11/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 12:00:03 +0000</pubDate>
		<dc:creator>gian</dc:creator>
				<category><![CDATA[Project Euler]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.grys.it/?p=674</guid>
		<description><![CDATA[Problema numero 11
Un problema divertente. Chiede di trovare il prodotto più alto di quattro numeri adiacenti, in qualsiasi verso (verticale, orizzontale o obliquo). Banalemente un attacco di forza bruta  
Soluzione Python

  
    
      
    
    
    [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://projecteuler.net/index.php?section=problems&amp;id=11" target="_blank">Problema numero 11</a></p>
<p>Un problema divertente. Chiede di trovare il prodotto più alto di quattro numeri adiacenti, in qualsiasi verso (verticale, orizzontale o obliquo). Banalemente un attacco di forza bruta <img src='http://www.grys.it/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><strong>Soluzione Python</strong></p>
<p><table style="border: 1px solid #CCC;" cellpadding="3" width="100%">
  <tr>
    <td width="35">
      <img src="http://www.grys.it/wp-content/plugins/downloads-manager/img/icons/default.gif" alt="http://www.grys.it/wp-content/plugins/downloads-manager/img/icons/default.gif">
    </td>
    <td>
      <b>download:</b> <a href="http://www.grys.it/?file_id=14">Problema 11</a> <small>(3.40KB)</small><br />
      <b>added:</b> 21/12/2009 <br />
      <b>clicks:</b> 337 <br />
      <b>description:</b>  <br />
    </td>
  </tr>
</table></p>
<p>Risultato: <strong>70600674</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.grys.it/index.php/2009/12/project-euler-11/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

