login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A224489 Smallest k such that k*2*p(n)^2-1 is prime. 9
1, 1, 3, 1, 1, 1, 1, 4, 4, 6, 4, 6, 1, 1, 9, 10, 1, 6, 4, 7, 1, 4, 3, 4, 3, 10, 4, 4, 1, 1, 1, 10, 1, 7, 6, 12, 1, 9, 6, 3, 1, 1, 6, 3, 1, 1, 1, 3, 3, 4, 4, 21, 4, 1, 3, 1, 6, 4, 1, 10, 3, 1, 15, 1, 3, 4, 9, 13, 10, 9, 1, 4, 1, 3, 1, 3, 12, 9, 6, 1, 1, 22, 4, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
LINKS
EXAMPLE
1*2*2^2-1=7 is prime, p(1)=2 so a(1)=1.
1*2*3^2-1=17 is prime, p(2)=3 so a(2)=1.
1*2*5^2-1=49 is composite; 2*2*5^2-1=99 is composite; 3*2*5^2-1=149 is prime, p(3)=5 so a(3)=3.
MATHEMATICA
a[n_] := For[k = 1, True, k++, If[ PrimeQ[k*2*Prime[n]^2 - 1], Return[k]]]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Apr 10 2013 *)
PROG
PFGW and SCRIPTIFY
SCRIPT
DIM k
DIM i, 0
DIM q
DIMS t
OPENFILEOUT myf, a(n).txt
LABEL a
SET i, i+1
IF i>50000 THEN END
SET k, 0
LABEL b
SET k, k+1
SETS t, %d, %d, %d\,; k; i; p(i)
SET q, k*2*p(i)^2-1
PRP q, t
IF ISPRP THEN WRITE myf, t
IF ISPRP THEN GOTO a
GOTO b
(Magma)
S:=[];
k:=1;
for n in [1..90] do
while not IsPrime(k*2*NthPrime(n)^2-1) do
k:=k+1;
end while;
Append(~S, k);
k:=1;
end for;
S; // Bruno Berselli, Apr 18 2013
CROSSREFS
Sequence in context: A363925 A231147 A046534 * A318933 A361239 A140334
KEYWORD
nonn
AUTHOR
Pierre CAMI, Apr 08 2013
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 11 21:40 EDT 2024. Contains 375073 sequences. (Running on oeis4.)