login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons 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

Pierre CAMI, Table of n, a(n) for n = 1..10000

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

Cf. A224490, A224491, A224492.

Sequence in context: A122947 A231147 A046534 * A318933 A140334 A131324

Adjacent sequences:  A224486 A224487 A224488 * A224490 A224491 A224492

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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 5 10:28 EDT 2020. Contains 333239 sequences. (Running on oeis4.)