Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
43
Task/Additive-primes/PILOT/additive-primes.pilot
Normal file
43
Task/Additive-primes/PILOT/additive-primes.pilot
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
C :z=2
|
||||
:c=0
|
||||
:max=500
|
||||
*number
|
||||
C :n=z
|
||||
U :*digsum
|
||||
C :n=s
|
||||
U :*prime
|
||||
J (p=0):*next
|
||||
C :n=z
|
||||
U :*prime
|
||||
J (p=0):*next
|
||||
T :#z
|
||||
C :c=c+1
|
||||
*next
|
||||
C :z=z+1
|
||||
J (z<max):*number
|
||||
T :There are #c additive primes below #max
|
||||
E :
|
||||
|
||||
*prime
|
||||
C :p=1
|
||||
E (n<4):
|
||||
C :p=0
|
||||
E (n=2*(n/2)):
|
||||
C :i=3
|
||||
:m=n/2
|
||||
*ptest
|
||||
E (n=i*(n/i)):
|
||||
C :i=i+2
|
||||
J (i<=m):*ptest
|
||||
C :p=1
|
||||
E :
|
||||
|
||||
*digsum
|
||||
C :s=0
|
||||
:i=n
|
||||
*digit
|
||||
C :j=i/10
|
||||
:s=s+(i-j*10)
|
||||
:i=j
|
||||
J (i>0):*digit
|
||||
E :
|
||||
Loading…
Add table
Add a link
Reference in a new issue