Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,10 @@
|
|||
// Generate EKG Sequences. Nigel Galloway: December 6th., 2018
|
||||
let EKG n=seq{
|
||||
let fN,fG=let i=System.Collections.Generic.Dictionary<int,int>()
|
||||
let fN g=(if not (i.ContainsKey g) then i.[g]<-g);(g,i.[g])
|
||||
((fun e->i.[e]<-i.[e]+e), (fun l->l|>List.map fN))
|
||||
let fU l= pCache|>Seq.takeWhile(fun n->n<=l)|>Seq.filter(fun n->l%n=0)|>List.ofSeq
|
||||
let rec EKG l (α,β)=seq{let b=fU β in if (β=n||β<snd((fG b|>List.maxBy snd))) then fN α; yield! EKG l (fG l|>List.minBy snd)
|
||||
else fN α;yield β;yield! EKG b (fG b|>List.minBy snd)}
|
||||
yield! seq[1;n]; let g=fU n in yield! EKG g (fG g|>Seq.minBy snd)}
|
||||
let EKGconv n g=Seq.zip(EKG n)(EKG g)|>Seq.skip 2|>Seq.scan(fun(n,i,g,e)(l,β)->(Set.add l n,Set.add β i,l,β))(set[1;n],set[1;g],0,0)|>Seq.takeWhile(fun(n,i,g,e)->g<>e||n<>i)
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
EKG 2 |> Seq.take 45 |> Seq.iter(printf "%2d, ")
|
||||
EKG 3 |> Seq.take 45 |> Seq.iter(printf "%2d, ")
|
||||
EKG 5 |> Seq.take 45 |> Seq.iter(printf "%2d, ")
|
||||
EKG 7 |> Seq.take 45 |> Seq.iter(printf "%2d, ")
|
||||
EKG 9 |> Seq.take 45 |> Seq.iter(printf "%2d, ")
|
||||
EKG 10 |> Seq.take 45 |> Seq.iter(printf "%2d, ")
|
||||
printfn "%d" (let n,_,_,_=EKGconv 2 5|>Seq.last in ((Set.count n)+1)
|
||||
|
|
@ -0,0 +1 @@
|
|||
prıntfn "%d" (EKG 2|>Seq.takeWhile(fun n->n<>104729) ((Seq.length n)+1)
|
||||
Loading…
Add table
Add a link
Reference in a new issue