This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A300286 #17 Apr 17 2018 00:11:12 %S A300286 4,209166,13,207226,207229,384614,384602,32,104820,403030,8,30,403033, %T A300286 118516,39365,403070,403036,118323,11641,118425,118514,89369,104824, %U A300286 180241,11644,39371,118321,118294,89372,118423,119595,39372,11647,403093,384607,47436,124886 %N 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. %C A300286 I define the generalized Syracuse sequences as follows: %C A300286 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. %C A300286 If p=3 the sequences are the Syracuse sequences in which it does not matter whether odd x(i) is prime or not. %C A300286 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. %C A300286 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. %C A300286 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). %H A300286 Pierre CAMI, <a href="/A300286/a300286.txt">PFGW Script</a> %e A300286 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. %o A300286 (PARI) f(n) = if (n % 2, if (isprime(n), 67*n+1, 3*n+1), n/2); %o A300286 a(n) = {my(k = f(2*n+1), nb = 2); while (k != 1, k = f(k); nb++); nb;} \\ _Michel Marcus_, Mar 28 2018 %Y A300286 Cf. A006577, A294748, A297307. %K A300286 nonn %O A300286 0,1 %A A300286 _Pierre CAMI_, Mar 02 2018