OFFSET
1,2
COMMENTS
Also: a(1)=1, a(2)=3, a(n) = maximal positive number < a(n-1) not yet in the sequence, if it exists, else a(n) = a(n-1) + n.
Also: a(1)=1, a(2)=3, a(n) = a(n-1) - 1, if a(n-1) - 1 > 0 and has not been encountered so far, else a(n) = a(n-1) + n.
A permutation of the positive integers. The sequence is self-inverse, in that a(a(n)) = n.
LINKS
Paolo Xausa, Table of n, a(n) for n = 1..10000
FORMULA
G.f.: g(x) = (F'(x) - x^2 - 1/(1-x))/(1-x) where F(x) = Sum_{k>=0} x^Fibonacci(k). F(x) is the g.f. of the Fibonacci indicator sequence (see A104162) and F'(x) = derivative of F(x).
a(n) = A000045(floor(log_phi(sqrt(5)*(n+1) + 1) + 2)) - n - 3, where phi = (1 + sqrt(5))/2 is the golden ratio.
a(n) = A000045(floor(log_phi(sqrt(5)*n + 2*phi) + 2)) - n - 3.
MATHEMATICA
A132665[n_] := Fibonacci[Quotient[Log[1 + Sqrt[5]*(n+1)], ArcCsch[2]] + 2] - n - 3;
Array[A132665, 100] (* Paolo Xausa, Jan 27 2026 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Hieronymus Fischer, Sep 15 2007
STATUS
approved
