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.
%I A349407 #69 Sep 13 2024 08:11:04 %S A349407 1,1,3,11,3,17,7,5,9,29,7,35,13,9,15,47,11,53,19,13,21,65,15,71,25,17, %T A349407 27,83,19,89,31,21,33,101,23,107,37,25,39,119,27,125,43,29,45,137,31, %U A349407 143,49,33,51,155,35,161,55,37,57,173,39,179,61,41,63,191,43 %N A349407 The Farkas map: a(n) = x/3 if x mod 3 = 0; a(n) = (3x+1)/2 if x mod 3 <> 0 and x mod 4 = 3; a(n) = (x+1)/2 if x mod 3 <> 0 and x mod 4 = 1, where x = 2*n-1. %C A349407 The map takes a positive odd integer x (= 2*n-1) and produces the positive odd integer a(n). %C A349407 Farkas proves that the trajectory of the iterates of the map starting from any positive odd integer always reaches 1. %C A349407 If displayed as a rectangular array with six columns, the columns include A016921, A016813, A016945, A004767, A239129 (see example). - _Omar E. Pol_, Jan 01 2022 %D A349407 H. M. Farkas, "Variants of the 3N+1 Conjecture and Multiplicative Semigroups", in Entov, Pinchover and Sageev, "Geometry, Spectral Theory, Groups, and Dynamics", Contemporary Mathematics, vol. 387, American Mathematical Society, 2005, p. 121. %D A349407 J. C. Lagarias, ed., The Ultimate Challenge: The 3x+1 Problem, American Mathematical Society, 2010, p. 74. %H A349407 Paolo Xausa, <a href="/A349407/b349407.txt">Table of n, a(n) for n = 1..10000</a> %H A349407 <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). %H A349407 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a> %e A349407 From _Omar E. Pol_, Jan 01 2022: (Start) %e A349407 Written as a rectangular array with six columns read by rows the sequence begins: %e A349407 1, 1, 3, 11, 3, 17; %e A349407 7, 5, 9, 29, 7, 35; %e A349407 13, 9, 15, 47, 11, 53; %e A349407 19, 13, 21, 65, 15, 71; %e A349407 25, 17, 27, 83, 19, 89; %e A349407 31, 21, 33, 101, 23, 107; %e A349407 37, 25, 39, 119, 27, 125; %e A349407 43, 29, 45, 137, 31, 143; %e A349407 49, 33, 51, 155, 35, 161; %e A349407 55, 37, 57, 173, 39, 179; %e A349407 ... %e A349407 (End) %t A349407 LinearRecurrence[{0,0,0,0,0,2,0,0,0,0,0,-1},{1,1,3,11,3,17,7,5,9,29,7,35},100] %t A349407 Table[Which[Mod[n,3]==0,n/3,Mod[n,4]==3,(3n+1)/2,True,(n+1)/2],{n,1,200,2}] (* _Harvey P. Dale_, May 15 2022 *) %o A349407 (PARI) a(n)=if (n%3==2, 2*n\3, if (n%2, n, 3*n-1)) \\ _Charles R Greathouse IV_, Nov 16 2021 %o A349407 (Python) %o A349407 def a(n): %o A349407 x = 2*n - 1 %o A349407 return x//3 if x%3 == 0 else ((3*x+1)//2 if x%4 == 3 else (x+1)//2) %o A349407 print([a(n) for n in range(1, 66)]) # _Michael S. Branicky_, Nov 16 2021 %Y A349407 Cf. A006370, A014682, A016813, A016921, A016945, A004767, A239129, A350279, A350515. %K A349407 nonn,easy %O A349407 1,3 %A A349407 _Paolo Xausa_, Nov 16 2021