Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
27
Task/Additive-primes/Ring/additive-primes.ring
Normal file
27
Task/Additive-primes/Ring/additive-primes.ring
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
load "stdlib.ring"
|
||||
|
||||
see "working..." + nl
|
||||
see "Additive primes are:" + nl
|
||||
|
||||
row = 0
|
||||
limit = 500
|
||||
|
||||
for n = 1 to limit
|
||||
num = 0
|
||||
if isprime(n)
|
||||
strn = string(n)
|
||||
for m = 1 to len(strn)
|
||||
num = num + number(strn[m])
|
||||
next
|
||||
if isprime(num)
|
||||
row = row + 1
|
||||
see "" + n + " "
|
||||
if row%10 = 0
|
||||
see nl
|
||||
ok
|
||||
ok
|
||||
ok
|
||||
next
|
||||
|
||||
see nl + "found " + row + " additive primes." + nl
|
||||
see "done..." + nl
|
||||
Loading…
Add table
Add a link
Reference in a new issue