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.
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) = A000032(floor(log_phi(sqrt(5)*(n+1) + 1) + 2)) - n - 3, where phi = (1 + sqrt(5))/2 is the golden ratio.
a(n) = A000032(floor(log_phi(sqrt(5)*n + 2*phi) + 2)) - n - 3.
CROSSREFS
KEYWORD
nonn
AUTHOR
Hieronymus Fischer, Sep 15 2007
STATUS
approved