OFFSET
0,1
COMMENTS
The permutation is self-inverse;
a(n) = A004442(n) for n >= 20.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1, 1, -1).
FORMULA
From Chai Wah Wu, Oct 22 2018: (Start)
a(n) = a(n-1) + a(n-2) - a(n-3) for n > 22.
G.f.: (-9*x^22 - 2*x^21 + 11*x^20 + 20*x^12 - 20*x^10 - 9*x^2 + x + 10)/((x - 1)^2*(x + 1)). (End)
a(n) ~ n. - Charles R Greathouse IV, May 30 2026
MATHEMATICA
CoefficientList[Series[(-9 x^22 - 2 x^21 + 11 x^20 + 20 x^12 - 20 x^10 - 9 x^2 + x + 10) / ((x - 1)^2 (x + 1)), {x, 0, 100}], x] (* Vincenzo Librandi, Oct 23 2018 *)
PROG
(PARI) a(n)=if(n>19, n+(-1)^n, [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9][n+1]) \\ Charles R Greathouse IV, May 30 2026
CROSSREFS
KEYWORD
base,nonn,easy,changed
AUTHOR
Reinhard Zumkeller, Aug 15 2010
STATUS
approved
