The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be:
1, 3, 6, 10, 15, 21, 28, 36, 45, 55, …
Let us list the factors of [...]
|
||||||
|
The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be: 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, … Let us list the factors of [...] The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be: 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, … Let us list the factors of [...] ?View Code SCHEME1 ?View Code RUBY1 ?View Code JAVA1 ?View Code SCHEME1 ?View Code RUBY1 ?View Code PYTHON1 It is very hard to come up with Prolog answers to Project Euler. If you have any please add as a comment to problems posted here. ?View Code PROLOG1 I decided to post some older solutions I have. I had posted these on my forum; however it does not appear on the search engine so I think this will be more convenient. ?View Code JAVA1 |
||||||
|
Copyright © 2010 Javaist Blog - All Rights Reserved |
||||||