<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments for Javaist Blog</title>
	<atom:link href="http://www.javaist.com/blog/?feed=comments-rss2" rel="self" type="application/rss+xml" />
	<link>http://www.javaist.com/blog</link>
	<description>all about programming</description>
	<lastBuildDate>Sat, 14 Aug 2010 22:33:33 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>Comment on Project Euler Problem 61 in Java by Pajp</title>
		<link>http://www.javaist.com/blog/?p=286&#038;cpage=1#comment-382</link>
		<dc:creator>Pajp</dc:creator>
		<pubDate>Sat, 14 Aug 2010 22:33:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.javaist.com/blog/?p=286#comment-382</guid>
		<description>A solution in python (About a tenth as long). You should be able to translate it to Java, nothing pretty Python-specific:

numbers = [[], [], [], [], [], [], [], [], []] 

n=1
while True:
   tri = n*(n+1)/2
   squ = n*n 
   penta = n*(3*n-1)/2
   hexa = n*(2*n-1)
   hepta = n*(5*n-3)/2
   octa = n*(3*n-2)
   if tri &gt; 9999:
      break
   if tri &gt; 999 and tri  999 and squ  999 and penta  999 and hexa  999 and hepta  999 and octa &lt; 10000:
      numbers[8].append([n, octa, 8]) 
   n=n+1

def isCyclic(n1, n2):
   return str(n1)[2:4] == str(n2)[0:2]

def solve(solution):
   if len(solution) == 6:
      if isCyclic(solution[len(solution)-1][1], solution[0][1]) and solution[len(solution)-1][0] != solution[0][0]:
         print &quot;Found solution:&quot;
         print solution
         s = 0 
         for sol in solution:
            s = s + sol[1]
         print &quot;Sum is: &quot; + str(s)
      return
   else:
      for n in range(3,9):
         Found = False
         for sol in solution:
            if sol[2] == n:
               Found = True
               break 
         if Found:
            continue
         for i in range(0,len(numbers[n])):
            if len(solution) == 0 or numbers[n][i][0] != solution[len(solution)-1][0]:
               if len(solution) == 0 or isCyclic(solution[len(solution)-1][1], numbers[n][i][1]):
                  solution.append(numbers[n][i])
                  solve(solution)
                  solution.pop()

