The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons 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 56th year, we are closing in on 350,000 sequences, and we’ve crossed 9,700 citations (which often say “discovered thanks to the OEIS”).

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A140948 a(0) = 3; for n >= 1, if a(n-1) = 2*k, then a(n) = k, otherwise 1 + (A065091(n)*a(n-1)), where A065091(n) gives the n-th odd prime. 1
 3, 10, 5, 36, 18, 9, 154, 77, 1772, 886, 443, 16392, 8196, 4098, 2049, 108598, 54299, 3312240, 1656120, 828060, 414030, 207015, 17182246, 8591123, 833338932, 416669466, 208334733, 22291816432, 11145908216, 5572954108, 2786477054, 1393238527, 190873678200, 95436839100, 47718419550, 23859209775 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,1 COMMENTS The original name of the sequence: P-adic Hailstone (or A033478): instead of 3, Prime[n] is used: a(n)=If[Mod[a(n - 1), 2] == 0, a(n - 1)/2, Prime(n + 1)*a(n - 1) + 1]. REFERENCES C. Pickover, Mazes for the Mind, St. Martin's Press, NY, 1992, p. 203-204. LINKS Antti Karttunen, Table of n, a(n) for n = 0..150 FORMULA a(n) = If[Mod[a(n - 1), 2] == 0, a(n - 1)/2, Prime(n + 1)*a(n - 1) + 1]. a(0) = 3; for n >= 1, if a(n-1) = 2*k, then a(n) = k, otherwise 1 + (A065091(n)*a(n-1)). - Antti Karttunen, Jan 29 2016 after the Mathematica-code above and the original name of the sequence. MATHEMATICA a[0] = 3; a[n_] := a[n] = If[Mod[a[n - 1], 2] == 0, a[n - 1]/2, Prime[n + 1]*a[n - 1] + 1]; Table[a[n], {n, 0, 30}] PROG (Scheme, with memoization-macro definec) (definec (A140948 n) (cond ((zero? n) 3) ((even? (A140948 (- n 1))) (/ (A140948 (- n 1)) 2)) (else (+ 1 (* (A065091 n) (A140948 (- n 1))))))) ;; Antti Karttunen, Jan 29 2016 CROSSREFS Cf. A033478, A065091. Sequence in context: A285576 A246777 A111127 * A328763 A281174 A281220 Adjacent sequences:  A140945 A140946 A140947 * A140949 A140950 A140951 KEYWORD nonn AUTHOR Roger L. Bagula and Gary W. Adamson, Jul 24 2008 EXTENSIONS Offset corrected, name changed and more terms added by Antti Karttunen, Jan 29 2016 STATUS approved

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

Last modified December 9 06:07 EST 2021. Contains 349627 sequences. (Running on oeis4.)