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.

A362959 Numbers k such that the Collatz orbit that begins with k does not contain an odd prime afterwards.

Original entry on oeis.org

4, 5, 8, 16, 21, 32, 42, 64, 84, 85, 113, 128, 168, 170, 227, 256, 336, 340, 341, 453, 512, 672, 680, 682, 906, 909, 1024, 1344, 1360, 1364, 1365, 1812, 1813, 1818, 2048, 2417, 2688, 2720, 2728, 2730, 3624, 3626, 3636, 3637, 4096, 5376, 5440, 5456, 5460, 5461, 7248
Offset: 1

Views

Author

Hugo Pfoertner, May 18 2023

Keywords

Examples

			a(11) = 113, because its Collatz orbit 340, 170, 85, 256, 128, 64, 32, 16, 8, 4, 2 avoids odd primes.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[4, 7500], NoneTrue[Rest@ NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, #, # > 1 &], And[OddQ[#], PrimeQ[#]] &] &] (* Michael De Vlieger, May 18 2023 *)
  • PARI
    cm(k) = {while (k>1, k=if(k%2,3*k+1,k/2); if(isprime(k),break)); k};
    for (k=3, 7500, if(cm(k)==2, print1(k,", ")))