A026185 If n even, then 2n. If n odd, then nearest integer to 2n/3.
0, 1, 4, 2, 8, 3, 12, 5, 16, 6, 20, 7, 24, 9, 28, 10, 32, 11, 36, 13, 40, 14, 44, 15, 48, 17, 52, 18, 56, 19, 60, 21, 64, 22, 68, 23, 72, 25, 76, 26, 80, 27, 84, 29, 88, 30, 92, 31, 96, 33, 100, 34, 104, 35, 108, 37, 112, 38, 116, 39, 120, 41
Offset: 0
Keywords
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)
Programs
-
Magma
[IsEven(n) select 2*n else Round(2*n/3): n in [0..79] ]; // Vincenzo Librandi, Feb 03 2020
-
Mathematica
Table[If[EvenQ[n], 2 n, Round[2 n/3]], {n, 0, 50}] (* Vincenzo Librandi, Feb 03 2020 *)
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
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.
Comments