OFFSET
1,1
COMMENTS
This sequence is generated by the program below for m=13,p=14. Other values of m and p also converge but not necessarily to 1. For m =2 and p=1 we have the count of steps for the x+1 problem. m=prime and p=m+1 usually converge to 1 but break down for certain values of n. E.g. 17 locks at n=34, 23 at n=49, 29 at n=91. I verified m=13 for n up to 100000. 100000 requires 100 steps to reach 1.
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
Cino Hilliard, The x+1 conjecture
EXAMPLE
x = 12: step 1: x = 12*14+13-12 = 169, step 2: x = 169/13 = 13, step 3: x = 13/13 = 1. Count = 3.
MATHEMATICA
Join[{25}, Table[Length[NestWhileList[If[Divisible[#, 13], #/13, 14#+13-Mod[#, 13]]&, n, #!=1&]], {n, 2, 70}]-1] (* Harvey P. Dale, Mar 14 2012 *)
PROG
(PARI) countxp2(n, m, p) = { c=1; x=1; x=x*p+m-1; while(x>1, r = x%m; if(r==0, x=x/m, x=x*p+m-r); c++; ); print1(c" "); for(j=2, n, x=j; c=0; while(x>1, r = x%m; if(r==0, x=x/m, x=x*p+m-r); c++; \ print1(x" "); ); print1(c" ") ) }
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Cino Hilliard, Mar 29 2003
STATUS
approved