Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #34 Jan 15 2025 08:44:39
%S 11,13,19,29,31,37,61,67,79,97,109,127,139,157,181,199,241,271,277,
%T 367,397,409,439,457,487,499,571,577,601,607,661,691,709,727,751,769,
%U 829,919,937,991,1021,1039,1069,1117,1171,1201,1231,1237,1291,1297,1327,1381
%N Prime numbers of the form p^3 + q, where p and q are primes.
%C 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
%H Robert Israel, <a href="/A321891/b321891.txt">Table of n, a(n) for n = 1..10000</a>
%e 37 is prime and 37 = 2^3 + 29, where 2 and 29 are primes, therefore 37 is a term.
%p N:= 2000: # to get terms <= N
%p A1:= select(t -> isprime(t) and isprime(t-8), {11,seq(i,i=13 ..N,6)}):
%p v:= floor((N-2)^(1/3)):
%p B:= select(t -> isprime(t) and isprime(t^3+2), {3,seq(i,i=5..v,6)}):
%p sort(convert(A1 union map(t -> t^3+2,B), list)); # _Robert Israel_, Mar 05 2020
%t nmax=4; Select[Union[Prime[Range[nmax]]^3 + 2, Prime[Range[Prime[nmax]^3]] + 8], PrimeQ] (* _Amiram Eldar_, Nov 21 2018 *)
%o (MiniZinc)
%o include "globals.mzn";
%o int: n = 2;
%o int: max_val = 1200000;
%o array[1..n+1] of var 2..max_val: x;
%o % primes between 2..max_valset of int:
%o prime = 2..max_val diff { i | i in 2..max_val, j in 2..ceil(sqrt(i)) where i mod j = 0} ;
%o set of int: primes; primes = prime union {2};
%o solve satisfy;
%o constraint all_different(x) /\ x[1] in primes /\ x[2] in primes /\ x[3] in primes /\
%o pow(x[1], 3)+pow(x[2], 1)= x[3] ;
%o output [ show(x)]
%o (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
%o (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
%Y Union of A048636 and A092402. - _Michel Marcus_, Nov 21 2018
%K nonn
%O 1,1
%A _Pierandrea Formusa_, Nov 20 2018
%E More terms from _Amiram Eldar_, Nov 21 2018