%I #24 Nov 28 2023 10:53:57
%S 0,3,1,2,7,5,4,11,9,6,15,13,8,19,17,10,23,21,12,27,25,14,31,29,16,35,
%T 33,18,39,37,20,43,41,22,47,45,24,51,49,26,55,53,28,59,57,30,63,61,32,
%U 67,65,34,71,69,36,75,73,38,79,77,40,83,81,42,87,85,44,91,89,46,95,93
%N a(3m) = 2m, a(3m+1) = 4m+3, a(3m+2) = 4m+1.
%C A permutation of the nonnegative integers.
%H G. Venturini, <a href="https://doi.org/10.1002/sapm1992863185">Iterates of number-theoretic functions with periodic rational coefficients (Generalization of the 3x+1 problem)</a>, Stud. Appl. Math., 86 (1992), 185-218.
%H <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,2,0,0,-1).
%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>.
%F G.f.: x*(x^2-x+1)*(3x^2+4x+3)/(x^3-1)^2. - _Ralf Stephan_, Mar 19 2003
%F Sum_{n>=1} (-1)^n/a(n) = (sqrt(2)*arcsinh(1) - log(2))/2. - _Amiram Eldar_, Nov 28 2023
%t a[n_] := a[n] = If[n <= 5, {0, 3, 1, 2, 7, 5}[[n+1]], 2 a[n-3] - a[n-6]];
%t Table[a[n], {n, 0, 100}] (* _Jean-François Alcover_, Sep 22 2023 *)
%o (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
%Y Cf. A074306, A074307, A074308.
%K nonn,easy
%O 0,2
%A _N. J. A. Sloane_, Sep 23 2002
%E More terms from _Ralf Stephan_, Mar 19 2003
|