Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,8 @@
|
|||
//I provide 2 fuctions D2N takes a radix and an integer returning a sequence of integers
|
||||
// N2D takse a radix and a sequence of integers returning an integer
|
||||
//Note that the radix may be either positive or negative. Nigel Galloway, May 10th., 2019
|
||||
let D2N n g=if g=0 then seq[0] else Seq.unfold(fun g->let α,β=g/n,g%n in match (compare g 0,β) with
|
||||
(0,_)->None
|
||||
|(1,_) |(_,0)->Some(β,α)
|
||||
|_->Some(g-(α+1)*n,α+1)) g|>Seq.rev
|
||||
let N2D n g=fst(Seq.foldBack(fun g (Σ,α)->(Σ+α*g,n*α)) g (0,1))
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
let t0,t146,t10,t15=D2N -13 0,D2N -3 146,D2N -2 10,D2N -10 15
|
||||
Seq.iter(fun n->Seq.iter(printf "%d ")n; printfn "")[t0;t146;t10;t15]
|
||||
Seq.iter(printfn "%d ")[N2D -13 t0;N2D -3 t146;N2D -2 t10;N2D -10 t15]
|
||||
Loading…
Add table
Add a link
Reference in a new issue