OFFSET
0,1
COMMENTS
I define the generalized Syracuse sequences as follows:
Start with an odd positive number x(1)=2*k+1; then, for i >= 1, if x(i) is an odd prime set x(i+1)=p*x(i)+1 with p a prime, if x(i) is an odd nonprime set x(i+1)=3*x(i)+1, and if x(i) is even then set x(i+1)=x(i)/2.
If p=3 the sequences are the Syracuse sequences in which it does not matter whether odd x(i) is prime or not.
For all the prime numbers p other than 3, if x(i) is odd, the value of x(i+1) depends on whether x(i) is prime.
Among prime numbers p < 97, 67 is the only one for which x(i) reaches 1 for any k < 125 and for k=125, x(1)=251, x(8113)=887, x(8113+8099)=887 a cycle of 8099 values.
All the sequences for p < 423 eventually enter a loop (not tested above, but I conjecture that it is the case for any prime, although with different end cycles).
LINKS
Pierre CAMI, PFGW Script
EXAMPLE
For p=67 and k=2, we have x(1)=2*2+1=5, x(2)=67*5+1=336, x(3)=336/2=168, x(4)=168/2=84, x(5)=84/2=42, x(6)=42/2=21, x(7)=3*21+1=64, x(8)=64/2=32, x(9)=32/2=16, x(10)=16/2=8, x(11)=8/2=4, x(12)=4/2=2, x(13)=2/2=1; x(i) reaches 1 at i=13, so a(2)=13.
PROG
(PARI) f(n) = if (n % 2, if (isprime(n), 67*n+1, 3*n+1), n/2);
a(n) = {my(k = f(2*n+1), nb = 2); while (k != 1, k = f(k); nb++); nb; } \\ Michel Marcus, Mar 28 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Mar 02 2018
STATUS
approved