Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
7
Task/Jacobsthal-numbers/F-Sharp/jacobsthal-numbers.fs
Normal file
7
Task/Jacobsthal-numbers/F-Sharp/jacobsthal-numbers.fs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
// Jacobsthal numbers: Nigel Galloway January 10th., 2023
|
||||
let J,JL=let fN g ()=Seq.unfold(fun(n,g)->Some(n,(g,g+2UL*n)))(g,1UL) in (fN 0UL,fN 2UL)
|
||||
printf "First 30 Jacobsthal are "; J()|>Seq.take 30|>Seq.iter(printf "%d "); printfn ""
|
||||
printf "First 30 Jacobsthal-Lucas are "; JL()|>Seq.take 30|>Seq.iter(printf "%d "); printfn ""
|
||||
printf "First 20 Jacobsthal Oblong are "; J()|>Seq.pairwise|>Seq.take 20|>Seq.iter(fun(n,g)->printf "%d " (n*g)); printfn ""
|
||||
let fN g= Open.Numeric.Primes.MillerRabin.IsPrime &g
|
||||
printf "First 10 Jacobsthal Primes are "; J()|>Seq.filter fN|>Seq.take 10|>Seq.iter(printf "%d "); printfn ""
|
||||
Loading…
Add table
Add a link
Reference in a new issue