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.

A350082 Smallest odd number > n with n in its Collatz successors, or 0 if no such odd number exists. a(1) = 1.

Original entry on oeis.org

1, 3, 0, 5, 7, 0, 9, 9, 0, 11, 19, 0, 17, 37, 0, 17, 19, 0, 25, 23, 0, 25, 27, 0, 33, 29, 0, 37, 33, 0, 41, 75, 0, 37, 41, 0, 43, 39, 0, 41, 109, 0, 57, 51, 0, 47, 55, 0, 57, 133, 0, 57, 55, 0, 73, 57, 0, 59, 123, 0, 63, 109, 0, 75, 115, 0, 89, 181, 0, 71, 73
Offset: 1

Views

Author

Ruud H.G. van Tol, Jan 22 2022

Keywords

Comments

a(n) = 0 when n == 0 (mod 3) since such an n has no odd predecessor (only n*2^x). But n !== 0 (mod 3) always has some odd predecessor > n.

Examples

			a(2) = 3, because 3 is the smallest odd number > 2 that has 2 as a successor: 3 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2.
a(3) = 0 because 3 is not a successor of anything. A060565 contains no 3, nor multiples of 3.
a(11) = 19, because the trajectories of 13, 15, 17 don't contain 11, and 11 is a successor of 19:
  13 -> 40..5 -> 16..1;
  15 -> 46..23 -> 70..35 -> 106..53 -> 160..5 -> 16..1;
  17 -> 52..13;
  19 -> 58..29 -> 88..11.
		

Crossrefs

Cf. A060565.

Programs

  • PARI
    a(n)= if(1==n, return(1)); if(!(n%3), return(0)); my(v0=if(n%2, n+2, n+1)); while(1, my(v=v0); while(v>1 && v!=n, v=if(v%2, 3*v+1, v/2)); if(v==n, return(v0)); v0+=2)