Smarandache prime-digital sequence: Difference between revisions

Content added Content deleted
m (→‎{{header|REXX}}: simplified the subroutine, changed some comments, added wording to the REXX section header.)
(Realize in F#)
Line 16: Line 16:
<br><br>
<br><br>


=={{header|F_Sharp|F#}}==
This task uses [http://www.rosettacode.org/wiki/Extensible_prime_generator#The_function Extensible Prime Generator (F#)]
<lang fsharp>
// Generate Smarandache prime-digital sequence. Nigel Galloway: May 31st., 2019
let rec spds g=seq{yield! g; yield! (spds (Seq.collect(fun g->[g*10+2;g*10+3;g*10+5;g*10+7]) g))}|>Seq.filter(isPrime)
spds [2;3;5;7] |> Seq.take 25 |> Seq.iter(printfn "%d")
printfn "\n\n100th item of this sequence is %d" (spds [2;3;5;7] |> Seq.item 99)
</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


100th item of this sequence is 33223
</pre>
=={{header|Go}}==
=={{header|Go}}==
As this task doesn't involve large numbers, a simple prime test routine is adequate.
As this task doesn't involve large numbers, a simple prime test routine is adequate.