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.

A002144 Pythagorean primes: primes of the form 4*k + 1.

Original entry on oeis.org

5, 13, 17, 29, 37, 41, 53, 61, 73, 89, 97, 101, 109, 113, 137, 149, 157, 173, 181, 193, 197, 229, 233, 241, 257, 269, 277, 281, 293, 313, 317, 337, 349, 353, 373, 389, 397, 401, 409, 421, 433, 449, 457, 461, 509, 521, 541, 557, 569, 577, 593, 601, 613, 617
Offset: 1

Views

Author

Keywords

Comments

Rational primes that decompose in the field Q(sqrt(-1)). - N. J. A. Sloane, Dec 25 2017
These are the prime terms of A009003.
-1 is a quadratic residue mod a prime p if and only if p is in this sequence.
Sin(a(n)*Pi/2) = 1 with Pi = 3.1415..., see A070750. - Reinhard Zumkeller, May 04 2002
If at least one of the odd primes p, q belongs to the sequence, then either both or neither of the congruences x^2 = p (mod q), x^2 = q (mod p) are solvable, according to Gauss reciprocity law. - Lekraj Beedassy, Jul 17 2003
Odd primes such that binomial(p-1, (p-1)/2) == 1 (mod p). - Benoit Cloitre, Feb 07 2004
Primes that are the hypotenuse of a right triangle with integer sides. The Pythagorean triple is {A002365(n), A002366(n), a(n)}.
Also, primes of the form a^k + b^k, k > 1. - Amarnath Murthy, Nov 17 2003
The square of a(n) is the average of two other squares. This fact gives rise to a class of monic polynomials x^2 + bx + c with b = a(n) that will factor over the integers regardless of the sign of c. See A114200. - Owen Mertens (owenmertens(AT)missouristate.edu), Nov 16 2005
Also such primes p that the last digit is always 1 for the Nexus numbers of form n^p - (n-1)^p. - Alexander Adamchuk, Aug 10 2006
The set of Pythagorean primes is a proper subset of the set of positive fundamental discriminants (A003658). - Paul Muljadi, Mar 28 2008
A079260(a(n)) = 1; complement of A137409. - Reinhard Zumkeller, Oct 11 2008
From Artur Jasinski, Dec 10 2008: (Start)
If we take 4 numbers: 1, A002314(n), A152676(n), A152680(n) then multiplication table modulo a(n) is isomorphic to the Latin square:
1 2 3 4
2 4 1 3
3 1 4 2
4 3 2 1
and isomorphic to the multiplication table of {1, i, -i, -1} where i is sqrt(-1), A152680(n) is isomorphic to -1, A002314(n) with i or -i and A152676(n) vice versa -i or i. 1, A002314(n), A152676(n), A152680(n) are subfield of Galois field [a(n)]. (End)
Primes p such that the arithmetic mean of divisors of p^3 is an integer. There are 2 sequences of such primes: this one and A002145. - Ctibor O. Zizka, Oct 20 2009
Equivalently, the primes p for which the smallest extension of F_p containing the square roots of unity (necessarily F_p) contains the 4th roots of unity. In this respect, the n = 2 case of a family of sequences: see n=3 (A129805) and n=5 (A172469). - Katherine E. Stange, Feb 03 2010
Subsequence of A007969. - Reinhard Zumkeller, Jun 18 2011
A151763(a(n)) = 1.
k^k - 1 is divisible by 4*k + 1 if 4*k + 1 is a prime (see Dickson reference). - Gary Detlefs, May 22 2013
Not only are the squares of these primes the sum of two nonzero squares, but the primes themselves are also. 2 is the only prime equal to the sum of two nonzero squares and whose square is not. 2 is therefore not a Pythagorean prime. - Jean-Christophe Hervé, Nov 10 2013
The statement that these primes are the sum of two nonzero squares follows from Fermat's theorem on the sum of two squares. - Jerzy R Borysowicz, Jan 02 2019
The decompositions of the prime and its square into two nonzero squares are unique. - Jean-Christophe Hervé, Nov 11 2013. See the Dickson reference, Vol. II, (B) on p. 227. - Wolfdieter Lang, Jan 13 2015
p^e for p prime of the form 4*k+1 and e >= 1 is the sum of 2 nonzero squares. - Jon Perry, Nov 23 2014
Primes p such that the area of the isosceles triangle of sides (p, p, q) for some integer q is an integer. - Michel Lagneau, Dec 31 2014
This is the set of all primes that are the average of two squares. - Richard R. Forberg, Mar 01 2015
Numbers k such that ((k-3)!!)^2 == -1 (mod k). - Thomas Ordowski, Jul 28 2016
This is a subsequence of primes of A004431 and also of A016813. - Bernard Schott, Apr 30 2022
In addition to the comment from Jean-Christophe Hervé, Nov 10 2013: All powers as well as the products of any of these primes are the sum of two nonzero squares. They are terms of A001481, which is closed under multiplication. - Klaus Purath, Nov 19 2023

