Sequence: smallest number greater than previous term with exactly n divisors: Difference between revisions

Realize in F#
(Realize in F#)
Line 272:
1 2 4 6 16 18 64 66 100 112 1024 1035 4096 4288 4624</pre>
 
=={{header|F_Sharp|F#}}==
===First 28 are easy with a Naive implementation===
<lang fsharp>
// Nigel Galloway: November 19th., 2017
let fN g=[1..(float>>sqrt>>int)g]|>List.fold(fun Σ n->if g%n>0 then Σ else if g/n=n then Σ+1 else Σ+2) 0
let A069654=let rec fG n g=seq{match g-fN n with 0->yield n; yield! fG(n+1)(g+1) |_->yield! fG(n+1)g} in fG 1 1
 
A069654 |> Seq.take 28|>Seq.iter(printf "%d "); printfn ""
</lang>
{{out}}
<pre>
1 2 4 6 16 18 64 66 100 112 1024 1035 4096 4288 4624 4632 65536 65572 262144 262192 263169 269312 4194304 4194306 4477456 4493312 4498641 4498752
</pre>
=={{header|Factor}}==
<lang factor>USING: io kernel math math.primes.factors prettyprint sequences ;
2,171

edits