RosettaCodeData/Task/Man-or-boy-test/Phix/man-or-boy-test-2.phix
2026-02-01 16:33:20 -08:00

17 lines
386 B
Text

with javascript_semantics
constant first5 = {1,0,-2,0,1}
function A(integer k)
if k<5 then return first5[k+1] end if
atom c0 = 3, c1 = 2, c2 = 1, c3 = 0
for j=5 to k-1 do
c3 += c0-1
c0 += c1
c1 += c2
c2 += c3
end for
return c0-c1-c2+c3
end function
for k=0 to iff(machine_bits()=32?50:60) do
printf(1,"%d %d\n",{k,A(k)})
end for