Metallic ratios: Difference between revisions

m
→‎{{header|F_Sharp|F#}}: task description called for Golden ration to 256 digits, not silver (P=1, not 2). @ Nigel Galloway: Great work on this F# coding!
(Realize in F#)
m (→‎{{header|F_Sharp|F#}}: task description called for Golden ration to 256 digits, not silver (P=1, not 2). @ Nigel Galloway: Great work on this F# coding!)
Line 237:
let mR n g=printf "First 15 elements when P = %d -> " n; fI n|>Seq.take 15|>Seq.iter(printf "%A "); printf "\n%d decimal places " g
let Σ,n=fG(fI n)(fN (g+1) []) in printf "required %d iterations -> %d." Σ n.Head; List.iter(printf "%d")n.Tail ;printfn ""
[0..9]|>Seq.iter(fun n->mR n 32; printfn ""); mR 21 256
</lang>
{{out}}
Line 271:
32 decimal places required 19 iterations -> 9.10977222864644365500113714088139
 
First 15 elements when P = 2 1 -> 1 1 2 3 75 178 4113 9921 23934 57755 139389 3363144 8119233 19601377 47321610 114243
256 decimal places required 614 iterations -> 1.6180339887498948482045868343656381177203091798057628621354486227052604628189024497072072041893911374847540880753868917521266338622235369317931800607667263544333890865959395829056383226613199282902678806752087668925017116962070322210432162695486262963136144
256 decimal places required 337 iterations -> 2.4142135623730950488016887242096980785696718753769480731766797379907324784621070388503875343276415727350138462309122970249248360558507372126441214970999358314132226659275055927557999505011527820605714701095599716059702745345968620147285174186408891986095523
</pre>
 
=={{header|Factor}}==
<lang factor>USING: combinators decimals formatting generalizations io kernel