

A305099


Least prime m such that either prime(n)#  m is prime or prime(n)# + m is prime, where p# denotes the product of all primes <= p.


0



3, 3, 7, 11, 13, 17, 19, 23, 37, 41, 67, 59, 47, 47, 67, 59, 61, 89, 89, 103, 79, 83, 89, 97, 103, 131, 113, 127, 223, 191, 163, 179, 389, 239, 151, 167, 173, 239, 199, 191, 199, 223, 233, 593, 293, 457, 227, 311, 373, 257, 307, 313, 283, 277, 271, 307, 307
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,1


COMMENTS

Since it is known that the first 2000 terms of A005235 are primes, and the first 1000 terms of A055211 are primes, then the first 1000 terms of this sequence are also the least m > 1 such that prime(n)#  m is prime or prime(n)# + m is prime.  Amiram Eldar, Nov 02 2018


REFERENCES

Martin Gardner, The Last Recreations (1997), pp. 194195.
R. K. Guy, Unsolved Problems in Number Theory, Section A2
Stephen P. Richards, A Number For Your Thoughts, 1982, p. 200.


LINKS

Table of n, a(n) for n=1..57.
S. W. Golomb, Evidence of Fortunes conjecture, Mathematics Magazine, Vol. 54, No. 4 (Sep., 1981), pp. 209210.
The Prime Glossary, Fortunate and lesser fortunate numbers


FORMULA

a(n) = min(A005235(n), A055211(n)), for n > 1.


EXAMPLE

For n = 6, the sixth primorial is 30030. The nearest prime such that p(6)# plus or minus prime equals its 30030's closest prime is equal to 17 because 30030+17=30047 which is prime or 30030  17 = 30013 which is also prime. Given that we only care about the smallest prime distance to the closest prime to the primorial, then we return 17.
For n = 7, the seventh primorial is 510510. The closest prime to the primorial is 510529 which is 510510 + 19; therefore 19 is in the sequence.


MATHEMATICA

primorial[n_] := Product[Prime[i], {i, 1, n}]; a[n_] := Module[{k = 2, pr = primorial[n]}, While[! PrimeQ[pr  k] && ! PrimeQ[pr + k], k = NextPrime[k]]; k]; Array[a, 57] (* Amiram Eldar, Oct 31 2018 *)


PROG

(Sage)
# returns quasifortunatenumbers up to n
def generateQFN(n):
quasi_fortunate_numbers = []
primorialArray = []
prime = Primes()
num_length = n+1
primorial = 1
for i in range(num_length):
primorial *= prime[i]
primorialArray.append(primorial)
for primorials in primorialArray:
num = 0
while num < num_length:
if is_prime(primorials+prime[num]):
quasi_fortunate_numbers.append(prime[num])
break
elif is_prime(primorialsprime[num]):
quasi_fortunate_numbers.append(prime[num])
break
num += 1
return quasi_fortunate_numbers
generateQFN(7)
(PARI) a(n) = { my(pr = prod(k=1, n, prime(k)), m=2); while (!isprime(prm) && !isprime(pr+m), m = nextprime(m+1)); m; } \\ Michel Marcus, Nov 02 2018


CROSSREFS

Cf. A005235, A055211.
Sequence in context: A052989 A252750 A287274 * A292141 A022403 A082550
Adjacent sequences: A305096 A305097 A305098 * A305100 A305101 A305102


KEYWORD

nonn


AUTHOR

David Nicolas Lopez, May 22 2018


EXTENSIONS

More terms from Amiram Eldar, Oct 31 2018


STATUS

approved



