Goodstein Sequence: Difference between revisions

m
→‎{{header|Phix}}: cut out the middleman, fix a trailing ".0" which had crept in
m (→‎{{header|Phix}}: cut out the middleman, fix a trailing ".0" which had crept in)
Line 151:
for i,d in digits(n,b) do
if d then
res += d*round(power(b+1,bump(i-1,b)))
end if
end for
return res
end function
 
function A059934(atom n, k)
for i=1 to k do
n = bump(n, i+1)-1
end for
return n
end function
 
Line 167 ⟶ 160:
sequence res = {n}
while length(res)<maxterms and res[$]!=0 do
res &= A059934bump(nres[$],length(res)+1)-1
end while
return res
7,833

edits