Hofstadter-Conway $10,000 sequence: Difference between revisions
Content deleted Content added
No edit summary |
mNo edit summary |
||
Line 1,252:
Mallows number is 1489</pre>
=={{header|FutureBasic}}==
<lang futurebasic>
include "ConsoleWindow"
Line 1,283:
for n = 3 to 2 ^ uprLim
a(n) = a( a( n-1 ) ) + a( n-a( n-1 ) )
r = a(n) / n
if r >= 0.55 then Mallows = n
if r > p
p = r
pPos = n
end if
if n == p2
print "Maximum of a(n)/n between", " 2^"; pow2-1; " and 2^"; pow2," is "; p;, " at n = "; pPos
pow2 = pow2 + 1
p2 = 2 ^ pow2
p = 0.5
end if
next
print
|