OFFSET
0,3
COMMENTS
Fixed points of this sequence are in A038546. - Alois P. Heinz, Jul 08 2022
LINKS
T. D. Noe, Table of n, a(n) for n = 0..10000
Ron Knott, Every number starts some Fibonacci Number, The Mathematical Magic of the Fibonacci Numbers.
MATHEMATICA
nn = 100; t = tn = Table[0, {nn}]; found = 0; n = 0; While[found < nn, n++; f = Fibonacci[n]; d = IntegerDigits[f]; i = 1; While[i <= Length[d], k = FromDigits[Take[d, i]]; If[k > nn, Break[]]; If[t[[k]] == 0, t[[k]] = f; tn[[k]] = n; found++]; i++]]; tn = Join[{0}, tn] (* T. D. Noe, Apr 02 2014 *)
PROG
(Python)
def aupton(nn):
ans, f, g, k = dict(), 0, 1, 0
while len(ans) < nn+1:
sf = str(f)
for i in range(1, len(sf)+1):
if int(sf[:i]) > nn:
break
if sf[:i] not in ans:
ans[sf[:i]] = k
f, g, k = g, f+g, k+1
return [int(ans[str(i)]) for i in range(nn+1)]
print(aupton(70)) # Michael S. Branicky, Jul 08 2022
CROSSREFS
KEYWORD
AUTHOR
STATUS
approved