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.

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).

This page as a plain text file.
%I A316941 #12 Aug 02 2024 18:24:00
%S A316941 1,2,3,211,5,23,7,2692213,311,773,11,3251,13,313,1129,3313788967,17,
%T A316941 29,19,724553,37,211,23,2692213,773,3251,313,3313788967,29,3181,31,
%U A316941 210527,311,3581,1129,7529,37,373,313,232357,41,19181,43,2111,3119014487,223,47,310345345771837,31079,3197071252784831
%N 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).
%C A316941 Only the composites are replaced by a prime; 1 and the primes themselves stay as they are. A composite "c" is replaced by the concatenation [az], where "a" is the smallest factor > 1 of "c" and "z" the biggest factor < "c". This transforms for instance 28 in [214] (because 2 x 14 is 28) and not in [128] (1 x 28) or [47] (4 x 7). The procedure is iterated from there until the concatenation produces a prime [214 becomes 2107, then 7301, 71043, 323681, 431751, 3143917, 7449131, 12895779, 34298593, 74899799, 135761523, 345253841, 941366901 which ends into the prime 3313788967, prime that will thus be a(28)].
%H A316941 Jean-Marc Falcoz, <a href="/A316941/b316941.txt">Table of n, a(n) for n = 1..175</a>
%e A316941 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.
%e A316941 Some terms of this sequence are huge: a(158) is a 70-digit prime, for instance.
%o A316941 (Python)
%o A316941 from sympy import factorint
%o A316941 def A316941(n):
%o A316941     while n>1 and sum((f:=factorint(n)).values()) > 1:
%o A316941         n = int(str(p:=min(f))+str(n//p))
%o A316941     return n # _Chai Wah Wu_, Aug 02 2024
%Y A316941 Cf. A002808 (the composite numbers).
%K A316941 base,nonn
%O A316941 1,2
%A A316941 _Eric Angelini_ and _Jean-Marc Falcoz_, Jul 17 2018