cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A026185 If n even, then 2n. If n odd, then nearest integer to 2n/3.

Original entry on oeis.org

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

Views

Author

Keywords

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

Crossrefs

Cf. A026184.
Bisections: A008586, A042968.

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.