OFFSET
1,4
COMMENTS
Conjecture: every prime number can be written as +- p(n) -+ p(k)# where p(i)=i-th prime, p(i)#=i-th primorial.
The sequence grows remarkably slowly. The largest number occurring within the first 50000 elements is 90. - Stefan Steinerberger, Apr 10 2006
a(1) = 0 is the minimum value of a(n). It is also unrepeated in this sequence. - Altug Alkan, Dec 02 2015
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000 (corrected by Ray Chandler, Jan 19 2019)
EXAMPLE
p(8)=19;
19 + 2 = 21 = 3*7,
19 + 6 = 25 = 5*5, and
19 + 30 = 49 = 7*7, but
19 + 210 = 229, which is prime; 210=p(4)#, so a(8)=4.
MAPLE
primorial:= proc(n) option remember: ithprime(n)*procname(n-1) end proc:
primorial(0):= 1:
f:= proc(n) local k, p;
p:= ithprime(n);
for k from 0 do if isprime(p+primorial(k)) then return k fi od:
end proc:
map(f, [$1..100]); # Robert Israel, Aug 27 2015
MATHEMATICA
Table[k := 0; While[Not[PrimeQ[Prime[n]+Product[Prime[i], {i, 1, k}]]], k++ ]; k, {n, 1, 100}] (* Stefan Steinerberger, Apr 10 2006 *)
PROG
(PARI) primo(n) = prod(i=1, n, prime(i));
a(n) = {k=0; while(!isprime(prime(n)+primo(k)), k++); k; } \\ Michel Marcus, Aug 27 2015
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Pierre CAMI, Dec 30 2004
EXTENSIONS
More terms from Stefan Steinerberger, Apr 10 2006
a(1) = 0 added and name edited by Altug Alkan, Dec 02 2015
STATUS
approved