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!)
A245639 Prime numbers P such that 8*P^2-1 is also prime. 4
2, 3, 5, 11, 17, 19, 23, 31, 59, 67, 79, 89, 103, 107, 137, 173, 193, 229, 233, 241, 257, 263, 271, 311, 317, 353, 359, 383, 409, 431, 479, 509, 521, 523, 541, 563, 569, 577, 593, 599, 613, 641, 709, 739, 751, 787, 829, 887, 907, 919, 947, 971, 983, 1033 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
EXAMPLE
8*2^2-1=31 prime so a(1)=2.
8*3^2-1=71 prime so a(2)=3.
8*5^2-1=199 prime so a(3)=5.
8*7^2-1=391 composite.
8*11^2-1=967 prime so a(4)=11.
MATHEMATICA
Reap[Do[p = Prime[n]; If[PrimeQ[8*p^2-1], Sow[p]], {n, 1, 200}]][[2, 1]] (* Jean-François Alcover, Jul 28 2014 *)
Select[Prime[Range[200]], PrimeQ[8 #^2 - 1] &] (* Vincenzo Librandi, Sep 07 2014 *)
PROG
(PFGW & SCRIPT)
SCRIPT
DIM n, 0
DIMS t
OPENFILEOUT myf, a(n).txt
LABEL loop1
SET n, n+1
SETS t, %d, %d\,; n; p(n)
PRP 8*p(n)^2-1, t
IF ISPRP THEN GOTO a
GOTO loop1
LABEL a
WRITE myf, t
GOTO loop1
(PARI) select(p->isprime(8*p^2-1), primes(300)) \\ Colin Barker, Jul 28 2014
(Python)
import sympy
from sympy import isprime
from sympy import prime
for n in range(1, 10**3):
..p = prime(n)
..if isprime(8*p**2-1):
....print(p, end=', ')
# Derek Orr, Aug 13 2014
(Magma) [p: p in PrimesUpTo(1500)| IsPrime(8*p^2-1)]; // Vincenzo Librandi, Sep 07 2014
CROSSREFS
Sequence in context: A220627 A040083 A045308 * A362239 A147813 A338578
KEYWORD
nonn,easy
AUTHOR
Pierre CAMI, Jul 28 2014
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 April 20 02:10 EDT 2024. Contains 371798 sequences. (Running on oeis4.)