Data update
This commit is contained in:
parent
8e4e15fa56
commit
72eb4943cb
1853 changed files with 35514 additions and 9441 deletions
|
|
@ -1,15 +1,15 @@
|
|||
val isPrime = fn(i) {
|
||||
i == 2 or i > 2 and
|
||||
not any(fn x: i div x, pseries(2 .. i ^/ 2))
|
||||
not any(series(2 .. i ^/ 2, asconly=true), by=fn x:i div x)
|
||||
}
|
||||
|
||||
val sumDigits = fn i: fold(fn{+}, s2n(string(i)))
|
||||
val sumDigits = fn i: fold(s2n(string(i)), by=fn{+})
|
||||
|
||||
writeln "Additive primes less than 500:"
|
||||
|
||||
var cnt = 0
|
||||
|
||||
for i in [2] ~ series(3..500, 2) {
|
||||
for i in [2] ~ series(3..500, inc=2) {
|
||||
if isPrime(i) and isPrime(sumDigits(i)) {
|
||||
write "{{i:3}} "
|
||||
cnt += 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue