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-6 of 6 results.

A079141 Primes of the form p^2 + 6 where p is prime.

Original entry on oeis.org

31, 127, 367, 967, 3727, 6247, 7927, 11887, 17167, 22807, 39607, 72367, 109567, 160807, 185767, 323767, 502687, 737887, 863047, 885487, 942847, 982087, 1079527, 1560007, 1739767, 1852327, 1985287, 2105407, 2343967, 2399407
Offset: 1

Views

Author

Cino Hilliard, Dec 26 2002

Keywords

Comments

Sum of reciprocals = 0.0447155381... [4 additional digits from Jon E. Schoenfield, Jan 15 2015]

Crossrefs

Cf. A056909.

Programs

  • Mathematica
    f[n_]:=n^2+6; lst={};Do[p=Prime[n];If[PrimeQ[f[p]],AppendTo[lst,f[p]]],{n,7!}];lst (* Vladimir Joseph Stephan Orlovsky, Jul 17 2009 *)
    Select[#^2+6&/@Prime[Range[300]],PrimeQ] (* Harvey P. Dale, Nov 16 2012 *)
  • PARI
    sqppn(n) = {sr=0; forprime(x=3,n, y = x*x+6; if(isprime(y), print1(y" "); sr+=1.0/y; ); ); print(); print(sr); } \\ Primes of the form p^2 + 6 and the sum of the reciprocals.

A059843 a(n) is the smallest prime p such that p-n is a nonzero square.

Original entry on oeis.org

2, 3, 7, 5, 41, 7, 11, 17, 13, 11, 47, 13, 17, 23, 19, 17, 53, 19, 23, 29, 37, 23, 59, 73, 29, 107, 31, 29, 173, 31, 47, 41, 37, 43, 71, 37, 41, 47, 43, 41, 617, 43, 47, 53, 61, 47, 83, 73, 53, 59, 67, 53, 89, 79, 59, 137, 61, 59, 383, 61, 97, 71, 67, 73, 101, 67, 71, 149, 73
Offset: 1

Views

Author

Labos Elemer, Feb 26 2001

Keywords

Examples

			For n = 17, let P = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,...} be the set of primes, then P - 17 = {-15,...,-4,0,2,6,12,14,20,24,26,30,36,...}. The first positive square in P - 17 is 36 with p = 53, so a(17) = 53. The square arising here is usually 1.
		

Crossrefs

These terms arise in A002496, A056899, A049423, A005473, A056905, A056909 as first or 2nd entries depending on offset.
Cf. A056896 (where p-n can be 0).

Programs

  • Maple
    SearchLimit := 100;
    for n from 1 to 400 do
    k := 0: c := true:
    while(c and k < SearchLimit) do
        k := k + 1:
        c := not isprime(k^2+n):
    end do:
    if k = SearchLimit then error("Search limit reached!") fi;
    a[n] := k^2 + n end do: seq(a[j], j=1..400);
    # Edited and SearchLimit introduced by Peter Luschny, Feb 05 2019
  • Mathematica
    spsq[n_]:=Module[{p=NextPrime[n]},While[!IntegerQ[Sqrt[p-n]],p= NextPrime[ p]];p]; Array[spsq,70] (* Harvey P. Dale, Nov 10 2017 *)
  • PARI
    for(n=1, 100, for(k=1, 100, if(isprime(k^2+n), print1(k^2+n, ", "); break()))) \\ Jianing Song, Feb 04 2019
    
  • PARI
    a(n) = forprime(p=n,, if ((p-n) && issquare(p-n), return (p))); \\ Michel Marcus, Feb 05 2019

Formula

a(n) = min{p : p - n = x^2 for some x > 0, p is prime}.
Does a(n) exist for all n? - Jianing Song, Feb 04 2019

A228424 Primes that can be written as a sum of a triangular number and a square.

Original entry on oeis.org

2, 3, 5, 7, 11, 17, 19, 29, 31, 37, 53, 59, 61, 67, 71, 79, 101, 103, 107, 109, 127, 131, 137, 149, 157, 179, 191, 197, 199, 211, 239, 241, 251, 257, 269, 271, 277, 311, 317, 331, 347, 349, 353, 359, 367, 379, 389, 397, 401, 409, 421, 431, 439, 449, 479, 487, 491, 499, 509, 521
Offset: 1

Views

Author

Zhi-Wei Sun, Nov 10 2013

Keywords

Comments

This sequence is interesting because of the conjecture in the comments in A228425.
Note that the sequence contains all primes of the form x^2 + 1 (A002496) since 1 is a triangular number.

Examples

			a(1) = 2 since 2 = 1*(1+1)/2 + 1^2.
a(2) = 3 since 3 = 2*(2+1)/2 + 0^2.
		

Crossrefs

Subsequence of A014133. Subsequences include A002496, A049423, A056909, A138355, and A243450.

