https://projecteuler.net/problem=1
> If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
> Find the sum of all the multiples of 3 or 5 below 1000.
I tried dual iterators at first but it turned out to be more elegant to just generate the multiples directly using the sequence:
3 2 1 3 1 2 3
http://joypy.osdn.io/notebooks/Developing.html
(In re: catamorphism et. al. see http://joypy.osdn.io/notebooks/Recursion_Combinators.html Cheers!)
https://projecteuler.net/problem=1
> If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
> Find the sum of all the multiples of 3 or 5 below 1000.
I tried dual iterators at first but it turned out to be more elegant to just generate the multiples directly using the sequence:
It turn out that the differences between successive multiples always form a palindrome.http://joypy.osdn.io/notebooks/Developing.html
(In re: catamorphism et. al. see http://joypy.osdn.io/notebooks/Recursion_Combinators.html Cheers!)