OFFSET
0,5
COMMENTS
Fixed points a(n) = n are the Zeckendorf palindromes n = A094202.
Apart from a(0)=0, all terms end with a 1 digit so are "odd" A003622.
a(n) = 1 iff n is a Fibonacci number >= 1 (A000045) since they are Zeckendorf 100..00 which reverses to 00..001.
A given k first occurs as a(n) = k at its reversal n = a(k), and thereafter at this n with any number of least significant 0's appended.
LINKS
Kevin Ryde, Table of n, a(n) for n = 0..10000
Kevin Ryde, PARI/GP Code.
FORMULA
There is a linear representation of rank 6 for this sequence. - Jeffrey Shallit, May 13 2023
EXAMPLE
n = 1445 = Zeckendorf 101000101001000
a(n) = 313 = Zeckendorf 000100101000101 reversal
PROG
(PARI) \\ See links.
(Python)
def NumToFib(n): # n > 0
f0, f1, k = 1, 1, 0
while f0 <= n:
f0, f1, k = f0+f1, f0, k+1
s = ""
while k > 0:
f0, f1, k = f1, f0-f1, k-1
if f0 <= n:
s, n = s+"1", n-f0
else:
s = s+"0"
return s
def RevFibToNum(s):
f0, f1 = 1, 1
n, k = 0, 0
while k < len(s):
if s[k] == "1":
n = n+f0
f0, f1, k = f0+f1, f0, k+1
return n
n, a = 0, 0
print(a, end = ", ")
while n < 71:
n += 1
print(RevFibToNum(NumToFib(n)), end = ", ") # A.H.M. Smeets, Nov 14 2021
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Kevin Ryde, Nov 11 2021
STATUS
approved