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 A346035 #45 Sep 27 2021 21:01:50 %S A346035 1,5,21,7,29,117,39,13,53,213,71,285,95,381,127,509,2037,679,2717, %T A346035 10869,3623,14493,4831,19325,77301,25767,8589,2863,11453,45813,15271, %U A346035 61085,244341,81447,27149,108597,36199,144797,579189,193063,772253,3089013,1029671,4118685 %N A346035 a(1) = 1; if a(n) is not divisible by 3, a(n+1) = 4*a(n) + 1, otherwise a(n+1) = a(n)/3. %H A346035 Tristan Young, <a href="/A346035/b346035.txt">Table of n, a(n) for n = 1..15000</a> %H A346035 Tristan Young, <a href="/A346035/a346035_1.c.txt">C code to generate a b-file for the first 15000 terms of this sequence</a> %t A346035 a[1] = 1; a[n_] := a[n] = If[Divisible[a[n-1],3], a[n-1]/3, 4*a[n-1]+1]; Array[a, 50] (* _Amiram Eldar_, Jul 12 2021 *) %o A346035 (Processing) %o A346035 // generates all the numbers in the sequence before it first surpasses 1 billion %o A346035 int n; %o A346035 void setup() { %o A346035 n = 1; %o A346035 noLoop(); %o A346035 } %o A346035 void draw() { %o A346035 print(n + ","); %o A346035 while (true) { %o A346035 if (n % 3 == 0) { %o A346035 n /= 3; %o A346035 } else { %o A346035 n *= 4; n++; %o A346035 } %o A346035 print(n); %o A346035 if (n == 1 || n >= 600000000) { %o A346035 break; %o A346035 } else { %o A346035 print(", "); %o A346035 } %o A346035 } %o A346035 } %o A346035 (PARI) a(n) = if (n==1, 1, my(x=a(n-1)); if (x % 3, 4*x+1, x/3)); \\ _Michel Marcus_, Aug 12 2021 %Y A346035 Cf. A006370, A128333, A153727. %K A346035 easy,nonn %O A346035 1,2 %A A346035 _Tristan Young_, Jul 02 2021