login
a(1) = 1, a(n+1) = smallest prime divisor of 1 + product of all the primes p <= a(n).
0

%I #25 Sep 09 2017 22:34:35

%S 1,2,3,7,211,1051,91943,206705778299

%N a(1) = 1, a(n+1) = smallest prime divisor of 1 + product of all the primes p <= a(n).

%C Following Euclid's proof that there are infinitely many primes.

%C For example, 211 is 2*3*5*7 + 1 and 1051 is the smallest prime divisor of 2*3*5*...*211 + 1. This differs from the Euclid-Mullin sequence (A000945) because all the primes between a(n-1) and a(n) are used in calculating a(n+1).

%e a(5) = 2*3*5*7 + 1 = 211.

%e a(6) = 1051 because 1051 is the smallest prime divisor of 2*3*5*...*211 + 1.

%t a[1] = 1; a[n_] := a[n] = Block[{pr = 1 + Product[Prime[k], {k, PrimePi@a[n - 1]}], p = NextPrime@a[n - 1]}, While[Mod[pr, p] > 0, p = NextPrime@p]; p]; Array[a, 7] (* _Giovanni Resta_, Jul 24 2013 *)

%K nonn,hard

%O 1,2

%A _Antonio Sanso_, Jul 24 2013

%E a(8) from _Giovanni Resta_, Jul 25 2013