Examples

			The following table shows the relationship between several closely related sequences:
Here p = A002144 = primes == 1 (mod 4), p = a^2+b^2 with a < b;
a = A002331, b = A002330, t_1 = ab/2 = A070151;
p^2 = c^2 + d^2 with c < d; c = A002366, d = A002365,
t_2 = 2ab = A145046, t_3 = b^2 - a^2 = A070079,
with {c,d} = {t_2, t_3}, t_4 = cd/2 = ab(b^2-a^2).
  ---------------------------------
   p  a  b  t_1  c   d t_2 t_3  t_4
  ---------------------------------
   5  1  2   1   3   4   4   3    6
  13  2  3   3   5  12  12   5   30
  17  1  4   2   8  15   8  15   60
  29  2  5   5  20  21  20  21  210
  37  1  6   3  12  35  12  35  210
  41  4  5  10   9  40  40   9  180
  53  2  7   7  28  45  28  45  630
  ...
a(7) = 53 = A002972(7)^2 + (2*A002973(7))^2 = 7^2 + (2*1)^2 = 49 + 4, and this is the only way. - _Wolfdieter Lang_, Jan 13 2015
		

References

  • David A. Cox, "Primes of the Form x^2 + n y^2", Wiley, 1989.
  • L. E. Dickson, "History of the Theory of Numbers", Chelsea Publishing Company, 1919, Vol I, page 386
  • L. E. Dickson, History of the Theory of Numbers, Carnegie Institution, Publ. No. 256, Vol. II, Washington D.C., 1920, p. 227.
  • G. H. Hardy, Ramanujan: twelve lectures on subjects suggested by his life and work, Cambridge, University Press, 1940, p. 132.
  • M. du Sautoy, The Music of the Primes, Fourth Estate / HarperCollins, 2003; see p. 76.
  • 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, pages 241, 243.
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, Revised edition 1987. See p. 90.

Crossrefs

Cf. A004613 (multiplicative closure).
Apart from initial term, same as A002313.
For values of n see A005098.
Primes in A020668.

