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.

A294748 Define one of the generalized Syracuse sequences starting with a positive odd integer 2*k+1=x(1), then if x(i) is an odd prime set x(i+1)=2*x(i)+1, if x(i) is odd not prime set x(i+1)=3*x(i)+1, if x(i) is even then set x(i+1)=x(i)/2. This sequence gives the positive odd integers 2*k+1=x(1) for sequences reaching x(i)=1.

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 63, 65, 67, 69, 71, 73, 75, 77, 79, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 125, 127, 129, 131, 133, 135, 137, 141, 143, 145
Offset: 1

Views

Author

Pierre CAMI, Feb 18 2018

Keywords

Comments

The sequence of positive odd integers not in this sequence begins {61, 81, 123, 139, ...}. When x(1) is any of these, the sequence x(i) enters a cycle of 931 values x(i) = x(i+931)=1163.

Crossrefs

Programs

  • PARI
    f(n) = if (n % 2, if (isprime(n), 2*n+1, 3*n+1), n/2);
    isok(n) = {if (n%2, while (1, n = f(n); if (n==1, return (1)); if (n==1163, return (0));););} \\ 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.