Additive primes: Difference between revisions
→{{header|langur}}
(Added Oberon-07) |
Langurmonkey (talk | contribs) |
||
(One intermediate revision by one other user not shown) | |||
Line 428:
FI
OD;
print( ( newline, "Found ", whole( additive count, 0 )
print( ( " additive primes below ", whole( UPB prime + 1, 0 ), newline ) )
END</syntaxhighlight>
{{out}}
Line 2,366 ⟶ 2,367:
}
val .sumDigits = fn
writeln "Additive primes less than 500:"
Line 2,374 ⟶ 2,375:
for .i in [2] ~ series(3..500, 2) {
if .isPrime(.i) and .isPrime(.sumDigits(.i)) {
write
.count += 1
if .count div 10: writeln()
Line 2,380 ⟶ 2,381:
}
writeln
</syntaxhighlight>
|