Smarandache prime-digital sequence: Difference between revisions

Added Easylang
(add RPL)
(Added Easylang)
 
(3 intermediate revisions by 2 users not shown)
Line 624:
</pre>
 
 
=={{header|EasyLang}}==
<syntaxhighlight>
fastfunc isprim num .
i = 2
while i <= sqrt num
if num mod i = 0
return 0
.
i += 1
.
return 1
.
n = 2
repeat
if isprim n = 1
h = n
while h > 0
d = h mod 10
if d < 2 or d = 4 or d = 6 or d > 7
break 1
.
h = h div 10
.
if h = 0
cnt += 1
if cnt <= 25
write n & " "
.
.
.
until cnt = 100
n += 1
.
print ""
print n
</syntaxhighlight>
 
{{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
33223
</pre>
 
=={{header|F_Sharp|F#}}==
Line 928 ⟶ 971:
=={{header|Fōrmulæ}}==
 
{{FormulaeEntry|page=https://formulae.org/?script=examples/Smarandache_prime-digital_sequence}}
Fōrmulæ programs are not textual, visualization/edition of programs is done showing/manipulating structures but not text. Moreover, there can be multiple visual representations of the same program. Even though it is possible to have textual representation &mdash;i.e. XML, JSON&mdash; they are intended for storage and transfer purposes more than visualization and edition.
 
'''Solution'''
 
[[File:Fōrmulæ - Smarandache prime-digital sequence 01.png]]
 
'''Case 1. Show the first 25 SPDS primes'''
 
[[File:Fōrmulæ - Smarandache prime-digital sequence 02.png]]
 
[[File:Fōrmulæ - Smarandache prime-digital sequence 03.png]]
 
'''Case 2. Show the hundredth SPDS prime'''
 
[[File:Fōrmulæ - Smarandache prime-digital sequence 04.png]]
 
[[File:Fōrmulæ - Smarandache prime-digital sequence 05.png]]
 
'''Additional cases. Show the 1000-th, 10,000-th and 100,000th SPDS primes'''
 
[[File:Fōrmulæ - Smarandache prime-digital sequence 06.png]]
 
[[File:Fōrmulæ - Smarandache prime-digital sequence 07.png]]
 
[[File:Fōrmulæ - Smarandache prime-digital sequence 08.png]]
 
[[File:Fōrmulæ - Smarandache prime-digital sequence 09.png]]
 
[[File:Fōrmulæ - Smarandache prime-digital sequence 10.png]]
Programs in Fōrmulæ are created/edited online in its [https://formulae.org website], However they run on execution servers. By default remote servers are used, but they are limited in memory and processing power, since they are intended for demonstration and casual use. A local server can be downloaded and installed, it has no limitations (it runs in your own computer). Because of that, example programs can be fully visualized and edited, but some of them will not run if they require a moderate or heavy computation/memory resources, and no local server is being used.
 
[[File:Fōrmulæ - Smarandache prime-digital sequence 11.png]]
In '''[https://formulae.org/?example=Smarandache_prime-digital_sequence this]''' page you can see the program(s) related to this task and their results.
 
=={{header|Go}}==
Line 2,235 ⟶ 2,304:
{{libheader|Wren-math}}
Simple brute-force approach.
<syntaxhighlight lang="ecmascriptwren">import "./math" for Int
 
var limit = 1000
1,978

edits