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.

A294643 Length (= size) of the orbit of n under the "3x+1" map A006370: x -> x/2 if even, 3x+1 if odd. a(n) = -1 in case the orbit would be infinite.

Original entry on oeis.org

1, 3, 3, 8, 3, 6, 9, 17, 4, 20, 7, 15, 10, 10, 18, 18, 5, 13, 21, 21, 8, 8, 16, 16, 11, 24, 11, 112, 19, 19, 19, 107, 6, 27, 14, 14, 22, 22, 22, 35, 9, 110, 9, 30, 17, 17, 17, 105, 12, 25, 25, 25, 12, 12, 113, 113, 20, 33, 20, 33, 20, 20, 108, 108, 7, 28, 28
Offset: 0

Views

Author

M. F. Hasler, Nov 05 2017

Keywords

Comments

The orbit of x under f is O(x; f) = { f^k(x); k = 0, 1, 2, ... }, i.e., the set of all points in the trajectory of x under iterations of f.
The famous "3x+1 problem" or Collatz conjecture (also attributed to other names) states that for f = A006370, the trajectory (f^k(x); k >= 0) always ends in the cycle 1 -> 4 -> 2 -> 1, for any integer starting value x >= 0.

Examples

			a(0) = 1 = # { 0 }, since 0 -> 0 -> 0 ... under A006370.
a(1) = 3 = # { 1, 4, 2 }, since 1 -> (3*1 + 1 =) 4 -> 2 -> 1 -> 4 etc. under A006370.
a(3) = 8 = # { 3, 10, 5, 16, 8, 4, 2, 1 }, since 3 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1 -> 4 etc. under A006370.
		

Crossrefs

Cf. A006370 (Collatz or 3x+1 map), A008908 (number of steps to reach 1), A174221 (the "PrimeLatz" map: add 3 next primes), A293980, A293975 (variant: add the next prime), A293982.

A294659 Largest number in the orbit of n under iteration of the map A293975: x -> x/2 if even, x + nextprime(x) else.

Original entry on oeis.org

0, 8, 8, 8, 12, 8, 20, 8, 20, 12, 24, 12, 32, 20, 32, 16, 36, 20, 44, 20, 44, 24, 52, 24, 56, 32, 56, 28, 60, 32, 68, 32, 72, 36, 72, 36, 80, 44, 80, 40, 84, 44, 92, 44, 92, 52, 100, 48, 104, 56, 104, 52, 112, 56, 116, 56, 116, 60, 120, 60, 128, 68, 132, 64, 132, 72, 140, 68, 140, 72, 144, 72, 152, 80
Offset: 0

Views

Author

M. F. Hasler, Nov 06 2017

Keywords

Comments

The trajectory under iterations of A293975 seems to end in the cycle 1 -> 3 -> 8 -> 4 -> 2 -> 1, for any positive starting value n. Therefore a(n) >= 8 for all n > 0.
Obviously also a(n) >= n for all numbers, with equality for powers of two 2^k with k >= 3; a(n) >= n + nextprime(n) >= 2n+2 for all odd numbers.
Record values not of the form f(n) = n + nextprime(n) occur for a(1) = 8, a(5) = 12, a(7) = 20, a(11) = 24, a(13) = 32, a(17) = 36, a(19) = 44, a(23) = 52, a(25) = 56, a(29) = 60, a(31) = 68, a(33) = 72, a(37) = 80, a(41) = 84, a(43) = 92, a(47) = 100, ... We see that in most cases, this equals f(f(n)/2). Exceptions are n = 1, 7, 13, 19, 37, 43, 67, 79, 89, 97, ...

Crossrefs

Cf. A293975, A293982 (size of the orbit).

Programs

  • PARI
    A294659(n,S=[n])={while(#S<#S=setunion(S,[n=A293975(n)]),); vecmax(S)}
Showing 1-2 of 2 results.