Programs

  • Haskell
    a002144 n = a002144_list !! (n-1)
    a002144_list = filter ((== 1) . a010051) [1,5..]
    -- Reinhard Zumkeller, Mar 06 2012, Feb 22 2011
    
  • Magma
    [a: n in [0..200] | IsPrime(a) where a is 4*n + 1 ]; // Vincenzo Librandi, Nov 23 2014
    
  • Maple
    a := []; for n from 1 to 500 do if isprime(4*n+1) then a := [op(a),4*n+1]; fi; od: A002144 := n->a[n];
    # alternative
    A002144 := proc(n)
        option remember ;
        local a;
        if n = 1 then
            5;
        else
            for a from procname(n-1)+4 by 4 do
                if isprime(a) then
                    return a;
                end if;
            end do:
        end if;
    end proc:
    seq(A002144(n),n=1..100) ; # R. J. Mathar, Jan 31 2024
  • Mathematica
    Select[4*Range[140] + 1, PrimeQ[ # ] &] (* Stefan Steinerberger, Apr 16 2006 *)
    Select[Prime[Range[150]],Mod[#,4]==1&] (* Harvey P. Dale, Jan 28 2021 *)
  • PARI
    select(p->p%4==1,primes(1000))
    
  • PARI
    A002144_next(p=A2144[#A2144])={until(isprime(p+=4),);p} /* NB: p must be of the form 4k+1. Beyond primelimit, this is *much* faster than forprime(p=...,, p%4==1 && return(p)). */
    A2144=List(5); A002144(n)={while(#A2144A002144_next())); A2144[n]}
    \\ M. F. Hasler, Jul 06 2024
    
  • Python
    from sympy import prime
    A002144 = [n for n in (prime(x) for x in range(1,10**3)) if not (n-1) % 4]
    # Chai Wah Wu, Sep 01 2014
    
  • Python
    from sympy import isprime
    print(list(filter(isprime, range(1, 618, 4)))) # Michael S. Branicky, May 13 2021
    
  • SageMath
    def A002144_list(n): # returns all Pythagorean primes <= n
        return [x for x in prime_range(5,n+1) if x % 4 == 1]
    A002144_list(617) # Peter Luschny, Sep 12 2012

Formula

Odd primes of form x^2 + y^2, (x=A002331, y=A002330, with x < y) or of form u^2 + 4*v^2, (u = A002972, v = A002973, with u odd). - Lekraj Beedassy, Jul 16 2004
p^2 - 1 = 12*Sum_{i = 0..floor(p/4)} floor(sqrt(i*p)) where p = a(n) = 4*n + 1. [Shirali]
a(n) = A000290(A002972(n)) + A000290(2*A002973(n)) = A000290(A002331(n+1)) + A000290(A002330(n+1)). - Reinhard Zumkeller, Feb 16 2010
a(n) = A002972(n)^2 + (2*A002973(n))^2, n >= 1. See the Jean-Christophe Hervé Nov 11 2013 comment. - Wolfdieter Lang, Jan 13 2015
a(n) = 4*A005098(n) + 1. - Zak Seidov, Sep 16 2018
From Vaclav Kotesovec, Apr 30 2020: (Start)
Product_{k>=1} (1 - 1/a(k)^2) = A088539.
Product_{k>=1} (1 + 1/a(k)^2) = A243380.
Product_{k>=1} (1 - 1/a(k)^3) = A334425.
Product_{k>=1} (1 + 1/a(k)^3) = A334424.
Product_{k>=1} (1 - 1/a(k)^4) = A334446.
Product_{k>=1} (1 + 1/a(k)^4) = A334445.
Product_{k>=1} (1 - 1/a(k)^5) = A334450.
Product_{k>=1} (1 + 1/a(k)^5) = A334449. (End)
From Vaclav Kotesovec, May 05 2020: (Start)
Product_{k>=1} (1 + 1/A002145(k)) / (1 + 1/a(k)) = Pi/(4*A064533^2) = 1.3447728438248695625516649942427635670667319092323632111110962...
Product_{k>=1} (1 - 1/A002145(k)) / (1 - 1/a(k)) = Pi/(8*A064533^2) = 0.6723864219124347812758324971213817835333659546161816055555481... (End)
Sum_{k >= 1} 1/a(k)^s = (1/2) * Sum_{n >= 1 odd numbers} moebius(n) * log((2*n*s)! * zeta(n*s) * abs(EulerE(n*s - 1)) / (Pi^(n*s) * 2^(2*n*s) * BernoulliB(2*n*s) * (2^(n*s) + 1) * (n*s - 1)!))/n, s >= 3 odd number. - Dimitris Valianatos, May 21 2020
Legendre symbol (-1, a(n)) = +1, for n >= 1. - Wolfdieter Lang, Mar 03 2021

A002314 Minimal integer square root of -1 modulo p, where p is the n-th prime of the form 4k+1.

Original entry on oeis.org

2, 5, 4, 12, 6, 9, 23, 11, 27, 34, 22, 10, 33, 15, 37, 44, 28, 80, 19, 81, 14, 107, 89, 64, 16, 82, 60, 53, 138, 25, 114, 148, 136, 42, 104, 115, 63, 20, 143, 29, 179, 67, 109, 48, 208, 235, 52, 118, 86, 24, 77, 125, 35, 194, 154, 149, 106, 58, 26, 135, 96, 353, 87, 39
Offset: 1

Views

Author

Keywords

Comments

In other words, if p is the n-th prime == 1 (mod 4), a(n) is the smallest positive integer k such that k^2 + 1 == 0 (mod p).
The 4th roots of unity mod p, where p = n-th prime == 1 (mod 4), are +1, -1, a(n) and p-a(n).
Related to Stormer numbers.
Comment from Igor Shparlinski, Mar 12 2007 (writing to the Number Theory List): Results about the distribution of roots (for arbitrary quadratic polynomials) are given by W. Duke, J. B. Friedlander and H. Iwaniec and A. Toth.
Comment from Emmanuel Kowalski, Mar 12 2007 (writing to the Number Theory List): It is known (Duke, Friedlander, Iwaniec, Annals of Math. 141 (1995)) that the fractional part of a(n)/p(n) is equidistributed in [0,1/2] for p(n)
From Artur Jasinski, Dec 10 2008: (Start)
If we take the four numbers 1, A002314(n), A152676(n), and A152680(n), then their multiplication table modulo A002144(n) is isomorphic to the Latin square
1 2 3 4
2 4 1 3
3 1 4 2
4 3 2 1
and isomorphic to the multiplication table of {1, i, -i, -1} where i=sqrt(-1), A152680(n) is isomorphic to -1, A002314(n) with i or -i and A152676(n) vice versa -i or i.
1, A002314(n), A152676(n), A152680(n) are subfield of Galois Field [A002144(n)]. (End)
It is found empirically that the solutions of the Diophantine equation X^4 + Y^2 == 0 (mod P) (where P is a prime of the form P=4k+1) are integer points on parabolas Y = (+-(X^2 - P*X) + P*i)/C(P) where C(P) is the term corresponding to a prime P in this sequence. - Seppo Mustonen, Sep 22 2020

References

  • 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

Programs

  • Maple
    f:=proc(n) local i,j,k; for i from 1 to (n-1)/2 do if i^2 +1 mod n = 0 then RETURN(i); fi od: -1; end;
    t1:=[]; M:=40; for n from 1 to M do q:=ithprime(n); if q mod 4 = 1 then t1:=[op(t1),f(q)]; fi; od: t1;
  • Mathematica
    aa = {}; Do[If[Mod[Prime[n], 4] == 1, k = 1; While[ ! Mod[k^2 + 1, Prime[n]] == 0, k++ ]; AppendTo[aa, k]], {n, 1, 100}]; aa (* Artur Jasinski, Dec 10 2008 *)
  • PARI
    first_N_terms(N) = my(v=vector(N), i=0); forprime(p=5, oo, if(p%4==1, i++; v[i] = lift(sqrt(Mod(-1,p)))); if(i==N, break())); v \\ Jianing Song, Apr 17 2021

Extensions

Better description from Tony Davie (ad(AT)dcs.st-and.ac.uk), Feb 07 2001
More terms from Jud McCranie, Mar 18 2001

A152676 a(n) = A002144(n) - A002314(n).

Original entry on oeis.org

3, 8, 13, 17, 31, 32, 30, 50, 46, 55, 75, 91, 76, 98, 100, 105, 129, 93, 162, 112, 183, 122, 144, 177, 241, 187, 217, 228, 155, 288, 203, 189, 213, 311, 269, 274, 334, 381, 266, 392, 254, 382, 348, 413, 301, 286, 489, 439, 483, 553, 516, 476, 578, 423, 487, 504
Offset: 1

Author

Artur Jasinski, Dec 10 2008

Keywords

Comments

For the four numbers {1, A002314(n), A152676(n), A152680(n)}, the multiplication table modulo A002144(n) is isomorphic with the Latin square
1 2 3 4
2 4 1 3
3 1 4 2
4 3 2 1
and is isomorphic with the multiplication table for {1,i,-i,-1} where i = sqrt(-1), A152680(n) is isomorphic with -1, A002314(n) with i or -i and A152676(n) vice versa -i or i.
1, A002314(n), A152676(n), A152680(n) are a subfield of the Galois Field [A002144(n)].
Let p = A002144(n), the n-th prime of the form 4k+1. Then a(n) and A002314(n) are the two square roots of -1 (mod p). Note that a(n) is also the multiplicative inverse of A002314(n) (mod p). - T. D. Noe, Feb 18 2010

Crossrefs

Programs

  • Mathematica
    aa = {}; Do[If[Mod[Prime[n], 4] == 1, k = 1; While[ ! Mod[k^2 + 1, Prime[n]] == 0, k++ ]; AppendTo[aa, Prime[n] - k]], {n, 1, 200}]; aa

A163366 a(n) = (-1)^floor((prime(n)+2)/2) mod prime(n).

Original entry on oeis.org

1, 1, 4, 1, 1, 12, 16, 1, 1, 28, 1, 36, 40, 1, 1, 52, 1, 60, 1, 1, 72, 1, 1, 88, 96, 100, 1, 1, 108, 112, 1, 1, 136, 1, 148, 1, 156, 1, 1, 172, 1, 180, 1, 192, 196, 1, 1, 1, 1, 228, 232, 1, 240, 1, 256, 1, 268, 1, 276, 280, 1, 292, 1, 1, 312, 316, 1, 336, 1, 348, 352, 1, 1, 372, 1
Offset: 1

Author

Peter Luschny, Jul 25 2009

Keywords

Comments

Remove the '1's from the sequence to get A152680.
Product modulo p of the quadratic residues of p, where p = prime(n). [Jonathan Sondow, May 14 2010]

Examples

			a(4) = 1 because the quadratic residues of prime(4) = 7 are 1, 2, and 4, and 1*2*4 = 8 == 1 (mod 7). - _Jonathan Sondow_, May 14 2010
		

References

  • Carl-Erik Froeberg, On sums and products of quadratic residues, BIT, Nord. Tidskr. Inf.-behandl. 11 (1971) 389-398. [Jonathan Sondow, May 14 2010]

Crossrefs

Programs

  • Maple
    seq((-1)^iquo(ithprime(i)+2,2) mod ithprime(i),i=1..113);
  • Mathematica
    Table[Mod[ Apply[Times, Flatten[Position[ Table[JacobiSymbol[i, Prime[n]], {i, 1, Prime[n] - 1}], 1]]], Prime[n]], {n, 1, 80}] (* Jonathan Sondow, May 14 2010 *)

Formula

a(n)*A177863(n) == -1 (mod prime(n)), by Wilson's theorem. - Jonathan Sondow, May 14 2010
a(n) = A177860(n) modulo prime(n). - Jonathan Sondow, May 14 2010

A145199 Nonsquarefree numbers k such that k+1 is prime.

Original entry on oeis.org

4, 12, 16, 18, 28, 36, 40, 52, 60, 72, 88, 96, 100, 108, 112, 126, 136, 148, 150, 156, 162, 172, 180, 192, 196, 198, 228, 232, 240, 250, 256, 268, 270, 276, 280, 292, 306, 312, 316, 336, 348, 352, 372, 378, 388, 396, 400, 408, 420, 432, 448, 456, 460, 486, 490
Offset: 1

Author

Giovanni Teofilatto, Oct 04 2008

Keywords

Examples

			4 is in the sequence because it is not squarefree and 5 is prime. - _Emeric Deutsch_, Oct 12 2008
		

Crossrefs

Programs

  • Magma
    [n: n in [1..5*10^2]| not IsSquarefree(n) and IsPrime(n+1)]; // Vincenzo Librandi, Dec 24 2015
    
  • Maple
    with(numtheory): a:=proc(n) if issqrfree(n)=false and isprime(n+1)=true then n else end if end proc: seq(a(n),n=1..600); # Emeric Deutsch, Oct 12 2008
    with(numtheory): a:=proc(k) if issqrfree(ithprime(k)-1)=false then ithprime(k)-1 else end if end proc: seq(a(k),k=1..110); # Emeric Deutsch, Oct 12 2008
  • Mathematica
    Select[Prime[Range[120]]-1, !SquareFreeQ[ # ]&] (* T. D. Noe, Oct 06 2008 *)
  • PARI
    is(n)=isprime(n+1) && !issquarefree(n) \\ Charles R Greathouse IV, Jun 13 2017

Formula

a(n) = A049092(n) - 1. - Amiram Eldar, Feb 10 2021

Extensions

Corrected and extended by T. D. Noe, Emeric Deutsch and R. J. Mathar, Oct 05 2008

A197062 Successive records in A152676.

Original entry on oeis.org

3, 8, 13, 17, 31, 32, 50, 55, 75, 91, 98, 100, 105, 129, 162, 183, 241, 288, 311, 334, 381, 392, 413, 489, 553, 578, 615, 651, 670, 722, 726, 741, 844, 968, 1013, 1152, 1164, 1261, 1264, 1461, 1561, 1601, 1682, 1800, 1809, 1905, 1979, 2048, 2225, 2312, 2450
Offset: 1

Author

Artur Jasinski, Oct 09 2011

Keywords

Comments

On plot picture of A152676 is easy to see that all points occurred between some upper and lower limit curve. Numbers in this sequence are the nearest upper limit curve.

Crossrefs

Programs

  • Mathematica
    aa = {}; max = 0; Do[If[Mod[Prime[n], 4] == 1, k = 1; While[! Mod[k^2 + 1, Prime[n]] == 0, k++]; If[Prime[n] - k > max, max = Prime[n] - k; AppendTo[aa, Prime[n] - k]]], {n, 1, 1000}]; aa
Showing 1-6 of 6 results.