%I #40 Nov 21 2025 08:13:49
%S 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,61,59,67,71,73,79,83,89,
%T 97,103,107,101,113,109,127,131,139,137,151,163,149,157,167,179,173,
%U 181,193,191,197,199,211,223,227,229,241,239,233,251,257,263,269,271,293,277,281
%N a(n) is the least prime p not already listed such that m + A005117(A390138(n) + 1) is divisible by p^2 for certain m (as defined in the comments) with exactly n nonunitary prime factors.
%C This sequence is a permutation of the primes.
%C It is an elementary fact that we can have no more than three consecutive squarefree integers: the next integer will be divisible by 4. It is possible to generalize this in the following way. Let M_n be the set of integers with exactly n nonunitary prime factors; then M_n contains a subset M'_n of those m such that the run of squarefree integers m + A005117(i), i >= 1, has length A390138(n). For m in M'_n, m + A005117(A390138(n) + 1) is divisible by a(n)^2. For all m in M_n\M'_n, m + A005117(j) is nonsquarefree for some j < A390138(n) + 1. (See Englezou link for a proof).
%C Let S_n be the set of squares of primes which divide m + A005117(A390138(n) + 1) for every m in M'_n. It has been confirmed for n <= 289 that S_n is the singleton set {a(n)^2}. Nonetheless, for reasons explained in the Englezou link, we are unable to rule out the possibility that there exists an n > 289 such that |S_n| > 1. If this were the case, then it would mean A390138(r) = A390138(s) for some r <> s, and we would then require a way of ordering the corresponding primes a(r) and a(s). Let a(r) = p and a(s) = q such that p < q: we define the convention here that if A390138(r) = A390138(s) for some r <> s, then a(r) < a(s). This is equivalent to the ordering defined in the sequence name.
%H Miles Englezou, <a href="/A390240/b390240.txt">Table of n, a(n) for n = 0..289</a>
%H Miles Englezou, <a href="/A390240/a390240.pdf">Proof of generalization</a>
%e These examples follow from the proof in the Englezou link:
%e When n = 0, m is itself squarefree. If m + 1 = m + A005117(1) and m + 2 = m + A005117(2) are also squarefree, then m + A005117(3) is divisible by 4. Therefore a(0) = 2.
%e When m has n = 1 nonunitary prime factor, then for m in M'_n we find that m + A005117(12) is divisible by 9 (whereas, for other squares of primes, q^2, we find that not all m in M'_n are divisible by q^2). Therefore a(1) = 3.
%e When m has n = 2 nonunitary prime factors, then for m in M'_n we find that m + A005117(47) is divisible by 25. Therefore a(2) = 5.
%e When m has n = 16 nonunitary prime factors, then for m in M'_n we find that m + A005117(12629) is divisible by prime(18)^2 = 61^2 = 3721. Therefore a(16) = 61.
%e When m has n = 17 nonunitary prime factors, then for m in M'_n we find that m + A005117(12678) is divisible by prime(17)^2 = 59^2 = 3481. Therefore a(17) = 59.
%o (PARI)
%o {a(n) = my(f);
%o (f(n) = my(p = prime(n), N = [1..p^2 - 1], M);
%o for(k = 0, oo,
%o M = N;
%o N = select(x -> !issquarefree(x + k*p^2), N);
%o if(#N == 0,
%o return([vecmax(M) + k*p^2, 2*p^2, p]))));
%o for(m = 1, oo,
%o if(f(m)[2] > f(n+1)[1],
%o return(apply(y -> y[3], vecsort(apply(x -> f(x), [1..m])))[n+1])))}
%Y Cf. A000040, A005117, A390138, A390241.
%K nonn
%O 0,1
%A _Miles Englezou_, Oct 30 2025
%E Edited by _Peter Munn_, Nov 17 2025