solve([])</description>
		<content:encoded><![CDATA[<p>A solution in python (About a tenth as long). You should be able to translate it to Java, nothing pretty Python-specific:</p>
<p>numbers = [[], [], [], [], [], [], [], [], []] </p>
<p>n=1<br />
while True:<br />
   tri = n*(n+1)/2<br />
   squ = n*n<br />
   penta = n*(3*n-1)/2<br />
   hexa = n*(2*n-1)<br />
   hepta = n*(5*n-3)/2<br />
   octa = n*(3*n-2)<br />
   if tri &gt; 9999:<br />
      break<br />
   if tri &gt; 999 and tri  999 and squ  999 and penta  999 and hexa  999 and hepta  999 and octa &lt; 10000:<br />
      numbers[8].append([n, octa, 8])<br />
   n=n+1</p>
<p>def isCyclic(n1, n2):<br />
   return str(n1)[2:4] == str(n2)[0:2]</p>
<p>def solve(solution):<br />
   if len(solution) == 6:<br />
      if isCyclic(solution[len(solution)-1][1], solution[0][1]) and solution[len(solution)-1][0] != solution[0][0]:<br />
         print &quot;Found solution:&quot;<br />
         print solution<br />
         s = 0<br />
         for sol in solution:<br />
            s = s + sol[1]<br />
         print &quot;Sum is: &quot; + str(s)<br />
      return<br />
   else:<br />
      for n in range(3,9):<br />
         Found = False<br />
         for sol in solution:<br />
            if sol[2] == n:<br />
               Found = True<br />
               break<br />
         if Found:<br />
            continue<br />
         for i in range(0,len(numbers[n])):<br />
            if len(solution) == 0 or numbers[n][i][0] != solution[len(solution)-1][0]:<br />
               if len(solution) == 0 or isCyclic(solution[len(solution)-1][1], numbers[n][i][1]):<br />
                  solution.append(numbers[n][i])<br />
                  solve(solution)<br />
                  solution.pop()</p>
<p>solve([])</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Project Euler Problem 61 in Java by Kim Hansen</title>
		<link>http://www.javaist.com/blog/?p=286&#038;cpage=1#comment-381</link>
		<dc:creator>Kim Hansen</dc:creator>
		<pubDate>Wed, 21 Jul 2010 21:54:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.javaist.com/blog/?p=286#comment-381</guid>
		<description>Hi Javaist,

I noticed you have solutions for some of the project Euler problems published.

They look nice, but I would kindly like you to reconsider if it is appropriate / in the spirit of Project Euler to publish solutions in public?

There are many cheaters spamming the high score lists in PE due to the easy accessibility of solutions on the net. I think it is a pity that solutions are available in public. It takes away a lot of the fun for those of us who work trhough it ourselves to see users climb the high score lists in a pace which implies that they have to be cheating.

I do realize that the javaist blog is not the only one having solutions published, I will attempt to contact those of them I manage to find as well.

Please help the potential cheaters but not making it possible to cheat :-)

Best wishes,

Kim aka user Slaunger on PE</description>
		<content:encoded><![CDATA[<p>Hi Javaist,</p>
<p>I noticed you have solutions for some of the project Euler problems published.</p>
<p>They look nice, but I would kindly like you to reconsider if it is appropriate / in the spirit of Project Euler to publish solutions in public?</p>
<p>There are many cheaters spamming the high score lists in PE due to the easy accessibility of solutions on the net. I think it is a pity that solutions are available in public. It takes away a lot of the fun for those of us who work trhough it ourselves to see users climb the high score lists in a pace which implies that they have to be cheating.</p>
<p>I do realize that the javaist blog is not the only one having solutions published, I will attempt to contact those of them I manage to find as well.</p>
<p>Please help the potential cheaters but not making it possible to cheat <img src='http://www.javaist.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Best wishes,</p>
<p>Kim aka user Slaunger on PE</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Project Euler Problem 1 in Scheme by Michael</title>
		<link>http://www.javaist.com/blog/?p=333&#038;cpage=1#comment-379</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Sat, 23 Jan 2010 15:50:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.javaist.com/blog/?p=333#comment-379</guid>
		<description>I just randomly stumbled upon your site, here&#039;s my take on your solution:

(define (3-or-5 limit)
  (3-or-5-helper limit 0 0))
 
(define (3-or-5-helper limit start sum)
  (cond ((= limit start) sum)
        ((or (= (remainder start 3) 0)
            (= (remainder start 5) 0))
                (3-or-5-helper limit (+ 1 start) (+ start sum)))
        (else (3-or-5-helper limit (+ 1 start) sum))))

(3-or-5 1000)</description>
		<content:encoded><![CDATA[<p>I just randomly stumbled upon your site, here&#8217;s my take on your solution:</p>
<p>(define (3-or-5 limit)<br />
  (3-or-5-helper limit 0 0))</p>
<p>(define (3-or-5-helper limit start sum)<br />
  (cond ((= limit start) sum)<br />
        ((or (= (remainder start 3) 0)<br />
            (= (remainder start 5) 0))<br />
                (3-or-5-helper limit (+ 1 start) (+ start sum)))<br />
        (else (3-or-5-helper limit (+ 1 start) sum))))</p>
<p>(3-or-5 1000)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on A Cryptarithmetic Puzzle in Prolog by sandeep soni</title>
		<link>http://www.javaist.com/blog/?p=70&#038;cpage=1#comment-378</link>
		<dc:creator>sandeep soni</dc:creator>
		<pubDate>Wed, 23 Dec 2009 15:49:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.javaist.com/blog/?p=70#comment-378</guid>
		<description>i want to no d procedure dat hw i can solve dese puzzzle i want  to  knw sm technique</description>
		<content:encoded><![CDATA[<p>i want to no d procedure dat hw i can solve dese puzzzle i want  to  knw sm technique</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Project Euler Problem 1 in Python by KratosDon</title>
		<link>http://www.javaist.com/blog/?p=329&#038;cpage=1#comment-377</link>
		<dc:creator>KratosDon</dc:creator>
		<pubDate>Thu, 17 Dec 2009 06:58:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.javaist.com/blog/?p=329#comment-377</guid>
		<description>print sum([x for x in range(1000) if x % 3 == 0 or x % 5 == 0])</description>
		<content:encoded><![CDATA[<p>print sum([x for x in range(1000) if x % 3 == 0 or x % 5 == 0])</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Protected: Sudoku Solver in Python by st0le</title>
		<link>http://www.javaist.com/blog/?p=370&#038;cpage=1#comment-375</link>
		<dc:creator>st0le</dc:creator>
		<pubDate>Thu, 10 Dec 2009 03:21:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.javaist.com/blog/?p=370#comment-375</guid>
		<description>Protected Comments: Please enter your password to view comments.</description>
		<content:encoded><![CDATA[<form action="http://www.javaist.com/blog/wp-pass.php" method="post">
	<p>This post is password protected. To view it please enter your password below:</p>
	<p><label for="pwbox-370">Password: <input name="post_password" id="pwbox-370" type="password" size="20" /></label> <input type="submit" name="Submit" value="Submit" /></p>
	</form>
	]]></content:encoded>
	</item>
	<item>
		<title>Comment on Quadratic Equation Solver in MATLAB by MATLAB postings review &#124; CroAxis.com</title>
		<link>http://www.javaist.com/blog/?p=148&#038;cpage=1#comment-348</link>
		<dc:creator>MATLAB postings review &#124; CroAxis.com</dc:creator>
		<pubDate>Sat, 07 Nov 2009 16:04:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.javaist.com/blog/?p=148#comment-348</guid>
		<description>[...] Quadratic equation solver in MATLAB [...]</description>
		<content:encoded><![CDATA[<p>[...] Quadratic equation solver in MATLAB [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Project Euler Problem 72 in MATLAB by MATLAB postings review &#124; CroAxis.com</title>
		<link>http://www.javaist.com/blog/?p=275&#038;cpage=1#comment-337</link>
		<dc:creator>MATLAB postings review &#124; CroAxis.com</dc:creator>
		<pubDate>Sat, 24 Oct 2009 14:40:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.javaist.com/blog/?p=275#comment-337</guid>
		<description>[...] Euler problems in the scope with MATLAB [...]</description>
		<content:encoded><![CDATA[<p>[...] Euler problems in the scope with MATLAB [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Project Euler Problem 72 in MATLAB by New MATLAB blog in our blogroll &#124; CroAxis.com</title>
		<link>http://www.javaist.com/blog/?p=275&#038;cpage=1#comment-336</link>
		<dc:creator>New MATLAB blog in our blogroll &#124; CroAxis.com</dc:creator>
		<pubDate>Sat, 24 Oct 2009 14:34:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.javaist.com/blog/?p=275#comment-336</guid>
		<description>[...] site is called Javaist blog and its MATLAB session can be located through this link here&#8230;      Posted in Engineering &#8226; Tags: MATLAB [...]</description>
		<content:encoded><![CDATA[<p>[...] site is called Javaist blog and its MATLAB session can be located through this link here&#8230;      Posted in Engineering &bull; Tags: MATLAB [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Project Euler Problem 1 in Prolog by mat</title>
		<link>http://www.javaist.com/blog/?p=327&#038;cpage=1#comment-334</link>
		<dc:creator>mat</dc:creator>
		<pubDate>Fri, 23 Oct 2009 17:35:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.javaist.com/blog/?p=327#comment-334</guid>
		<description>I find Prolog especially well-suited for many project Euler problems. With SWI Prolog 5.8.0, you can easily solve Problem 1 like this:
&lt;code&gt;
$ swipl -q
?- [library(clpfd)].
true.

?- findall(N, (N mod 3 #= 0 #\/ N mod 5 #= 0, N in 0..999, indomain(N)), Ns), sum(Ns, #=, Sum).
Ns = [0, 3, 5, 6, 9, 10, 12, 15, 18&#124;...],
Sum = 233168.
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>I find Prolog especially well-suited for many project Euler problems. With SWI Prolog 5.8.0, you can easily solve Problem 1 like this:<br />
<code><br />
$ swipl -q<br />
?- [library(clpfd)].<br />
true.</p>
<p>?- findall(N, (N mod 3 #= 0 #\/ N mod 5 #= 0, N in 0..999, indomain(N)), Ns), sum(Ns, #=, Sum).<br />
Ns = [0, 3, 5, 6, 9, 10, 12, 15, 18|...],<br />
Sum = 233168.<br />
</code></p>
]]></content:encoded>
	</item>
</channel>
</rss>
