OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..121
MAPLE
primo:= proc(k) option remember; ithprime(k)*procname(k-1) end proc:
primo(1):= 2:
filter:= proc(p)
local k;
if not isprime(p) then return false fi;
for k from 1 do
if primo(k) >= p then return true
elif not isprime(p - primo(k)) then return false
fi
od
end proc:
select(filter, [2, seq(i, i=3..10^6, 2)]); # Robert Israel, Dec 14 2015
MATHEMATICA
s = Table[Product[Prime@ k, {k, n}], {n, 12}]; Select[Prime@ Range@ 30000, AllTrue[# - TakeWhile[s, Function[k, k < #]], PrimeQ@ # && # > 0 &] &] (* Michael De Vlieger, Dec 14 2015, Version 10 *)
PROG
(PARI) primo(n) = prod(k=1, n, prime(k));
isok(p) = {my(k=1); while ((pp=primo(k)) < p, if (! isprime(p-pp), return (0)); k++; ); return (1); }
lista(nn) = forprime(p=2, nn, if (isok(p), print1(p, ", ")); ); \\ Michel Marcus, Dec 14 2015
(MATLAB)
Primes = primes(10^8);
A = Primes;
primorial = 1;
for k =1:10
primorial = primorial*Primes(k);
j = find(A > primorial, 1, 'first');
if numel(j) == 0
break
end
A = [A(1:j-1), intersect(A(j:end), Primes + primorial)];
end
A % Robert Israel, Dec 14 2015
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Naohiro Nomoto, Mar 01 2002
STATUS
approved