login
A167604
A variant of Euclid-Mullin (A000945): a(1)=2, a(n+1) is the least prime dividing [Product_{i in I} a(i) + Product_{i in I'} a(i)], minimized over all subsets I of {1..n}, where I' denotes the complementary subset of I.
5
2, 3, 5, 11, 37, 13, 7, 29, 17, 19, 43, 23, 47, 41, 53, 31, 61, 59, 67, 79, 83, 73, 97, 71, 101, 89, 103, 127, 107, 113, 137, 131, 139, 109, 149, 151, 163, 157, 167, 173, 193, 211, 179, 191, 181, 223, 199, 197, 233, 227, 229, 239, 241, 251, 257, 307, 281, 269, 271, 293
OFFSET
1,1
COMMENTS
By Euclid's argument, the terms are distinct.
If I is restricted to the empty set, we get the original Euclid-Mullin sequence (see A000945).
One can ask whether all primes occur in this sequence.
Initialization of the sequence with a(1) = 2 is not necessary: the formula given for successive terms yields 2 anyway (when starting with an empty sequence). Thus the sequence can be considered free of exceptional initialization. - Peter Munn, Oct 16 2025
LINKS
Andrew R. Booker, A variant of the Euclid-Mullin sequence containing every prime, arXiv preprint arXiv:1605.08929 [math.NT], 2016.
OEIS Wiki, Empty product
FORMULA
For any n, we have Legendre symbol (-a(1)*a(2)*...*a(n-1) / a(n)) = 1. If p is the smallest prime such that (-a(1)*a(2)*...*a(n-1) / p) = 1, then a(n) >= p. Conjecture: For all n, a(n) = p. Note that if b is such that b^2 == -a(1)*a(2)*...*a(n-1) (mod p) and for some I, b == prod_{i in I} a(i) (mod p), then a(n) = p. Heuristically, I must exist for large enough n, since the number of possible subsets I is much larger than p. - Max Alekseyev, Nov 11 2009, May 20 2015
EXAMPLE
To determine a(n+1) = a(2): we have n = 1, so we need to consider all subsets I of {1..n}, noting that {1..n} = {1}; so these subsets are the empty set, {}, and {1}. When I = {} and I' = {1}, Product_{i in I} a(i) is the empty product, which is 1, and Product_{i in I'} a(i) = a(1) = 2. The evaluation specified for I is the least prime dividing the sum of these products (1 + 2 = 3), which is 3. When I = {1}, the 2 products are interchanged, giving the same value 3. Taking the minimum of both values gives a(2) = 3.
a(4)=11 which is the smallest prime dividing any of the expressions derived from 4 partitions of the set of preceding terms: 2 + 3*5 = 17, 3 + 2*5 = 13, 5 + 2*3 = 11, 1 + 2*3*5 = 31.
MAPLE
with(numtheory):p:=proc(N) local S, d : S:=NULL:for d in divisors(N) while d^2<=N do S:=S, divisors(d+N/d)[2] od : return(min(S)) end:
a :=n->if n = 1 then 2 else p(mul(a(i), i = 1 .. n-1)) fi :
seq(a(n), n=1..15);
# Robert FERREOL, Oct 01 2019
MATHEMATICA
p[N_Integer] := Module[{S = {}, d, divisorsList},
For[d = 1, d^2 <= N, d++, If[Divisible[N, d], divisorsList = Divisors[d + N/d];
If[Length[divisorsList] >= 2, AppendTo[S, divisorsList[[2]]]]; ]]; Min[S]];
a[n_Integer] := If[n == 1, 2, p[Times @@ Table[a[i], {i, 1, n - 1}]]];
Table[a[n], {n, 1, 14}] (* Hilko Koning, Oct 30 2024 *)
PROG
(PARI) { A167604_list() = my(a, A, p, b, q, z, m); a = []; A=1; while(1, p=2; while( kronecker(-A, p)!=1, p=nextprime(p+1) ); b=lift(sqrt(-A+O(p))); z=znprimroot(p); m=nextprime(random(10^6)); q=lift(prod(i=1, #a, Mod(1+x^znlog(Mod(a[i], p), z, p-1), (1-x^(p-1))*Mod(1, m)) )); if( polcoeff(q, znlog(Mod(b, p), z, p-1), x)==0, error("conjecture failed mod", m)); a=concat(a, [p]); A*=p; print1(p, ", ") ) } /* Max Alekseyev, May 20 2015 */
CROSSREFS
A167605 lists such n that the first n terms here constitute a permutation of the first n primes.
Sequence in context: A067078 A124561 A355503 * A065510 A006721 A111289
KEYWORD
nonn,changed
AUTHOR
Kok Seng Chua (chuakokseng(AT)hotmail.com), Nov 07 2009
EXTENSIONS
Edited and extended by Max Alekseyev, Nov 11 2009
Edited by Peter Munn, Oct 05 2025
STATUS
approved