summaryrefslogtreecommitdiff
path: root/problem37.ijs
blob: bebb9de6b33c67a860649f2e988f55b728f46307 (plain) (blame)
1
2
3
4
5
6
7
enc =: 10&#.
digits =: enc^:_1
truncs =: monad : '(1-#y)+i._1+2*#y'
truncations =: monad : '; enc@:}.&y each truncs y'
truncatablePrime =: monad : '*./1&p: truncations digits y'"0
primes =: 4}.p:i.1e5 NB. A good guess :)
problem37 =: +/(truncatablePrime#]) primes