A316941 The natural numbers sequence where every composite is replaced by a prime, according to the rule explained in the Comments section (a(n) = -1 if no such prime is reached).
1, 2, 3, 211, 5, 23, 7, 2692213, 311, 773, 11, 3251, 13, 313, 1129, 3313788967, 17, 29, 19, 724553, 37, 211, 23, 2692213, 773, 3251, 313, 3313788967, 29, 3181, 31, 210527, 311, 3581, 1129, 7529, 37, 373, 313, 232357, 41, 19181, 43, 2111, 3119014487, 223, 47, 310345345771837, 31079, 3197071252784831
Offset: 1
Examples
As the first three natural numbers (1, 2 and 3) are not composites, they stay as they are. Then 4 becomes 22, and 22 produces the prime 211; 5 is a prime; 6 becomes the prime 23; 7 is a prime; 8 ends on the prime 2692213; 9 becomes 33 and 33 produces the prime 311; 10 produces the chain 25, 55, 511, 773 (prime); etc. Some terms of this sequence are huge: a(158) is a 70-digit prime, for instance.
Links
- Jean-Marc Falcoz, Table of n, a(n) for n = 1..175
Crossrefs
Cf. A002808 (the composite numbers).
Programs
-
Python
from sympy import factorint def A316941(n): while n>1 and sum((f:=factorint(n)).values()) > 1: n = int(str(p:=min(f))+str(n//p)) return n # Chai Wah Wu, Aug 02 2024
Comments