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-10 of 14 results. Next

A111945 Duplicate of A002143.

Original entry on oeis.org

1, 1, 1, 3, 3, 1, 5, 3, 1, 7, 5, 3, 5
Offset: 1

Views

Author

Keywords

A002145 Primes of the form 4*k + 3.

Original entry on oeis.org

3, 7, 11, 19, 23, 31, 43, 47, 59, 67, 71, 79, 83, 103, 107, 127, 131, 139, 151, 163, 167, 179, 191, 199, 211, 223, 227, 239, 251, 263, 271, 283, 307, 311, 331, 347, 359, 367, 379, 383, 419, 431, 439, 443, 463, 467, 479, 487, 491, 499, 503, 523, 547, 563, 571
Offset: 1

Views

Author

Keywords

Comments

Or, odd primes p such that -1 is not a square mod p, i.e., the Legendre symbol (-1/p) = -1. [LeVeque I, p. 66]. - N. J. A. Sloane, Jun 28 2008
Primes which are not the sum of two squares, see the comment in A022544. - Artur Jasinski, Nov 15 2006
Natural primes which are also Gaussian primes. (It is a common error to refer to this sequence as "the Gaussian primes".)
Inert rational primes in the field Q(sqrt(-1)). - N. J. A. Sloane, Dec 25 2017
Numbers n such that the product of coefficients of (2n)-th cyclotomic polynomial equals -1. - Benoit Cloitre, Oct 22 2002
For p and q both belonging to the sequence, exactly one of the congruences x^2 = p (mod q), x^2 = q (mod p) is solvable, according to Gauss reciprocity law. - Lekraj Beedassy, Jul 17 2003
Also primes p that divide L((p-1)/2) or L((p+1)/2), where L(n) = A000032(n), the Lucas numbers. Union of A122869 and A122870. - Alexander Adamchuk, Sep 16 2006
Also odd primes p that divide ((p-1)!! + 1) or ((p-2)!! + 1). - Alexander Adamchuk, Nov 30 2006
Also odd primes p that divide ((p-1)!! - 1) or ((p-2)!! - 1). - Alexander Adamchuk, Apr 18 2007
This sequence is a proper subset of the set of the absolute values of negative fundamental discriminants (A003657). - Paul Muljadi, Mar 29 2008
Bernard Frénicle de Bessy discovered that such primes cannot be the hypotenuse of a Pythagorean triangle in opposition to primes of the form 4*n+1 (see A002144). - after Paul Curtz, Sep 10 2008
A079261(a(n)) = 1; complement of A145395. - Reinhard Zumkeller, Oct 12 2008
Subsequence of A007970. - Reinhard Zumkeller, Jun 18 2011
A151763(a(n)) = -1.
Primes p such that p XOR 2 = p - 2. Brad Clardy, Oct 25 2011 (Misleading in the sense that this is a formula for the super-sequence A004767. - R. J. Mathar, Jul 28 2014)
It appears that each term of A004767 is the mean of two terms of this subsequence of primes therein; cf. A245203. - M. F. Hasler, Jul 13 2014
Numbers n > 2 such that ((n-2)!!)^2 == 1 (mod n). - Thomas Ordowski, Jul 24 2016
Odd numbers n > 1 such that ((n-1)!!)^2 == 1 (mod n). - Thomas Ordowski, Jul 25 2016
Primes p such that (p-2)!! == (p-3)!! (mod p). - Thomas Ordowski, Jul 28 2016
See Granville and Martin for a discussion of the relative numbers of primes of the form 4k+1 and 4k+3. - Editors, May 01 2017
Sometimes referred to as Blum primes for their connection to A016105 and the Blum Blum Shub generator. - Charles R Greathouse IV, Jun 14 2018
Conjecture: a(n) for n > 4 can be written as a sum of 3 primes of the form 4k+1, which would imply that primes of the form 4k+3 >= 23 can be decomposed into a sum of 6 nonzero squares. - Thomas Scheuerle, Feb 09 2023

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 870.
  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See pp. 146-147.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 5th ed., Oxford Univ. Press, 1979, p. 219, th. 252.
  • W. J. LeVeque, Topics in Number Theory. Addison-Wesley, Reading, MA, 2 vols., 1956, Vol. 1, p. 66.
  • 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).
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, Revised edition 1987. See p. 90.

Crossrefs

Apart from initial term, same as A045326.
Cf. A016105.
Cf. A004614 (multiplicative closure).

