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
CROSSREFS
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