The OEIS is supported by the many generous donors to the OEIS Foundation.

 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 59th year, we have over 358,000 sequences, and we’ve crossed 10,300 citations (which often say “discovered thanks to the OEIS”). Other ways to Give
 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 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. 1
 1, 5, 21, 7, 29, 117, 39, 13, 53, 213, 71, 285, 95, 381, 127, 509, 2037, 679, 2717, 10869, 3623, 14493, 4831, 19325, 77301, 25767, 8589, 2863, 11453, 45813, 15271, 61085, 244341, 81447, 27149, 108597, 36199, 144797, 579189, 193063, 772253, 3089013, 1029671, 4118685 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,2 LINKS Tristan Young, Table of n, a(n) for n = 1..15000 MATHEMATICA 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 *) PROG (Processing) // generates all the numbers in the sequence before it first surpasses 1 billion int n; void setup() { n = 1; noLoop(); } void draw() { print(n + ", "); while (true) { if (n % 3 == 0) { n /= 3; } else { n *= 4; n++; } print(n); if (n == 1 || n >= 600000000) { break; } else { print(", "); } } } (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 CROSSREFS Cf. A006370, A128333, A153727. Sequence in context: A156824 A053002 A053003 * A167202 A204914 A355036 Adjacent sequences: A346032 A346033 A346034 * A346036 A346037 A346038 KEYWORD easy,nonn AUTHOR Tristan Young, Jul 02 2021 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified December 3 08:35 EST 2022. Contains 358515 sequences. (Running on oeis4.)