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.

A376801 a(0) = 397; a(n+1) = a(n)^2 if a(n) is prime, floor(a(n)/2) otherwise.

Original entry on oeis.org

397, 157609, 78804, 39402, 19701, 9850, 4925, 2462, 1231, 1515361, 757680, 378840, 189420, 94710, 47355, 23677, 560600329, 280300164, 140150082, 70075041, 35037520, 17518760, 8759380, 4379690, 2189845, 1094922, 547461, 273730, 136865, 68432, 34216, 17108, 8554
Offset: 0

Views

Author

Matthew House, Oct 04 2024

Keywords

Comments

From most starting points, this sequence trivially reaches the cycle (4,2,4,2,...). No other cycles are known to exist. Heuristic results suggest that every starting point almost surely reaches a cycle, despite the colossal size of the intermediate values. a(0) = 397 is the first starting point which is not known to reach the (4,2) cycle: heuristically, the sequence likely runs for 10^12 terms or more before hitting it.

Examples

			The first few primes in the sequence are 397, 1231, 23677, 1069, 4463, and the value is squared after each of these. Otherwise, the value is halved.
		

Programs

  • Mathematica
    NestList[If[PrimeQ[#], #^2, Quotient[#, 2]] &, 397, 50]
  • Python
    from functools import lru_cache
    from sympy import isprime
    @lru_cache(maxsize=None)
    def A376801(n): return (a**2 if isprime(a:=A376801(n-1)) else a>>1) if n else 397 # Chai Wah Wu, Oct 25 2024

Formula

If a(n) is prime and a(n) >= 13, then a(n+6) = floor(a(n)^2/32).