A376801 a(0) = 397; a(n+1) = a(n)^2 if a(n) is prime, floor(a(n)/2) otherwise.
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
Keywords
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.
Links
- Matthew House, Table of n, a(n) for n = 0..2707
- Matthew House, Table of n, a(n) for a(n) prime, n <= 2341068 (primes up to 10^10000 proven via ECPP)
- Joseph O'Rourke et al., A Collatz-like function that bifurcates on primes, MathOverflow, 2015-2024.
- Strashimir G. Popvassilev et al., Are there always at least *five* divisions?, MathOverflow, 2015.
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).
Comments