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.

A350515 a(n) = (n-1)/3 if n mod 3 = 1; a(n) = n/2 if n mod 6 = 0 or n mod 6 = 2; a(n) = (3n+1)/2 if n mod 6 = 3 or n mod 6 = 5.

Original entry on oeis.org

0, 0, 1, 5, 1, 8, 3, 2, 4, 14, 3, 17, 6, 4, 7, 23, 5, 26, 9, 6, 10, 32, 7, 35, 12, 8, 13, 41, 9, 44, 15, 10, 16, 50, 11, 53, 18, 12, 19, 59, 13, 62, 21, 14, 22, 68, 15, 71, 24, 16, 25, 77, 17, 80, 27, 18, 28, 86, 19, 89, 30, 20, 31, 95, 21, 98, 33, 22, 34, 104
Offset: 0

Views

Author

Paolo Xausa, Jan 02 2022

Keywords

Comments

This is a variant of the Farkas map (A349407).
Yolcu, Aaronson and Heule prove that the trajectory of the iterates of the map starting from any nonnegative integer always reaches 0.
If displayed as a rectangular array with six columns, the columns are A008585, A005843, A016777, A017221, A005408, A017257 (see example). - Omar E. Pol, Jan 02 2022

Examples

			From _Omar E. Pol_, Jan 02 2022: (Start)
Written as a rectangular array with six columns read by rows the sequence begins:
   0,  0,  1,  5,  1,  8;
   3,  2,  4, 14,  3, 17;
   6,  4,  7, 23,  5, 26;
   9,  6, 10, 32,  7, 35;
  12,  8, 13, 41,  9, 44;
  15, 10, 16, 50, 11, 53;
  18, 12, 19, 59, 13, 62;
  21, 14, 22, 68, 15, 71;
  24, 16, 25, 77, 17, 80;
  27, 18, 28, 86, 19, 89;
  30, 20, 31, 95, 21, 98;
...
(End)
		

Crossrefs

Programs

  • Mathematica
    nterms=100;Table[If[Mod[n,3]==1,(n-1)/3,If[Mod[n,6]==0||Mod[n,6]==2,n/2,(3n+1)/2]],{n,0,nterms-1}]
    (* Second program *)
    nterms=100;LinearRecurrence[{0,0,0,0,0,2,0,0,0,0,0,-1},{0,0,1,5,1,8,3,2,4,14,3,17},nterms]
  • Python
    def a(n):
        r = n%6
        if r == 1 or r == 4: return (n-1)//3
        if r == 0 or r == 2: return n//2
        if r == 3 or r == 5: return (3*n+1)//2
    print([a(n) for n in range(70)]) # Michael S. Branicky, Jan 02 2022

Formula

a(n) = (A349407(n+1)-1)/2.
a(n) = 2*a(n-6)-a(n-12). - Wesley Ivan Hurt, Jan 03 2022