OFFSET
1,1
COMMENTS
For reasons of parity, either p or q must be equal to 2, so this actually is the union of (mostly) "primes of the form p + 8" (A092402) and (rarely) "primes of the form p^3 + 2" (A048636 = 29, 127, 24391, 357913, ...). - M. F. Hasler, Jan 13 2025
Except for 13, these primes are the minimum or maximum prime numbers of the respective decade. - Davide Rotondo, Jan 31 2025
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
37 is prime and 37 = 2^3 + 29, where 2 and 29 are primes, therefore 37 is a term.
MAPLE
N:= 2000: # to get terms <= N
A1:= select(t -> isprime(t) and isprime(t-8), {11, seq(i, i=13 ..N, 6)}):
v:= floor((N-2)^(1/3)):
B:= select(t -> isprime(t) and isprime(t^3+2), {3, seq(i, i=5..v, 6)}):
sort(convert(A1 union map(t -> t^3+2, B), list)); # Robert Israel, Mar 05 2020
MATHEMATICA
nmax=4; Select[Union[Prime[Range[nmax]]^3 + 2, Prime[Range[Prime[nmax]^3]] + 8], PrimeQ] (* Amiram Eldar, Nov 21 2018 *)
PROG
(MiniZinc)
include "globals.mzn";
int: n = 2;
int: max_val = 1200000;
array[1..n+1] of var 2..max_val: x;
% primes between 2..max_valset of int:
prime = 2..max_val diff { i | i in 2..max_val, j in 2..ceil(sqrt(i)) where i mod j = 0} ;
set of int: primes; primes = prime union {2};
solve satisfy;
constraint all_different(x) /\ x[1] in primes /\ x[2] in primes /\ x[3] in primes /\
pow(x[1], 3)+pow(x[2], 1)= x[3] ;
output [ show(x)]
(PARI) list(lim)=my(v=List()); forprime(p=3, sqrtnint((lim\=1)-2, 3), if(isprime(p^3+2), listput(v, p^3+2))); forprime(p=11, lim+8, if(isprime(p-8), listput(v, p))); Set(v) \\ Charles R Greathouse IV, Jan 13 2025
(PARI) select( {is_A321891(n)=isprime(n)&& (isprime(n-8)|| (ispower(n-2, 3, &n)&&isprime(n)))}, [1..1234]) \\ M. F. Hasler, Jan 13 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierandrea Formusa, Nov 20 2018
EXTENSIONS
More terms from Amiram Eldar, Nov 21 2018
STATUS
approved