login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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.
3

%I #18 Jan 04 2022 05:25:48

%S 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,

%T 44,15,10,16,50,11,53,18,12,19,59,13,62,21,14,22,68,15,71,24,16,25,77,

%U 17,80,27,18,28,86,19,89,30,20,31,95,21,98,33,22,34,104

%N 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.

%C This is a variant of the Farkas map (A349407).

%C Yolcu, Aaronson and Heule prove that the trajectory of the iterates of the map starting from any nonnegative integer always reaches 0.

%C 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

%H H. M. Farkas, "Variants of the 3N+1 Conjecture and Multiplicative Semigroups", in Entov, Pinchover and Sageev, <a href="https://bookstore.ams.org/conm-387">Geometry, Spectral Theory, Groups, and Dynamics, Contemporary Mathematics, vol. 387</a>, American Mathematical Society, 2005, p. 121.

%H Emre Yolcu, Scott Aaronson and Marijn J. H. Heule, <a href="https://arxiv.org/abs/2105.14697">An Automated Approach to the Collatz Conjecture</a>, arXiv:2105.14697 [cs.LO], 2021, pp. 21-25.

%H <a href="/index/Rec#order_12">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,0,2,0,0,0,0,0,-1).

%F a(n) = (A349407(n+1)-1)/2.

%F a(n) = 2*a(n-6)-a(n-12). - _Wesley Ivan Hurt_, Jan 03 2022

%e From _Omar E. Pol_, Jan 02 2022: (Start)

%e Written as a rectangular array with six columns read by rows the sequence begins:

%e 0, 0, 1, 5, 1, 8;

%e 3, 2, 4, 14, 3, 17;

%e 6, 4, 7, 23, 5, 26;

%e 9, 6, 10, 32, 7, 35;

%e 12, 8, 13, 41, 9, 44;

%e 15, 10, 16, 50, 11, 53;

%e 18, 12, 19, 59, 13, 62;

%e 21, 14, 22, 68, 15, 71;

%e 24, 16, 25, 77, 17, 80;

%e 27, 18, 28, 86, 19, 89;

%e 30, 20, 31, 95, 21, 98;

%e ...

%e (End)

%t 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}]

%t (* Second program *)

%t 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]

%o (Python)

%o def a(n):

%o r = n%6

%o if r == 1 or r == 4: return (n-1)//3

%o if r == 0 or r == 2: return n//2

%o if r == 3 or r == 5: return (3*n+1)//2

%o print([a(n) for n in range(70)]) # _Michael S. Branicky_, Jan 02 2022

%Y Cf. A005408, A005843, A006370, A014682, A016777, A017221, A017257, A349407, A350279.

%K nonn,easy

%O 0,4

%A _Paolo Xausa_, Jan 02 2022