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.

Previous Showing 11-18 of 18 results.

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

A098062 Primes of the form n^2 + 4n + 8.

Original entry on oeis.org

13, 29, 53, 173, 229, 293, 733, 1093, 1229, 1373, 2029, 2213, 3253, 4229, 4493, 5333, 7229, 7573, 9029, 9413, 10613, 13229, 13693, 15629, 18229, 18773, 21613, 24029, 26573, 27893, 31333, 33493, 37253, 41213, 42853, 46229, 47093, 54293, 55229
Offset: 1

Views

Author

Giovanni Teofilatto, Sep 12 2004

Keywords

Comments

Or, primes that are equal to the mean of 7 consecutive squares. - Zak Seidov, Apr 14 2007
Sum of 7 consecutive squares starting with m^2 is equal to 7*(13 + 6*m + m^2) and mean is (13 + 6*m + m^2)=(m+3)^2+4. Hence a(n)=A005473(n+1). Note that only nonnegative m's are considered. - Zak Seidov, Apr 14 2007
a(n)==1 (mod 4).
a(n)= A005473(n+1). - Zak Seidov, Apr 12 2007

Examples

			13 = (0^2 + ... + 6^2)/7, 29 = (2^2 + ... + 8^2)/7 = 29, 53 = (4^2 + ... + 10^2)/7 = 53.
		

Crossrefs

Programs

  • Magma
    [a: n in [0..250] | IsPrime(a) where a is n^2 + 4*n + 8]; // Vincenzo Librandi, Jul 17 2012
  • Mathematica
    Select[ Table[ n^2 + 4n + 8, {n, 240}], PrimeQ[ # ] &] (* Robert G. Wilson v, Sep 14 2004 *)
  • PARI
    for(n=0,240,if(isprime(p=n^2+4*n+8),print1(p,","))) \\ Klaus Brockhaus
    

Extensions

Edited, corrected and extended by Robert G. Wilson v and Klaus Brockhaus, Sep 14 2004
Edited by N. J. A. Sloane, Jul 02 2008 at the suggestion of R. J. Mathar

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 *)

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

Original entry on oeis.org

0, -1, 1, 2, -3, -6, 6, -8, -11, 11, 12, 14, -16, 16, 17, 19, -21, -23, -26, 27, -28, 32, -34, -36, 36, -39, 39, -41, 42, 44, -46, 46, -48, -49, 51, 52, -53, -58, 62, 64, 67, -68, -71, 71, -76, 77, 79, 81, -84, -89, 91, 96, -99, -101, 101, 102, -104, -111, 111, -113
Offset: 0

Views

Author

Henry Bottomley, Jul 07 2000

Keywords

Comments

36*k^2 + 12*k + 5 = (6*k+1)^2 + 4, which is four more than a square. Except for a(0), a(n) is never a multiple of 5.

Examples

			a(3)=2 since 36*2^2 + 12*2 + 5 = 173 which is prime (as well as being four more than a square).
		

Crossrefs

This sequence and formula, together with A056908 and its formula, generate all primes of the form k^2+4, i.e., A005473. Except for the first term, this sequence is a subsequence of A047201. Cf. A056900, A056902, A056904, A056906.

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.

A129412 Numbers k such that mean of 7 consecutive squares starting with k^2 is prime.

Original entry on oeis.org

0, 2, 4, 10, 12, 14, 24, 30, 32, 34, 42, 44, 54, 62, 64, 70, 82, 84, 92, 94, 100, 112, 114, 122, 132, 134, 144, 152, 160, 164, 174, 180, 190, 200, 204, 212, 214, 230, 232, 240, 242, 250, 252, 262, 264, 272, 274, 284, 290, 300, 304, 310, 314, 344, 354, 370, 372
Offset: 1

Views

Author

Zak Seidov, Apr 14 2007

Keywords

Comments

Sum of 7 consecutive squares starting with k^2 is equal to 7*(13 + 6*k + k^2) and mean is (13 + 6*k + k^2) = (k+3)^2+4. Hence a(n) = A007591(n+1)-3.

Examples

			(0^2+...+6^2)/7=13 prime, (2^2+...+8^2)/7=29 prime, (4^2+...+10^2)/7=53 prime.
		

Crossrefs

Programs

A089747 Numbers n such that n^2 - 2n + 5 is prime.

Original entry on oeis.org

0, 2, 4, 6, 8, 14, 16, 18, 28, 34, 36, 38, 46, 48, 58, 66, 68, 74, 86, 88, 96, 98, 104, 116, 118, 126, 136, 138, 148, 156, 164, 168, 178, 184, 194, 204, 208, 216, 218, 234, 236, 244, 246, 254, 256, 266, 268, 276, 278, 288, 294, 304, 308, 314, 318, 348, 358, 374
Offset: 1

Views

Author

Giovanni Teofilatto, Jan 08 2004

Keywords

References

  • M. Cerasoli, F. Eugeni and M. Protasi, Elementi di Matematica Discreta, Bologna, 1988.
  • Emanuele Munarini and Norma Zagaglia Salvi, Matematica Discreta, UTET, CittaStudiEdizioni, Milano, 1997.

Crossrefs

Cf. A005473 gives primes, A007591.

Programs

Formula

a(n) = A007591(n-1) + 1 for n > 1. [corrected by Georg Fischer, Jun 20 2020]

A346145 Primes of the form k^2 + 25.

Original entry on oeis.org

29, 41, 61, 89, 281, 349, 509, 601, 701, 809, 1049, 1181, 1321, 1789, 2141, 2729, 3389, 4649, 5209, 5501, 5801, 8861, 9241, 9629, 10429, 11261, 11689, 12569, 15401, 15901, 17449, 17981, 18521, 19069, 21341, 21929, 23741, 24989, 26921, 27581, 33149, 39229, 40829, 41641, 42461, 45821, 46681, 52009
Offset: 1

Views

Author

Todor Szimeonov, Jul 06 2021

Keywords

Comments

k^2 + 25 = (k+5i)*(k-5i), where i is the imaginary unit.

Crossrefs

Programs

  • Mathematica
    Select[Range[230]^2 + 25, PrimeQ] (* Amiram Eldar, Jul 06 2021 *)
  • PARI
    list(lim)=my(v=List(),p); forstep(k=2,sqrtint(lim\1-25),2, if(isprime(p = k^2+25), listput(v,p))); Vec(v) \\ Charles R Greathouse IV, Jul 06 2021

Formula

a(n) >> n log^2 n (Brun sieve). - Charles R Greathouse IV, Jul 06 2021
Previous Showing 11-18 of 18 results.