A300286 Define a set of generalized Syracuse sequences starting with x(1)=2*n+1 a positive odd integer, if x(i) is odd prime set x(i+1)=67*x(i)+1, if x(i) is odd not prime set x(i+1)=3*x(i)+1 and if x(i) is even then set x(i+1)=x(i)/2. Then a(n) is the first index i > 1 at which x(i) reaches 1.
4, 209166, 13, 207226, 207229, 384614, 384602, 32, 104820, 403030, 8, 30, 403033, 118516, 39365, 403070, 403036, 118323, 11641, 118425, 118514, 89369, 104824, 180241, 11644, 39371, 118321, 118294, 89372, 118423, 119595, 39372, 11647, 403093, 384607, 47436, 124886
Offset: 0
Keywords
Examples
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.
Links
- Pierre CAMI, PFGW Script
Programs
-
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
Comments