OFFSET
0,2
COMMENTS
A permutation of the nonnegative integers.
LINKS
G. Venturini, Iterates of number-theoretic functions with periodic rational coefficients (Generalization of the 3x+1 problem), Stud. Appl. Math., 86 (1992), 185-218.
Index entries for linear recurrences with constant coefficients, signature (0,0,2,0,0,-1).
FORMULA
G.f.: x*(x^2-x+1)*(3x^2+4x+3)/(x^3-1)^2. - Ralf Stephan, Mar 19 2003
Sum_{n>=1} (-1)^n/a(n) = (sqrt(2)*arcsinh(1) - log(2))/2. - Amiram Eldar, Nov 28 2023
MATHEMATICA
a[n_] := a[n] = If[n <= 5, {0, 3, 1, 2, 7, 5}[[n+1]], 2 a[n-3] - a[n-6]];
Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Sep 22 2023 *)
PROG
(PARI) a(m) = if(m%3==0, m/3*2, if(m%3==1, (m-1)/3*4+3, (m-2)/3*4+1)); \\ C. Ronaldo
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Sep 23 2002
EXTENSIONS
More terms from Ralf Stephan, Mar 19 2003
STATUS
approved