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.

A002496 Primes of the form k^2 + 1.

Original entry on oeis.org

2, 5, 17, 37, 101, 197, 257, 401, 577, 677, 1297, 1601, 2917, 3137, 4357, 5477, 7057, 8101, 8837, 12101, 13457, 14401, 15377, 15877, 16901, 17957, 21317, 22501, 24337, 25601, 28901, 30977, 32401, 33857, 41617, 42437, 44101, 50177
Offset: 1

Views

Author

Keywords

Comments

It is conjectured that this sequence is infinite, but this has never been proved.
An equivalent description: primes of form P = (p1*p2*...*pm)^k + 1 where p1..pm are primes and k > 1, since then k must be even for P to be prime.
Also prime = p(n) if A054269(n) = 1, i.e., quotient-cycle-length = 1 in continued fraction expansion of sqrt(p). - Labos Elemer, Feb 21 2001
Also primes p such that phi(p) is a square.
Also primes of form x*y + z, where x, y and z are three successive numbers. - Giovanni Teofilatto, Jun 05 2004
It is a result that goes back to Mirsky that the set of primes p for which p-1 is squarefree has density A, where A = A005596 denotes the Artin constant. More precisely, Sum_{p <= x} mu(p-1)^2 = A*x/log x + o(x/log x) as x tends to infinity. Conjecture: Sum_{p <= x, mu(p-1)=1} 1 = (A/2)*x/log x + o(x/log x) and Sum_{p <= x, mu(p-1)=-1} 1 = (A/2)*x/log x + o(x/log x). - Pieter Moree (moree(AT)mpim-bonn.mpg.de), Nov 03 2003
Also primes of the form x^y + 1, where x > 0, y > 1. Primes of the form x^y - 1 (x > 0, y > 1) are the Mersenne primes listed in A000668(n) = {3, 7, 31, 127, 8191, 131071, 524287, 2147483647, ...}. - Alexander Adamchuk, Mar 04 2007
With the exception of the first two terms {2,5}, the continued fraction (1 + sqrt(p))/2 has period 3. - Artur Jasinski, Feb 03 2010
With the exception of the first term {2}, congruent to 1 (mod 4). - Artur Jasinski, Mar 22 2011
With the exception of the first two terms, congruent to 1 or 17 (mod 20). - Robert Israel, Oct 14 2014
From Bernard Schott, Mar 22 2019: (Start)
These primes are the primitive terms which generate the sequence of integers with only one prime factor and whose Euler's totient is a square: A054755. So this sequence is a subsequence of A054755 and of A039770. Additionally, the terms of this sequence also have a square cototient, so this sequence is a subsequence of A063752 and A054754.
If p prime = n^2 + 1, phi(p) = n^2 and cototient(p) = 1^2.
Except for 3, the four Fermat primes in A019434 {5, 17, 257, 65537}, belong to this sequence; with F_k = 2^(2^k) + 1, phi(F_k) = (2^(2^(k-1)))^2.
See the file "Subfamilies and subsequences" (& I) in A039770 for more details, proofs with data, comments, formulas and examples. (End)
In this sequence, primes ending with 7 seem to appear twice as often as primes ending with 1. This is because those with 7 come from integers ending with 4 or 6, while those with 1 come only from integers ending with 0 (see De Koninck & Mercier reference). - Bernard Schott, Nov 29 2020
The set of odd primes p for which every elliptic curve of the form y^2 = x^3 + d*x has order p-1 over GF(p) for those d with (d,p)=1 and d a fourth power modulo p. - Gary Walsh, Sep 01 2021 [edited, Gary Walsh, Apr 26 2025]

References

  • Jean-Marie De Koninck & Armel Mercier, 1001 Problèmes en Théorie Classique des Nombres, Problème 211 pp. 34 and 169, Ellipses, Paris, 2004.
  • Leonhard Euler, De numeris primis valde magnis (E283), reprinted in: Opera Omnia. Teubner, Leipzig, 1911, Series (1), Vol. 3, p. 22.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 5th ed., Oxford Univ. Press, 1979, th. 17.
  • Hugh L. Montgomery, Ten Lectures on the Interface Between Analytic Number Theory and Harmonic Analysis, Amer. Math. Soc., 1996, p. 208.
  • C. Stanley Ogilvy, Tomorrow's Math. 2nd ed., Oxford Univ. Press, 1972, p. 116.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 118.
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers (Rev. ed. 1997), p. 134.

Crossrefs

Cf. A083844 (number of these primes < 10^n), A199401 (growth constant).
Cf. A000668 (Mersenne primes), A019434 (Fermat primes).
Subsequence of A039770.
Cf. A010051, subsequence of A002522.
Cf. A237040 (an analog for n^3 + 1).
Cf. A010051, A000290; subsequence of A028916.
Subsequence of A039770, A054754, A054755, A063752.
Primes of form n^2+b^4, b fixed: A243451 (b=2), A256775 (b=3), A256776 (b=4), A256777 (b=5), A256834 (b=6), A256835 (b=7), A256836 (b=8), A256837 (b=9), A256838 (b=10), A256839 (b=11), A256840 (b=12), A256841 (b=13).
Cf. A030430 (primes ending with 1), A030432 (primes ending with 7).

Programs

  • Haskell
    a002496 n = a002496_list !! (n-1)
    a002496_list = filter ((== 1) . a010051') a002522_list
    -- Reinhard Zumkeller, May 06 2013
    
  • Magma
    [p: p in PrimesUpTo(100000)| IsSquare(p-1)]; // Vincenzo Librandi, Apr 09 2011
    
  • Maple
    select(isprime, [2, seq(4*i^2+1, i= 1..1000)]); # Robert Israel, Oct 14 2014
  • Mathematica
    Select[Range[100]^2+1, PrimeQ]
    Join[{2},Select[Range[2,300,2]^2+1,PrimeQ]] (* Harvey P. Dale, Dec 18 2018 *)
  • PARI
    isA002496(n) = isprime(n) && issquare(n-1) \\ Michael B. Porter, Mar 21 2010
    
  • PARI
    is_A002496(n)=issquare(n-1)&&isprime(n) \\ For "random" numbers in the range 10^10 and beyond, at least 5 times faster than the above. - M. F. Hasler, Oct 14 2014
    
  • Python
    # Python 3.2 or higher required
    from itertools import accumulate
    from sympy import isprime
    A002496_list = [n+1 for n in accumulate(range(10**5),lambda x,y:x+2*y-1) if isprime(n+1)] # Chai Wah Wu, Sep 23 2014
    
  • Python
    # Python 2.4 or higher required
    from sympy import isprime
    A002496_list = list(filter(isprime, (n*n+1 for n in range(10**5)))) # David Radcliffe, Jun 26 2016

Formula

There are O(sqrt(n)/log(n)) terms of this sequence up to n. But this is just an upper bound. See the Bateman-Horn or Wolf papers, for example, for the conjectured for what is believed to be the correct density.
a(n) = 1 + A005574(n)^2. - R. J. Mathar, Jul 31 2015
Sum_{n>=1} 1/a(n) = A172168. - Amiram Eldar, Nov 14 2020
a(n+1) = 4*A001912(n)^2 + 1. - Hal M. Switkay, Apr 03 2022

Extensions

Formula, reference, and comment from Charles R Greathouse IV, Aug 24 2009
Edited by M. F. Hasler, Oct 14 2014

A005574 Numbers k such that k^2 + 1 is prime.

Original entry on oeis.org

1, 2, 4, 6, 10, 14, 16, 20, 24, 26, 36, 40, 54, 56, 66, 74, 84, 90, 94, 110, 116, 120, 124, 126, 130, 134, 146, 150, 156, 160, 170, 176, 180, 184, 204, 206, 210, 224, 230, 236, 240, 250, 256, 260, 264, 270, 280, 284, 300, 306, 314, 326, 340, 350, 384, 386, 396
Offset: 1

Views

Author

Keywords

Comments

Hardy and Littlewood conjectured that the asymptotic number of elements in this sequence not exceeding n is approximately c*sqrt(n)/log(n) for some constant c. - Stefan Steinerberger, Apr 06 2006
Also, nonnegative integers such that a(n)+i is a Gaussian prime. - Maciej Ireneusz Wilczynski, May 30 2011
Apparently Goldbach conjectured that any a > 1 from this sequence can be written as a=b+c where b and c are in this sequence (Lemmermeyer link below). - Jeppe Stig Nielsen, Oct 14 2015
No term > 2 can be both in this sequence and in A001105 because of the Aurifeuillean factorization (2*k^2)^2 + 1 = (2*k^2 - 2*k + 1) * (2*k^2 + 2*k + 1). - Jeppe Stig Nielsen, Aug 04 2019

References

  • Harvey Dubner, "Generalized Fermat primes", J. Recreational Math., 18 (1985): 279-280.
  • R. K. Guy, "Unsolved Problems in Number Theory", 3rd edition, A2.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 5th ed., Oxford Univ. Press, 1979, p. 15, Thm. 17.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Other sequences of the type "Numbers k such that k^2 + i is prime": this sequence (i=1), A067201 (i=2), A049422 (i=3), A007591 (i=4), A078402 (i=5), A114269 (i=6), A114270 (i=7), A114271 (i=8), A114272 (i=9), A114273 (i=10), A114274 (i=11), A114275 (i=12).
Cf. A010051, A259645, A295405 (characteristic function).

Programs

  • Haskell
    a005574 n = a005574_list !! (n-1)
    a005574_list = filter ((== 1) . a010051' . (+ 1) . (^ 2)) [0..]
    -- Reinhard Zumkeller, Jul 03 2015
    
  • Magma
    [n: n in [0..400] | IsPrime(n^2+1)]; // Vincenzo Librandi, Nov 18 2010
    
  • Mathematica
    Select[Range[350], PrimeQ[ #^2 + 1] &] (* Stefan Steinerberger, Apr 06 2006 *)
    Join[{1},2Flatten[Position[PrimeQ[Table[x^2+1,{x,2,1000,2}]],True]]]  (* Fred Patrick Doty, Aug 18 2017 *)
  • PARI
    isA005574(n) = isprime(n^2+1) \\ Michael B. Porter, Mar 20 2010
    
  • PARI
    for(n=1, 1e3, if(isprime(n^2 + 1), print1(n, ", "))) \\ Altug Alkan, Oct 14 2015
    
  • Python
    from sympy import isprime; [print(n, end = ', ') for n in range(1, 400) if isprime(n*n+1)] # Ya-Ping Lu, Apr 23 2025

Formula

a(n) = A090693(n) - 1.
a(n) = 2*A001912(n-1) for n > 1. - Jeppe Stig Nielsen, Aug 04 2019

A001912 Numbers k such that 4*k^2 + 1 is prime.

Original entry on oeis.org

1, 2, 3, 5, 7, 8, 10, 12, 13, 18, 20, 27, 28, 33, 37, 42, 45, 47, 55, 58, 60, 62, 63, 65, 67, 73, 75, 78, 80, 85, 88, 90, 92, 102, 103, 105, 112, 115, 118, 120, 125, 128, 130, 132, 135, 140, 142, 150, 153, 157, 163, 170, 175, 192, 193, 198, 200
Offset: 1

Views

Author

Keywords

Comments

Complement of A094550. - Hermann Stamm-Wilbrandt, Sep 16 2014
Positive integers whose square is the sum of two triangular numbers in exactly one way (A000217(k) + A000217(k+1) = k*(k+1)/2 + (k+1)*(k+2)/2 = (k+1)^2). In other words, positive integers k such that A052343(k^2) = 1. - Altug Alkan, Jul 06 2016
4*a(n)^2 + 1 = A002496(n+1). - Hal M. Switkay, Apr 03 2022

References

  • E. Kogbetliantz and A. Krikorian, Handbook of First Complex Prime Numbers, Gordon and Breach, NY, 1971, p. 1.
  • M. Kraitchik, Recherches sur la Théorie des Nombres. Gauthiers-Villars, Paris, Vol. 1, 1924, Vol. 2, 1929, see Vol. 1, p. 11.
  • C. S. Ogilvy, Tomorrow's Math. 2nd ed., Oxford Univ. Press, 1972, p. 116.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A002496, A005574, A062325, A090693, A094550, A214517 (first differences).

Programs

  • Magma
    [n: n in [1..100] | IsPrime(4*n^2+1)] // Vincenzo Librandi, Nov 21 2010
    
  • Maple
    A001912 := proc(n)
        option remember;
        if n = 1 then
            1;
        else
            for a from procname(n-1)+1 do
                if isprime(4*a^2+1) then
                    return a;
                end if;
            end do:
        end if;
    end proc: # R. J. Mathar, Aug 09 2012
  • Mathematica
    Select[Range[200], PrimeQ[4#^2 + 1] &] (* Alonso del Arte, Dec 20 2013 *)
  • PARI
    is(n)=isprime(4*n^2 + 1) \\ Charles R Greathouse IV, Apr 28 2015

Formula

a(n) = A005574(n+1)/2.

A090693 Positive numbers n such that n^2 - 2n + 2 is a prime.

Original entry on oeis.org

2, 3, 5, 7, 11, 15, 17, 21, 25, 27, 37, 41, 55, 57, 67, 75, 85, 91, 95, 111, 117, 121, 125, 127, 131, 135, 147, 151, 157, 161, 171, 177, 181, 185, 205, 207, 211, 225, 231, 237, 241, 251, 257, 261, 265, 271, 281, 285, 301, 307, 315, 327, 341, 351, 385, 387, 397
Offset: 1

Views

Author

Giovanni Teofilatto, Dec 19 2003

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

A002496 gives primes, A062325 gives prime index. Cf. A001912.
A005574(n+1) + 1.

Programs

  • Mathematica
    a={};Do[If[PrimeQ[n^2-2n+2],AppendTo[a,n]],{n,1000}];a (* Peter J. C. Moses, Apr 02 2013 *)
    Select[Range[400],PrimeQ[#^2-2#+2]&] (* Harvey P. Dale, May 10 2013 *)
  • Python
    # Python 3.2 or higher required.
    from itertools import accumulate
    from sympy import isprime
    A090693_list = [i for i,n in enumerate(accumulate(range(10**5),lambda x,y:x+2*y-3)) if i > 0 and isprime(n+2)] # Chai Wah Wu, Sep 23 2014

Formula

a(n) = A005574(n)+1.

Extensions

Corrected and extended by Ray Chandler, Dec 28 2003
Definition corrected by Chai Wah Wu, Sep 23 2014

A140126 Partial sums of A001912.

Original entry on oeis.org

1, 3, 6, 11, 18, 26, 36, 48, 61, 79, 99, 126, 154, 187, 224, 266, 311, 358, 413, 471, 531, 593, 656, 721, 788, 861, 936, 1014, 1094, 1179, 1267, 1357, 1449, 1551, 1654, 1759, 1871, 1986, 2104, 2224, 2349, 2477, 2607, 2739, 2874, 3014, 3156, 3306, 3459, 3616
Offset: 1

Views

Author

Jonathan Vos Post, Jun 04 2008

Keywords

Examples

			a(17) = 1 + 2 + 3 + 5 + 7 + 8 + 10 + 12 + 13 + 18 + 20 + 27 + 28 + 33 + 37 + 42 + 45 = 311 which is itself a prime. The primes in this sequence begin: 3, 11, 61, 79, 311, 593.
		

Crossrefs

Programs

  • Maple
    A001912 := proc(n) option remember ; local a ; if n <= 3 then RETURN(n); else for a from A001912(n-1)+1 do if isprime(4*a^2+1) then RETURN(a) ; fi ; od: fi ; end: A140126 := proc(n) local i ; add( A001912(i),i=1..n) ; end: seq(A140126(n),n=1..80) ; # R. J. Mathar, Jun 12 2008
  • Mathematica
    Accumulate[Select[Range[200],PrimeQ[4#^2+1]&]] (* Harvey P. Dale, Jan 29 2017 *)

Formula

a(n) = SUM[i=1..n] A001912(i) = SUM[j=1..n] {Numbers i_j such that 4*(i_j)^2 + 1 is prime}.

Extensions

More terms from R. J. Mathar, Jun 12 2008

A286328 Least integer k such that the area of the triangle (prime(n), k, k+1) is an integer.

Original entry on oeis.org

4, 3, 24, 60, 14, 9, 180, 264, 20, 480, 19, 84, 924, 1104, 51, 1740, 155, 2244, 2520, 2664, 3120, 3444, 99, 51, 51, 5304, 5724, 65, 399, 8064, 8580, 9384, 9660, 221, 11400, 12324, 13284, 13944, 14964, 16020, 819, 18240, 194, 99, 19800, 22260, 24864, 25764, 26220
Offset: 2

Views

Author

Michel Lagneau, May 07 2017

Keywords

Comments

The area A of a triangle whose sides have lengths a, b, and c is given by Heron's formula : A = sqrt(s*(s-a)*(s-b)*(s-c)), where s = (a+b+c)/2.
The corresponding areas are 6, 6, 84, 330, 84, 36, 1710, 3036, 210,...
The following table gives the first values of n, the sides (prime(n), k, k+1) and the area A of each triangle.
+-----+---------+------+------+-------+
| n | prime(n)| k | k+1 | A |
+-----+---------+------+------+-------+
| 2 | 3 | 4 | 5 | 6 |
| 3 | 5 | 3 | 4 | 6 |
| 4 | 7 | 24 | 25 | 84 |
| 5 | 11 | 60 | 61 | 330 |
| 6 | 13 | 14 | 15 | 84 |
| 7 | 17 | 9 | 10 | 36 |
| 8 | 19 | 180 | 181 | 1710 |
| 9 | 23 | 264 | 265 | 3036 |
| 10 | 29 | 20 | 21 | 210 |
.......................................
We observe triangles of sides (prime(m), prime(m)+1, prime(m)+2) = (3, 4, 5), (13, 14, 15), (193, 194, 195), (37633, 37634, 37635), ... with the corresponding areas 6, 84, 16296, 613283664, ... (subsequence of A011945).
We observe Pythagorean triangles for n = 2, 3, 4, 5, 8, 9, 10, ....
In this case, if prime(n) < k, the numbers k of the sequence such that prime(n) = sqrt(2k+1) are given by the numbers {4, 24, 60, 180, 264, ...}, subsequence of {A084921} = {4, 12, 24, 60, 84, 144, 180, 264, ...}. If prime(n) > k, the numbers k of the sequence such that prime(n) = sqrt(2k^2+2k+1) are given by the numbers 3, 20, 4059, 23660, ....
From Chai Wah Wu, May 15 2017: (Start)
Assumes triangle has positive area.
Let p = prime(n). Then
(p+1)/2 <= a(n) <= (p^2-1)/2.
a(n) = (p+1)/2 if n > 1 is a term in A062325, i.e. p is of the form m^2+1 (A002496); otherwise, a(n) > (p+1)/2.
a(n) is the smallest k >= (p+1)/2 such that sum_{i=(p+1)/2}^{k} i*(p^2-1)/2 is a square.
These statements follow from the fact that the area of a triangle with sides of length p, k and k+1 is equal to (p^2-1)*((2k+1)^2-p^2)/16.
(End)

Examples

			a(4) = 24 because the area of the triangle (prime(4), 24, 25) = (7, 24, 25) = sqrt(28*(28-7)*(28-24)*(28-25)) = 84, where the semiperimeter 28 = (7+24+25)/2.
		

Crossrefs

Programs

  • Maple
    nn:=10^7:
    for n from 2 to 50 do:
    a:=ithprime(n):ii:=0:
    for k from 1 to nn while(ii=0) do:
    p:=(a+2*k+1)/2:q:=p*(p-a)*(p-k)*(p-k-1):
    if q>0 and floor(sqrt(q))=sqrt(q) then
           ii:=1: printf(`%d, `,k):
          else
          fi:
         od:
        od:
  • Mathematica
    Do[kk=0;Do[s=(Prime[n]+2k+1)/2;If[IntegerQ[s],area2=s(s-Prime[n])(s-k)(s-k-1);If[area2>0&&kk==0&&IntegerQ[Sqrt[area2]],Print[n," ",k];kk=1]],{k,1,3*10^4}],{n,2,10}] (* or *)
    a[n_] := Block[{p = Prime@n, k}, k = (p + 1)/2; While[! IntegerQ@ Sqrt[(4 k^2 - p^2 + 4 k + 1) (p^2 - 1)/16], k++]; k]; a /@ Range[2, 50] (* Giovanni Resta, May 07 2017 *)
  • Python
    from _future_ import division
    from sympy import prime
    from gmpy2 import is_square
    def A286328(n): # assumes n >= 2
        p, area = prime(n), 0
        k, q, kq = (p + 1)//2, (p**2 - 1)//2, (p - 1)*(p + 1)**2//4
        while True:
            area += kq
            if is_square(area):
                return k
            k += 1
            kq += q # Chai Wah Wu, May 15 2017
Showing 1-6 of 6 results.