OFFSET
1,1
COMMENTS
We are searching smallest j such that j*prime(n)*2*p(n)^2-1 is prime, for A224489 it is smallest k such that k*2*prime(n)^2-1 is prime, so here we replace smallest k by smallest j*prime(n).
LINKS
Pierre CAMI, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = A053989(2p^3) where p is the n-th prime. - Charles R Greathouse IV, Apr 18 2013
EXAMPLE
1*2*2^3-1= 15 is composite; 2*2*2^3-1= 31 is prime, so a(1)=2 as p(1)=2.
1*2*3^3-1=53 is prime, so a(2)=1 as p(2)=3.
1*2*5^3-1=249 is composite; 2*2*5^3=499 is prime, so a(3)=2 as p(3)=5.
MATHEMATICA
jmax = 10^5 (* sufficient up to 10^5 terms *); a[n_] := For[j = 1, j <= jmax, j++, p = Prime[n]; If[PrimeQ[j*2*p^3 - 1], Return[j]]]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Apr 18 2013 *)
PROG
(Magma)
S:=[];
j:=1;
for n in [1..100] do
while not IsPrime(2*j*NthPrime(n)^3-1) do
j:=j+1;
end while;
Append(~S, j);
j:=1;
end for;
S; // Bruno Berselli, Apr 18 2013
(PARI) a(n)=my(P=2*prime(n)^3, j); while(!isprime(j++*P-1), ); j \\ Charles R Greathouse IV, Apr 18 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Apr 12 2013
STATUS
approved