OFFSET
1,2
COMMENTS
Also: a(1)=1, a(2)=2, 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)=2, 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) = (L'(x) - x^2 - 1/(1-x))/(1-x) where L(x) = Sum_{k>=0} x^Lucas(k) and Lucas(k) = A000032(k). L(x) is the g.f. of the Lucas indicator sequence (see A102460) and L'(x) = derivative of L(x).
a(n) = A000032(floor(log_phi(n + 3/2)) + 2) - n - 3 for n > 1, where phi = (1 + sqrt(5))/2 is the golden ratio.
CROSSREFS
KEYWORD
nonn
AUTHOR
Hieronymus Fischer, Sep 15 2007
STATUS
approved