Monthly Archives: February 2013

Projecteuler.net – Problem 46 – Java

http://projecteuler.net/problem=46 Lots of code follows. Not as slim as it might have been if I did it in a procedural way. But I’m trying to make and reuse as much code as possible for later problems. What I’ve done is … Continue reading

Posted in Java, Project Euler | Leave a comment

Projecteuler.net – Problem 44 – Java

http://projecteuler.net/problem=44 I populated a Set with a range of Pentagonal numbers that I thought might contain the result. Then I check if the Sums and Differences are already in the Set. This method is not optimum as it will end … Continue reading

Posted in Java, Project Euler | Leave a comment

Projecteuler.net – Problem 45 – Java

http://projecteuler.net/problem=45 I just solved each equation for the variable I was trying to find. Then, if the ‘solution modulo 1′ equals 0, I know I have a whole number. Since we know the first Triangle number that works is 285, … Continue reading

Posted in Java, Project Euler | Leave a comment

Projecteuler.net – Problem 41 – Java

http://projecteuler.net/problem=41 Made use again of Lexicographic permutation so I put it in a class of its own. I also created a Prime class that checks if a number is prime. I kind of lucked out and didn’t have to check … Continue reading

Posted in Java, Project Euler | Leave a comment

Projecteuler.net – Problem 43 – Java

http://projecteuler.net/problem=43 I recycled some code from the previous problem I worked on that used Lexicographic permutations. This will just cycle through all the possibilities without repeats and maintain the ‘pandigital-ness’ of the number we are starting with. If I find … Continue reading

Posted in Java, Project Euler | Leave a comment