OFFSET
0,1
COMMENTS
This is the '17x+1' map. The 'Px+1 map': if x is divisible by any prime < P then divide out these primes one at a time starting with the smallest; otherwise multiply x by P and add 1.
Sequence has period 84. - Alois P. Heinz, Jan 19 2021
LINKS
Ray Chandler, Table of n, a(n) for n = 0..1000
Eric Weisstein's World of Mathematics, Collatz problem
Index entries for linear recurrences with constant coefficients, signature (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1).
MAPLE
with(numtheory): a := proc(n) option remember: local k; if n=0 then RETURN(61); fi: for k from 1 to 6 do if a(n-1) mod ithprime(k) = 0 then RETURN(a(n-1)/ithprime(k)); fi: od: RETURN(17*a(n-1)+1) end:
MATHEMATICA
a[n_] := a[n] = Which[n == 0, 61, n <= 84, Module[{k}, For[k = 1, k < PrimePi[17], k++, If[Mod[a[n - 1], Prime[k]] == 0, Return[a[n - 1]/Prime[k]]]]; Return[17*a[n - 1] + 1]], True, a[n - 84]];
Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Aug 22 2023, after Maple code *)
PROG
(PARI) a(n)=if(n, n=a(n-1); if(n%2, if(n%3, if(n%5, if(n%7, if(n%11, if(n%13, 17*n+1, n/13), n/11), n/7), n/5), n/3), n/2), 61) \\ Charles R Greathouse IV, Oct 13 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Murad A. AlDamen (Divisibility(AT)yahoo.com), Oct 17 2000
EXTENSIONS
More terms from James A. Sellers and Larry Reeves (larryr(AT)acm.org), Oct 18 2000
STATUS
approved