Programs

  • Haskell
    a002145 n = a002145_list !! (n-1)
    a002145_list = filter ((== 1) . a010051) [3, 7 ..]
    -- Reinhard Zumkeller, Aug 02 2015, Sep 23 2011
    
  • Magma
    [4*n+3 : n in [0..142] | IsPrime(4*n+3)]; // Arkadiusz Wesolowski, Nov 15 2013
    
  • Maple
    A002145 := proc(n)
        option remember;
        if n = 1 then
            3;
        else
            a := nextprime(procname(n-1)) ;
            while a mod 4 <>  3 do
                a := nextprime(a) ;
            end do;
            return a;
        end if;
    end proc:
    seq(A002145(n),n=1..20) ; # R. J. Mathar, Dec 08 2011
  • Mathematica
    Select[4Range[150] - 1, PrimeQ] (* Alonso del Arte, Dec 19 2013 *)
    Select[ Prime@ Range[2, 110], Length@ PowersRepresentations[#^2, 2, 2] == 1 &] (* or *)
    Select[ Prime@ Range[2, 110], JacobiSymbol[-1, #] == -1 &] (* Robert G. Wilson v, May 11 2014 *)
  • PARI
    forprime(p=2,1e3,if(p%4==3,print1(p", "))) \\ Charles R Greathouse IV, Jun 10 2011
    
  • Sage
    def A002145_list(n): return [p for p in prime_range(1, n + 1) if p % 4 == 3]  # Peter Luschny, Jul 29 2014

Formula

Remove from A000040 terms that are in A002313.
Intersection of A000040 and A004767. - Alonso del Arte, Apr 22 2014
From Vaclav Kotesovec, Apr 30 2020: (Start)
Product_{k>=1} (1 - 1/a(k)^2) = A243379.
Product_{k>=1} (1 + 1/a(k)^2) = A243381.
Product_{k>=1} (1 - 1/a(k)^3) = A334427.
Product_{k>=1} (1 + 1/a(k)^3) = A334426.
Product_{k>=1} (1 - 1/a(k)^4) = A334448.
Product_{k>=1} (1 + 1/a(k)^4) = A334447.
Product_{k>=1} (1 - 1/a(k)^5) = A334452.
Product_{k>=1} (1 + 1/a(k)^5) = A334451. (End)
From Vaclav Kotesovec, May 05 2020: (Start)
Product_{k>=1} (1 + 1/a(k)) / (1 + 1/A002144(k)) = Pi/(4*A064533^2) = 1.3447728438248695625516649942427635670667319092323632111110962...
Product_{k>=1} (1 - 1/a(k)) / (1 - 1/A002144(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 * (2^(n*s) - 1) * (n*s - 1)! * zeta(n*s) / (Pi^(n*s) * abs(EulerE(n*s - 1))))/n, s >= 3 odd number. - Dimitris Valianatos, May 20 2020

Extensions

More terms from James Sellers, Apr 21 2000

A076409 Sum of the quadratic residues of prime(n).

Original entry on oeis.org

1, 1, 5, 7, 22, 39, 68, 76, 92, 203, 186, 333, 410, 430, 423, 689, 767, 915, 1072, 994, 1314, 1343, 1577, 1958, 2328, 2525, 2369, 2675, 2943, 3164, 3683, 3930, 4658, 4587, 5513, 5134, 6123, 6520, 6012, 7439, 7518, 8145, 7831, 9264, 9653, 8955, 10761, 11596
Offset: 1

Views

Author

R. K. Guy, Oct 08 2002

Keywords

Comments

Row sums of A063987. - R. J. Mathar, Jan 08 2015
prime(n) divides a(n) for n > 2. This is implied by a variant of Wolstenholme's theorem (see Hardy & Wright reference). - Isaac Saffold, Jun 21 2018

Examples

			If n = 3, then p = 5 and a(3) = 1 + 4 = 5. If n = 4, then p = 7 and a(4) = 1 + 4 + 2 = 7. If n = 5, then p = 11 and a(5) = 1 + 4 + 9 + 5 + 3 = 22. - _Michael Somos_, Jul 01 2018
		

References

  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 4th ed., Oxford Univ. Press, 1960, p. 88-90.
  • Kenneth A. Ribet, Modular forms and Diophantine questions, Challenges for the 21st century (Singapore 2000), 162-182; World Sci. Publishing, River Edge NJ 2001; Math. Rev. 2002i:11030.

Crossrefs

Cf. A076410.
Sums of residues, nonresidues, and their differences, for p == 1 mod 4, p == 3 mod 4, and all p: A171555; A282035, A282036, A282037; A076409, A125615, A282038.

Programs

  • Maple
    A076409 := proc(n)
      local a,p,i ;
      p := ithprime(n) ;
      a := 0 ;
      for i from 1 to p-1 do
        if numtheory[legendre](i,p) = 1 then
           a := a+i ;
        end if;
      end do;
      a ;
    end proc: # R. J. Mathar, Feb 26 2011
  • Mathematica
    Join[{1,1}, Table[ Apply[ Plus, Flatten[ Position[ Table[ JacobiSymbol[i, Prime[n]], {i, 1, Prime[n] - 1}], 1]]], {n, 3, 48}]]
    Join[{1}, Table[p=Prime[n]; If[Mod[p,4]==1, p(p-1)/4, Sum[PowerMod[k,2, p],{k,p/2}]], {n,2,1000}]] (* Zak Seidov, Nov 02 2011 *)
    a[ n_] := If[ n < 3, Boole[n > 0], With[{p = Prime[n]}, Sum[ Mod[k^2, p], {k, (p - 1)/2}]]]; (* Michael Somos, Jul 01 2018 *)
  • PARI
    a(n,p=prime(n))=if(p<5,return(1)); if(k%4==1, return(p\4*p)); sum(k=1,p-1,k^2%p) \\ Charles R Greathouse IV, Feb 21 2017

Formula

If prime(n) = 4k+1 then a(n) = k*(4k+1).
For n>2 if prime(n) = 4k+3 then a(n) = (k - b)*(4k+3) where b = (h(-p) - 1) / 2; h(-p) = A002143. For instance. If n=5, p=11, k=2, b=(1-1)/2=0 and a(5) = 2*11 = 22. If n=20, p=71, k=17, b=(7-1)/2=3 and a(20) = 14*71 = 994. - Andrés Ventas, Mar 01 2021

Extensions

Edited and extended by Robert G. Wilson v, Oct 09 2002

A002148 Smallest prime p==3 (mod 8) such that Q(sqrt(-p)) has class number 2n+1.

Original entry on oeis.org

3, 59, 131, 251, 419, 659, 1019, 971, 1091, 2099, 1931, 1811, 3851, 3299, 2939, 3251, 4091, 4259, 8147, 5099, 9467, 6299, 6971, 8291, 8819, 14771, 22619, 9539, 13331, 18443, 11171, 16979, 12011, 13859, 16931, 17939, 28211, 19211, 24251, 20411
Offset: 0

Views

Author

Keywords

References

  • D. A. Buell, Binary Quadratic Forms. Springer-Verlag, NY, 1989, pp. 224-241.
  • 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. A002143 (class numbers), A002149, A003173, A006203.

Programs

  • Mathematica
    a=Table[0, {101}]; Do[If[PrimeQ[m], c=NumberFieldClassNumber[Sqrt[-m]]; If[c<102 && a[[c]]==0, a[[c]]=m]], {m, 3, 30000, 8}]; Table[a[[n]], {n, 1, 101, 2}]

Extensions

More terms from Robert G. Wilson v, Apr 17 2001
Edited by Dean Hickerson, Mar 17 2003

A002146 Smallest prime == 7 (mod 8) where Q(sqrt(-p)) has class number 2n+1.

Original entry on oeis.org

7, 23, 47, 71, 199, 167, 191, 239, 383, 311, 431, 647, 479, 983, 887, 719, 839, 1031, 1487, 1439, 1151, 1847, 1319, 3023, 1511, 1559, 2711, 4463, 2591, 2399, 3863, 2351, 3527, 3719
Offset: 0

Views

Author

Keywords

Comments

Conjecture: a(n) < A002148(n) for all n >= 1. - Jianing Song, Jul 20 2022

References

  • D. A. Buell, Binary Quadratic Forms. Springer-Verlag, NY, 1989, pp. 224-241.
  • 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. A002147, A002148, A060651, A002143 (class numbers).

Programs

  • PARI
    a(n) = forprime(p=2, oo, if ((p % 8) == 7, if (qfbclassno(-p) == 2*n+1, return(p)))); \\ Michel Marcus, Jul 20 2022

A165951 a(n) = (Sum of the quadratic non-residues of prime(n) - Sum of the quadratic residues of prime(n)) / prime(n).

Original entry on oeis.org

0, 0, 0, 1, 1, 0, 0, 1, 3, 0, 3, 0, 0, 1, 5, 0, 3, 0, 1, 7, 0, 5, 3, 0, 0, 0, 5, 3, 0, 0, 5, 5, 0, 3, 0, 7, 0, 1, 11, 0, 5, 0, 13, 0, 0, 9, 3, 7, 5, 0, 0, 15, 0, 7, 0, 13, 0, 11, 0, 0, 3, 0, 3, 19, 0, 0, 3, 0, 5, 0, 0, 19, 9, 0, 3, 17, 0, 0, 0, 0, 9, 0, 21, 0, 15, 5, 0, 0, 0, 7, 7, 25, 7, 9, 3, 21, 0, 0
Offset: 1

Views

Author

Keywords

Comments

The positive terms are A002143 minus its first term (for p=3, A002143(1)=1 corresponds to 0 here). - Javier Múgica, Nov 23 2024

Crossrefs

Cf. allso A002143 (positive terms).

Formula

a(n) = Sum_{j=1..prime(n)-1} floor(j^2/prime(n)) - floor((prime(n)-2)*(prime(n)-1)/3) for n >= 3.
a(n) = A125616(n) - A076410(n) for n>=3.

Extensions

a(1)-a(2) added by Christopher Hunt Gribble, Oct 07 2009

A228131 a(n) = Sum_{i=0..n-1} K(i,n)*i, where K(,) is Kronecker symbol.

Original entry on oeis.org

0, 1, -1, 4, 0, 6, -7, 0, 27, 6, -11, -8, 0, 20, -30, 64, 0, -4, -19, 0, 0, 46, -69, -48, 250, 106, -9, 0, 0, 68, -93, 0, 0, 44, -70, 216, 0, 82, -156, 0, 0, 60, -43, -88, 0, 148, -235, -32, 1029, 94, -102, 0, 0, 6, -220, -224, 0, -82, -177, 0, 0, 168, -126, 1024, 0, 304, -67, 0, 0, 268, -497, 0, 0, 494, -50, -152, 0, 276, -395, 0, 2187, 4, -249, 0, 0, 310, -522, -176, 0, 388, -182, 0, 0, 424, -760, -192, 0, 202, 0, 2000
Offset: 1

Views

Author

Max Alekseyev, Aug 11 2013

Keywords

Comments

For prime n==1 (mod 4), a(n) = 0.
For prime n==3 (mod 4) and n>3, i.e., n=A002145(m) for m>1, a(n) = -n*A002143(m).

Crossrefs

Programs

  • Mathematica
    Table[Sum[KroneckerSymbol[k, n]*k, {k, 0, n - 1}], {n, 0, 50}] (* G. C. Greubel, Apr 23 2018 *)
  • PARI
    a(n) = sum(i=1,n-1, kronecker(i,n)*i)

A178153 Difference between the numbers of quadratic residues (mod p) less than p/2 and greater than p/2, where p=prime(n).

Original entry on oeis.org

1, 0, 1, 3, 0, 0, 3, 3, 0, 3, 0, 0, 3, 5, 0, 9, 0, 3, 7, 0, 5, 9, 0, 0, 0, 5, 9, 0, 0, 5, 15, 0, 9, 0, 7, 0, 3, 11, 0, 15, 0, 13, 0, 0, 9, 9, 7, 15, 0, 0, 15, 0, 21, 0, 13, 0, 11, 0, 0, 9, 0, 9, 19, 0, 0, 9, 0, 15, 0, 0, 19, 9, 0, 9, 17, 0, 0, 0, 0, 27, 0, 21, 0, 15, 15, 0, 0, 0, 7, 21, 25, 7, 27, 9, 21, 0
Offset: 2

Views

Author

T. D. Noe, May 21 2010

Keywords

Comments

When prime(n)=1 (mod 4), then a(n)=0. When prime(n)=3 (mod 4), then a(n)>0. When prime(n)=3 (mod 8) and prime(n)>3, then 3 divides a(n). See Borevich and Shafarevich. The nonzero terms of this sequence are closely related to A002143, the class number of primes p=3 (mod 4).
Same as difference between the numbers of quadratic residues and nonresidues (mod p) less than p/2, where p=prime(n). - Jonathan Sondow, Oct 30 2011

Examples

			The quadratic residues of 19, the 8th prime, are 1, 4, 5, 6, 7, 9, 11, 16, 17. Hence a(8)=6-3=3.
		

References

  • Z. I. Borevich and I. R. Shafarevich, Number Theory, Academic Press, NY, 1966, p. 346.
  • H. Davenport, Multiplicative Number Theory, Graduate Texts in Math. 74, 2nd ed., Springer, 1980, p. 51.

Crossrefs

Cf. A178154 (without the zero terms).

Programs

  • Maple
    A178153 := proc(n)
        local r,a,p;
        p := ithprime(n) ;
        a := 0 ;
        for r from 1 to p/2 do
            if numtheory[legendre](r,p) =1 then
                a := a+1 ;
            end if;
        end do:
        for r from ceil(p/2) to p-1 do
            if numtheory[legendre](r,p) =1 then
                a := a-1 ;
            end if;
        end do:
        a;
    end proc: # R. J. Mathar, Feb 10 2017
  • Mathematica
    Table[p=Prime[n]; Length[Select[Range[(p-1)/2], JacobiSymbol[ #,p]==1&]] - Length[Select[Range[(p+1)/2,p-1], JacobiSymbol[ #,p]==1&]], {n,2,100}]
    Table[p = Prime[n]; Sum[ JacobiSymbol[a, p], {a, 1, (p-1)/2}], {n, 2, 100}] (* Jonathan Sondow, Oct 30 2011 *)

Formula

a(n) = A178151(n) - A178152(n).
a(n) = sum(j=1..(p-1)/2, (j|p)), where p = prime(n) and (j|p) = +/-1 is the Legendre symbol. - Jonathan Sondow, Oct 30 2011

A255643 Difference between sums of quadratic residues and non-residues modulo n that are coprime to n.

Original entry on oeis.org

0, 1, -1, -2, 0, -4, -7, -14, -3, 0, -11, -22, 0, 0, -50, -44, 0, -12, -19, -60, -84, -44, -69, -94, 0, 0, -9, -98, 0, -80, -93, -152, -176, 0, -280, -138, 0, -76, -312, -300, 0, -126, -43, -286, -330, 0, -235, -332, -49, 0, -476, -364, 0, -36, -660, -602, -570, 0, -177, -380, 0, 0, -630, -560, -780, -374, -67, -680, -782, -560, -497, -714, 0, 0, -850, -798, -1232, -468, -395, -1080, -27, 0, -249, -882, -1360, -172, -1508, -1430, 0, -600, -1820, -1058, -1674, 0, -2090, -1240, 0, 0, -1518, -1100
Offset: 1

Views

Author

Max Alekseyev, Mar 01 2015

Keywords

Crossrefs

Programs

  • Maple
    f:= proc(n) local t;
      add(`if`(igcd(t,n)=1, t*numtheory:-quadres(t,n),0), t=1..n-1)
    end proc:
    map(f, [$1..100]); # Robert Israel, Feb 27 2025
  • PARI
    { A255643(n) = my(r); r=0; for(i=0,n-1, if(gcd(i,n)>1,next); if(issquare(Mod(i,n)), r+=i, r-=i) ); r }

Formula

For prime n, a(n) = A228131(n) = A255644(n).
For prime n==1 (mod 4), a(n) = 0.
For prime n==3 (mod 4) and n > 3, i.e., n=A002145(m) for m > 1, a(n) = -n*A002143(m).
Is 2 the only n for which a(n) > 0? - Robert Israel, Feb 27 2025

A255644 Difference between sums of quadratic residues and non-residues modulo n (residues are not necessarily coprime to n).

Original entry on oeis.org

0, 1, -1, -4, 0, 1, -7, -18, -12, 5, -11, -38, 0, -7, -45, -92, 0, -33, -19, -120, -70, -11, -69, -192, -50, 13, -99, -210, 0, -135, -93, -352, -198, 17, -245, -438, 0, -19, -325, -510, 0, -245, -43, -550, -540, -115, -235, -880, -196, -175, -459, -728, 0, -333, -715, -1036, -532, 29, -177, -1230, 0, -155, -1155, -1440, -780, -693, -67, -1292, -966, -875, -497, -1908, 0, 37, -1325, -1558, -1232, -1079, -395, -2500, -864, 41, -249, -2366, -1360, -43, -1479, -2552, 0, -2025, -1729, -2346, -1426, -423, -2185, -3568, 0, -637, -2673, -3000
Offset: 1

Views

Author

Max Alekseyev, Mar 01 2015

Keywords

Crossrefs

Programs

  • PARI
    { A255643(n) = my(r); r=0; for(i=0,n-1, if(issquare(Mod(i,n)), r+=i, r-=i) ); r }

Formula

For prime n, a(n) = A228131(n) = A255643(n).
For prime n==1 (mod 4), a(n) = 0.
For prime n==3 (mod 4) and n > 3, i.e., n=A002145(m) for m > 1, a(n) = -n*A002143(m).
Showing 1-10 of 14 results. Next