Smarandache prime-digital sequence: Difference between revisions
Smarandache prime-digital sequence (view source)
Revision as of 04:54, 29 November 2020
, 3 years ago→{{header|Ring}}
(Added Swift solution) |
|||
Line 1,346:
=={{header|Ring}}==
<lang ring>
load "stdlib.ring"
limit = 25▼
num = 0▼
see "First 25 Calmo primes are:" + nl▼
for n = 1 to max▼
if isprime(n)▼
res = calmo(n)▼
if res = 1▼
num = num + 1▼
if num < limit + 1▼
see "" + num + ". " + n + nl▼
ok▼
if num = 100▼
see "" + num + ". " + n + nl▼
exit▼
ok▼
ok▼
ok▼
next▼
▲num = 0
if not isprime(sp[n])▼
limit100 = 100
for n = 1 to
flag = 0
▲ if isprime(n) and isprime(nx)
else
next
▲ ok
▲ ok
▲next
</lang>
{{Out}}
<pre>
2 3 5 7 23 37 53 73 223 227 233 257 277 337 353 373 523 557 577 727 733 757 773 2237 2273
▲First 25 Calmo primes are:
100th Smarandache prime: 33223
</pre>
|