OFFSET
0,3
COMMENTS
For n > 0, position of n in A026184. In other words, this is the inverse permutation to A026184. For proof, see the Reble link.
Permutation of nonnegative integers: lodumo_4 of (0,1,0,2,0,3,0,1,0,2,0,3,0,1,0,2,0,3,0,1,0,2,0,3,0,1,0,2,0,3,...). - Philippe Deléham, Oct 25 2011
LINKS
F. M. Dekking, Permutations of N generated by left-right filling algorithms, arXiv:2001.08915 [math.CO], 2020.
Don Reble, Proof that the two definitions are the same, Feb 01 2020
Index entries for linear recurrences with constant coefficients, signature (0,1,0,0,0,1,0,-1)
FORMULA
a(2n)=4n; a(6n+1)=4n+1; a(6n+3)=4n+2; a(6n+5)=4n+3. G.f.: x(1+4*x+x^2+4*x^3+x^4+4*x^5+x^6)/((1+x^2+x^4)*(1-x^2)^2). - Philippe Deléham, Oct 25 2011
G.f.: x*(1 + 4*x + x^2 + 4*x^3 + x^4 + 4*x^5 + x^6)/(1 - x^2 - x^6 + x^8). - Charles R Greathouse IV, May 17 2026
MATHEMATICA
Table[If[EvenQ[n], 2 n, Round[2 n/3]], {n, 0, 50}] (* Vincenzo Librandi, Feb 03 2020 *)
PROG
(Magma) [IsEven(n) select 2*n else Round(2*n/3): n in [0..79] ]; // Vincenzo Librandi, Feb 03 2020
(PARI) a(n)=2*n\/if(n%2, 3, 1) \\ Charles R Greathouse IV, May 17 2026
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
Edited by N. J. A. Sloane, Feb 02 2020, changing the definition to one given by Philippe Deléham, Oct 25 2011, and making the old definition a comment. Thanks to Don Reble for proving that the two definitions produce the same sequence.
STATUS
approved
