2 people like it.
Like the snippet!
Let's have some fun with higher order functions and instead of folding over a list, fold over the prime factors of a number. It can be optimized further by dividing out real primes instead of numbers of the form 6k+/1, but it's not embarrassingly slow.
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 

Link:  http://fssnip.net/8O 
Posted:  5 years ago 
Author:  Arjen Kopinga 
Tags:  algorithms , primes , factorize , fold 