cp's OEIS Frontend

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.

Showing 1-2 of 2 results.

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.

Original entry on oeis.org

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

Views

Author

Pierre CAMI, Mar 02 2018

Keywords

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).

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.
		

Crossrefs

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

A300507 Define the set of generalized Syracuse sequences starting with a positive odd integer 2*n+1=x(1) then if x(i) is odd and prime set x(i+1)=2*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. a(n) is the index i when x(i) reaches 1 or 1163.

Original entry on oeis.org

4, 446, 444, 445, 448, 443, 236, 444, 441, 508, 8, 442, 511, 235, 506, 443, 514, 440, 509, 507, 233, 934, 445, 441, 512, 512, 438, 234, 937, 505, 889, 442, 515, 480, 241, 439, 239, 508, 510, 506, 892, 232, 10, 933, 503, 427, 444, 440, 461, 457, 478, 420, 509
Offset: 0

Views

Author

Pierre CAMI, Mar 07 2018

Keywords

Comments

For n<40 the sequences reach 1, for n=40 the sequence reaches 1163 for x(889) and recover 1163 for x(889+931) a cycle of 961 values.

Examples

			For n=1 after 135 tripling(+1), 47 doubling(+1) and 263 halfing x(446)=1, so a(1)=446.
		

Crossrefs

Programs

  • PARI
    f(x) = if (x % 2, if (isprime(x), 2*x+1, 3*x+1), x/2);
    a(n) = {x = f(2*n+1); nb = 2; while (! ((x == 1) || (x == 1163)), x = f(x); nb++); nb;} \\ Michel Marcus, Mar 07 2018
Showing 1-2 of 2 results.