Programs

  • Mathematica
    TQ[n_]:=IntegerQ[Sqrt[8n+1]]
    n=0
    Do[Do[If[TQ[Prime[k]-x^2],n=n+1;Print[n," ",Prime[k]];Goto[aa]],{x,0,Sqrt[Prime[k]]}];
    Label[aa];Continue,{k,1,100}]
  • PARI
    istrg(n) = {if (! issquare(8*n+1), return (0)); return (1);}
    isok(p) = {for (i = 0, sqrtint(p), if (istrg(p-i^2), return (1)););}
    lista(nn) = {forprime(p=2, nn, if (isok(p), print1(p, ", ")););}
    
  • PARI
    list(lim)=my(v=List(if(lim<3,[],[3]))); for(m=1,(sqrtint((lim\=1)*8+1)-1)\2, my(t=m*(m+1)/2); for(s=1,sqrtint(lim-t), my(p=t+s^2); if(isprime(p), listput(v,p)))); Set(v) \\ Charles R Greathouse IV, Aug 28 2024

Formula

Bhattacharya & Rahaman prove that a(n) ≍ n (log n)^(3/2). - Charles R Greathouse IV, Aug 28 2024

A243449 Primes of the form n^2 + 14.

Original entry on oeis.org

23, 239, 743, 1103, 2039, 5639, 7583, 8663, 27239, 33503, 38039, 42863, 59063, 81239, 88223, 91823, 119039, 131783, 140639, 164039, 189239, 205223, 245039, 263183, 288383, 328343, 342239, 378239, 393143, 400703, 431663, 439583, 514103, 660983, 710663, 950639
Offset: 1

Views

Author

Vincenzo Librandi, Jun 05 2014

Keywords

Crossrefs

Cf. A121250 (associated n).
Cf. primes of the form n^2+k: A144255 (k=1), A056899 (k=2), A049423 (k=3), A005473 (k=4), A056905 (k=5), A056909 (k=6), A079138 (k=7), A138338 (k=8), A138353 (k=9), A138355 (k=10), A138362 (k=11), A138368 (k=12), A138375 (k=13), this sequence (k=14), A243450 (k=15), A243451 (k=16), A228244 (k=17), A174812 (k=42).

Programs

  • Magma
    [a: n in [0..1000] | IsPrime(a) where a is n^2+14];
  • Mathematica
    Select[Table[n^2 + 14, {n, 0, 2000}], PrimeQ]
    Select[Range[1,1001,2]^2+14,PrimeQ] (* Harvey P. Dale, May 30 2023 *)

A059844 a(n) = smallest nonzero square x^2 such that n+x^2 is prime.

Original entry on oeis.org

1, 1, 4, 1, 36, 1, 4, 9, 4, 1, 36, 1, 4, 9, 4, 1, 36, 1, 4, 9, 16, 1, 36, 49, 4, 81, 4, 1, 144, 1, 16, 9, 4, 9, 36, 1, 4, 9, 4, 1, 576, 1, 4, 9, 16, 1, 36, 25, 4, 9, 16, 1, 36, 25, 4, 81, 4, 1, 324, 1, 36, 9, 4, 9, 36, 1, 4, 81, 4, 1, 36, 1, 16, 9, 4, 25, 36, 1, 4, 9, 16, 1, 144, 25, 4, 81
Offset: 1

Views

Author

Labos Elemer, Feb 26 2001

Keywords

Comments

a(n) = 1 for n in A006093. - Robert Israel, Dec 31 2023

Examples

			a(24) = 49 because 49 + 24 = 73 is prime and 1 + 24 = 25, 4 + 24 = 28, 9 + 24 = 33, 16 + 24 = 40, 25 + 24 = 49, and 36 + 24 = 60 are composite.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local x;
     for x from 1 + (n mod 2) by 2  do
      if isprime(n+x^2) then return x^2 fi;
     od
    end proc:
    f(1):= 1:
    map(f, [$1..100]); # Robert Israel, Dec 31 2023
  • Mathematica
    sqs[n_]:=Module[{q=1},While[!PrimeQ[n+q],q=(Sqrt[q]+1)^2];q]; Array[ sqs,90] (* Harvey P. Dale, Aug 11 2017 *)

Formula

a(n) + n is the smallest prime of the form x^2 + n.

A056910 Numbers k such that 36*k^2 + 12*k + 7 is prime (sorted by absolute values with negatives before positives).

Original entry on oeis.org

0, -1, -2, 3, 4, 5, -6, 10, -11, 13, -15, 15, 18, -22, 24, 25, 29, -31, 33, -37, -45, -55, 55, 59, -67, -72, 74, 80, -81, 85, -86, 88, -90, -95, 99, -101, -102, 108, -116, 118, -122, 129, -130, 143, 148, -151, -155, -157, 158, 159, -162, 164, 165
Offset: 0

Views

Author

Henry Bottomley, Jul 07 2000

Keywords

Comments

36*k^2 + 12*k + 7 = (6*k+1)^2 + 6, which is six more than a square.

Examples

			a(2)=-2 since 36*(-2)^2 + 12*(-2) + 7 = 127, which is prime (as well as being six more than a square).
		

Crossrefs

This sequence and formula generate all primes of the form k^2+6, i.e., A056909. Except for the first term, none of the a(n) are a multiple of 7 and so the rest of this sequence is a subsequence of A047304. Cf. A056900, A056902, A056904, A056906, A056907, A056908.

Formula

a(n) = (-1 +- sqrt(A056909(n) - 6))/6, choosing +- to give an integer result for each n.
Showing 1-6 of 6 results.