login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Smallest k such that k*2*p(n)^2-1=q is prime and k*2*q^2-1 is also prime.
9

%I #26 Jan 16 2025 11:51:25

%S 1,1,25,9,21,3,1,16,25,136,10,33,90,250,10,55,1,9,36,75,1,4,33,406,

%T 103,15,121,4,244,78,28,19,49,105,45,34,10,46,33,4,111,15,9,36,118,66,

%U 10,13,31,76,66,36,55,15,4,48,6,66,13,34,54,64,153,1,60,48

%N Smallest k such that k*2*p(n)^2-1=q is prime and k*2*q^2-1 is also prime.

%H Pierre CAMI, <a href="/A224490/b224490.txt">Table of n, a(n) for n = 1..10000</a>

%e 1*2*2^2-1=7 prime q 1*2*7^2-1=97 also prime so a(1)=1.

%t a[n_] := For[k = 1, True, k++, p = Prime[n]; If[PrimeQ[q = k*2*p^2 - 1] && PrimeQ[k*2*q^2 - 1], Return[k]]]; Table[a[n], {n, 1, 66}] (* _Jean-François Alcover_, Apr 12 2013 *)

%o (PFGW & SCRIPT)

%o SCRIPT

%o DIM k

%o DIM i,0

%o DIM q

%o DIMS t

%o OPENFILEOUT myf,a(n).txt

%o LABEL a

%o SET i,i+1

%o IF i>20000 THEN END

%o SET k,0

%o LABEL b

%o SET k,k+1

%o SETS t,%d,%d,%d\,;k;i;p(i)

%o SET q,k*2*p(i)^2-1

%o PRP q,t

%o IF ISPRP THEN GOTO c

%o GOTO b

%o LABEL c

%o SET q,k*2*q^2-1

%o PRP q,t

%o IF ISPRP THEN WRITE myf,t

%o IF ISPRP THEN GOTO a

%o GOTO b

%Y Cf. A224489, A224491, A224492.

%K nonn,changed

%O 1,3

%A _Pierre CAMI_, Apr 08 2013

%E Typo in name fixed by _Zak Seidov_, Apr 11 2013