cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-3 of 3 results.

A153974 Numbers n such that n^3 - 3 is prime.

Original entry on oeis.org

2, 4, 8, 10, 14, 16, 26, 34, 38, 40, 74, 80, 106, 110, 116, 124, 136, 158, 178, 184, 190, 206, 224, 230, 238, 256, 274, 280, 316, 320, 338, 340, 386, 410, 428, 446, 458, 464, 470, 484, 496, 530, 544, 550, 556, 590, 626, 634, 644, 646, 674, 710, 718, 728, 730
Offset: 1

Views

Author

Keywords

Comments

2^3 - 3 = 5 is prime, 4^3 - 3 = 61 is prime, ...

Crossrefs

Programs

  • Magma
    [n: n in [2..500] | IsPrime(n^3-3)]; // Vincenzo Librandi, Nov 26 2010
    
  • Mathematica
    a[n_]:=n^x-y;lst={};x=3;y=3;Do[If[PrimeQ[a[n]],AppendTo[lst,n]],{n,0,6!}];lst
    Select[Range[2, 1000], PrimeQ[#^3 - 3] &] (* G. C. Greubel, Sep 01 2016 *)
  • PARI
    is(n)=isprime(n^3-3) \\ Charles R Greathouse IV, Feb 17 2017

Extensions

First two terms 0,1, removed by Zak Seidov, Mar 14 2009

A097698 Numbers k such that both 4*k^2 - 3 and 4*k^2 + 3 are primes.

Original entry on oeis.org

2, 4, 5, 7, 32, 46, 56, 70, 73, 86, 109, 149, 152, 161, 163, 170, 175, 178, 208, 220, 235, 254, 277, 280, 290, 313, 317, 326, 334, 343, 347, 352, 364, 368, 373, 385, 403, 409, 434, 446, 460, 527, 541, 551, 565, 578, 598, 628, 632, 689, 709, 710, 737, 761, 812
Offset: 1

Views

Author

Carl R. White, Aug 20 2004

Keywords

Crossrefs

Programs

  • Magma
    [n: n in [1..1000] |IsPrime(4*n^2-3) and IsPrime(4*n^2+3)]; // Vincenzo Librandi, Nov 16 2010
    
  • Mathematica
    Select[Range[0,7! ],PrimeQ[ #^2-3]&&PrimeQ[ #^2+3]&]/2 (* Vladimir Joseph Stephan Orlovsky, Apr 23 2010 *)
    Select[Range[1000],AllTrue[4#^2+{3,-3},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Dec 08 2019 *)
  • PARI
    is(n)=isprime(4*n^2-3) && isprime(4*n^2+3) \\ Charles R Greathouse IV, Sep 27 2016

Formula

a(n) = A153975(n) / 2. - Vladimir Joseph Stephan Orlovsky, Apr 23 2010

A248738 Least number m such that both m^2 -/+ prime(n) are (positive) primes.

Original entry on oeis.org

3, 4, 6, 6, 90, 4, 6, 30, 6, 180, 6, 12, 30, 18, 12, 48, 60, 90, 24, 30, 18, 120, 12, 510, 10, 60, 36, 12, 60, 12, 12, 30, 12, 12, 30, 120, 24, 48, 18, 48, 690, 1020, 30, 14, 18, 420, 180, 18, 36, 540, 42, 1230, 150, 870, 36, 18, 330, 870, 18, 30, 18, 18, 18, 150, 30, 18, 30, 30, 60, 180, 24, 30, 36
Offset: 1

Views

Author

Zak Seidov, Oct 13 2014

Keywords

Examples

			a(1)=3 because p=prime(1)=2 and both P=3^2-2=7 and Q=3^2+2=11 are prime;
a(3)=6 because p=5 and both P=31 and Q=41 are prime;
a(10000)=510 because p=104729 and both P=155371 and Q=364829 are prime.
		

Crossrefs

Programs

  • Mathematica
    lnm[n_]:=Module[{m=2,pr=Prime[n]},If[m^2-pr<0,m=Ceiling[Sqrt[pr]]];While[ !AllTrue[m^2+{pr,-pr},PrimeQ],m++];m]; Array[lnm,80] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Nov 22 2014 *)
  • PARI
    a(n) = { p = prime(n); m = sqrtint(p); until( isprime(m^2-p) && isprime(m^2+p), m++); m} \\ Michel Marcus, Oct 13 2014
Showing 1-3 of 3 results.