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.

A174221 a(n) = n/2 if n is even, otherwise add to n the next three primes > n.

Original entry on oeis.org

0, 11, 1, 26, 2, 36, 3, 48, 4, 50, 5, 60, 6, 72, 7, 74, 8, 88, 9, 102, 10, 104, 11, 120, 12, 122, 13, 124, 14, 138, 15, 152, 16, 154, 17, 156, 18, 168, 19, 170, 20, 184, 21, 202, 22, 204, 23, 220, 24, 222, 25, 224, 26, 240, 27, 242, 28, 244, 29, 258, 30, 272, 31, 274, 32, 276, 33, 290, 34, 292, 35, 306, 36, 324, 37, 326, 38, 328, 39, 348, 40, 350, 41, 370, 42
Offset: 0

Views

Author

N. J. A. Sloane, Nov 26 2010

Keywords

Comments

Related to the PrimeLatz conjecture, which states that if this map k -> a(k) is iterated, starting at any n >= 0, then the trajectory will eventually enter a loop.
Computations have shown that up to 10^8, there is only one loop (apart from the fixed point 0). It is given for example by terms 2 through 31 of A193230, the smallest of its 30 elements being 9.
See A293980 for the number of iterations required to reach an element of this loop, and for further study of trajectories under iterations of this map.

References

  • Eric Angelini, Posting to Math Fun Mailing List, Nov 26, 2010
  • Bill Thurston, Posting to Math Fun Mailing List, Nov 26, 2010

Crossrefs

Bisection gives A174223.
Cf. A193230 (trajectory of 1 under this map), A293979 (trajectory of 83), A293980.

Programs

  • Maple
    f:=proc(n) local p; p:=nextprime;
    if n mod 2 = 0 then n/2 else
    n+p(n)+p(p(n))+p(p(p(n))); fi; end;
  • Mathematica
    Array[If[EvenQ@ #, #/2, Total@ Prepend[NextPrime[#, {1, 2, 3}], #]] &, 85, 0] (* Michael De Vlieger, Oct 25 2017 *)
  • PARI
    A174221(n)=bittest(n,0)||return(n\2);n+sum(c=1,3,n=nextprime(n+1)) \\ M. F. Hasler, Oct 25 2017