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.
%I A305099 #55 Apr 03 2023 10:36:13 %S A305099 3,3,7,11,13,17,19,23,37,41,67,59,47,47,67,59,61,89,89,103,79,83,89, %T A305099 97,103,131,113,127,223,191,163,179,389,239,151,167,173,239,199,191, %U A305099 199,223,233,593,293,457,227,311,373,257,307,313,283,277,271,307,307 %N 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. %C A305099 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 %D A305099 Martin Gardner, The Last Recreations (1997), pp. 194-195. %D A305099 R. K. Guy, Unsolved Problems in Number Theory, Section A2 %D A305099 Stephen P. Richards, A Number For Your Thoughts, 1982, p. 200. %H A305099 S. W. Golomb, <a href="http://www.jstor.org/stable/2689634">Evidence of Fortunes conjecture</a>, Mathematics Magazine, Vol. 54, No. 4 (Sep., 1981), pp. 209-210. %H A305099 The Prime Glossary, <a href="https://t5k.org/glossary/xpage/FortunateNumber.html">Fortunate and lesser fortunate numbers</a> %F A305099 a(n) = min(A005235(n), A055211(n)), for n > 1. %e A305099 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. %e A305099 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. %t A305099 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 *) %o A305099 (Sage) %o A305099 # returns quasi-fortunate-numbers up to n %o A305099 def generateQFN(n): %o A305099 quasi_fortunate_numbers = [] %o A305099 primorialArray = [] %o A305099 prime = Primes() %o A305099 num_length = n+1 %o A305099 primorial = 1 %o A305099 for i in range(num_length): %o A305099 primorial *= prime[i] %o A305099 primorialArray.append(primorial) %o A305099 for primorials in primorialArray: %o A305099 num = 0 %o A305099 while num < num_length: %o A305099 if is_prime(primorials+prime[num]): %o A305099 quasi_fortunate_numbers.append(prime[num]) %o A305099 break %o A305099 elif is_prime(primorials-prime[num]): %o A305099 quasi_fortunate_numbers.append(prime[num]) %o A305099 break %o A305099 num += 1 %o A305099 return quasi_fortunate_numbers %o A305099 generateQFN(7) %o A305099 (PARI) a(n) = { my(pr = prod(k=1, n, prime(k)), m=2); while (!isprime(pr-m) && !isprime(pr+m), m = nextprime(m+1)); m;} \\ _Michel Marcus_, Nov 02 2018 %Y A305099 Cf. A005235, A055211. %K A305099 nonn %O A305099 1,1 %A A305099 _David Nicolas Lopez_, May 22 2018 %E A305099 More terms from _Amiram Eldar_, Oct 31 2018