|
|
A219642
|
|
Number of steps to reach 0 starting with n and using the iterated process: x -> x - (number of 1's in Zeckendorf expansion of x).
|
|
12
|
|
|
0, 1, 2, 3, 3, 4, 4, 5, 6, 6, 7, 7, 7, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 21, 21, 21, 22, 22, 22, 22, 23, 24, 24, 25, 25, 25, 26, 26, 26, 27, 27, 27, 28, 28, 29, 29
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
See A014417 for the Fibonacci number system representation, also known as Zeckendorf expansion.
|
|
LINKS
|
|
|
FORMULA
|
a(0)=0; for n>0, a(n) = 1+a(A219641(n)).
|
|
PROG
|
(Scheme with memoization macro definec from Antti Karttunen's Intseq-library):
(PARI) A007895(n)=if(n<4, n>0, my(k=2, s, t); while(fibonacci(k++)<=n, ); while(k && n, t=fibonacci(k); if(t<=n, n-=t; s++); k--); s)
(Python)
from sympy import fibonacci
def a007895(n):
k=0
x=0
while n>0:
k=0
while fibonacci(k)<=n: k+=1
x+=10**(k - 3)
n-=fibonacci(k - 1)
return str(x).count("1")
def a219641(n): return n - a007895(n)
l=[0]
for n in range(1, 101):
l.append(1 + l[a219641(n)])
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|