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 51 results. Next

A095010 Number of 8k+3 primes (A007520) in range [2^n,2^(n+1)].

Original entry on oeis.org

1, 0, 1, 1, 2, 3, 7, 10, 20, 35, 66, 113, 218, 412, 746, 1460, 2672, 5104, 9651, 18375, 35105, 67165, 128410, 246453, 473535, 911489, 1756670, 3390856, 6552449, 12673142, 24546849, 47583904, 92330578, 179317889, 348548185, 678029708, 1319939685, 2571409639
Offset: 1

Views

Author

Antti Karttunen and Labos Elemer, Jun 01 2004

Keywords

Crossrefs

Formula

a(n) = A095014(n) - A095011(n) = A095008(n) - A095012(n).

Extensions

a(34)-a(38) from Amiram Eldar, Jun 12 2024

A096633 Let p = n-th prime == 3 mod 8 (A007520); a(n) = smallest prime q such that p is not a square mod q.

Original entry on oeis.org

3, 3, 7, 5, 3, 5, 3, 3, 3, 7, 5, 3, 11, 3, 3, 5, 5, 13, 3, 13, 3, 3, 3, 3, 13, 5, 5, 3, 11, 3, 7, 5, 3, 3, 7, 11, 5, 7, 3, 7, 5, 5, 3, 3, 3, 11, 3, 5, 3, 19, 3, 3, 3, 7, 3, 3, 3, 7, 5, 3, 3, 7, 3, 11, 3, 5, 3, 7, 5, 5, 3, 3, 5, 3, 3, 3, 5, 3, 17, 3, 5, 3, 7, 13, 5, 3, 11, 3, 3, 5, 7, 3, 3, 5, 3, 7, 3, 7, 5, 3
Offset: 1

Views

Author

Robert G. Wilson v, Jun 24 2004

Keywords

Programs

  • Mathematica
    f[n_] := Block[{k = 2}, While[ JacobiSymbol[n, Prime[k]] == 1, k++ ]; Prime[k]]; f /@ Select[ Prime[ Range[435]], Mod[ #, 8] == 3 &]

A096638 Smallest prime p == 3 mod 8 (A007520) and p > prime(n+2) such that p is a quadratic residue mod the first n odd primes 3, 5, 7, 11, ..., prime(n+1), and p is a quadratic non-residue mod prime(n+2).

Original entry on oeis.org

11, 43, 19, 211, 331, 2011, 1171, 7459, 10651, 18379, 90931, 257371, 399499, 1234531, 6938779, 3574411, 14669251, 39803611, 102808099, 288710899, 322503091, 465390979, 1582819291, 2410622971, 505313251
Offset: 0

Views

Author

Robert G. Wilson v, Jun 24 2004

Keywords

Comments

Same as smallest prime p == 3 mod 8 with the property that the Legendre symbol (p|q) = 1 for the first n odd primes q = prime(k+1), k = 1, 2, ..., n, and (p|q) = -1 for q = prime(n+2).

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{k = 2}, While[ JacobiSymbol[n, Prime[k]] == 1, k++ ]; Prime[k]]; t = Table[0, {50}]; Do[p = Prime[n]; If[Mod[p, 8] == 3, a = f[p]; If[ t[[ PrimePi[a]]] == 0, t[[ PrimePi[a]]] = p; Print[ PrimePi[a], " = ", p]]], {n, 10^9}]; t

Extensions

Better name from Jonathan Sondow, Mar 07 2013

A186297 a(n) = (A007520(n)-1)/2.

Original entry on oeis.org

1, 5, 9, 21, 29, 33, 41, 53, 65, 69, 81, 89, 105, 113, 125, 141, 153, 165, 173, 189, 209, 221, 233, 245, 249, 261, 273, 281, 285, 293, 309, 321, 329, 341, 345, 369, 393, 405, 413, 429, 441, 453, 473, 485, 509, 525, 545, 561, 581, 585, 593
Offset: 1

Views

Author

Marco Matosic, Feb 17 2011

Keywords

Comments

a(n) = A055034(A007520(n)), n >= 1. This is the degree of the minimal polynomial C(A007520(n) ,x) of 2*cos(Pi/A007520(n)) (see A187360). a(n) is of course congruent 1 (mod 4). - Wolfdieter Lang, Oct 24 2013

Crossrefs

Formula

a(n) = A186296(n)-1.

A387128 First numbers A = a(n) of two numbers (A, B) such that the sums 2*A^2 + B^2 = p == 3 mod 8, where p = A007520(n) and B = A387129(n).

Original entry on oeis.org

1, 1, 3, 3, 5, 3, 1, 7, 5, 3, 9, 7, 9, 1, 11, 9, 3, 9, 13, 3, 13, 1, 11, 5, 15, 9, 3, 13, 15, 17, 15, 3, 17, 11, 9, 15, 9, 15, 7, 3, 21, 21, 19, 11, 17, 21, 1, 9, 19, 21, 7, 25, 23, 15, 17, 13, 19, 27, 27, 23, 1, 9, 5, 27, 7, 27, 17, 3, 21, 27, 23, 19, 3, 29, 31, 25, 27, 31, 9, 1, 27
Offset: 1

Views

Author

Vladimir Pletser, Aug 17 2025

Keywords

Comments

Prime numbers p congruent to 3 mod 8 can be written as the sum of twice the square of an integer A and of the square of another integer B, i.e., 2*A^2 + B^2 = p, where A = a(n), B = A387129(n), and p = A007520(n) == 3 mod 8.
This representation is unique, i.e., for a given n, there are no other integer values of A(n) and B(n) such that p(n) = 2 * A(n)^2 + B(n)^2 where p(n) = A007520(n), the 3 mod 8 prime numbers.
For all n, A = a(n) and B = A387129(n) are always odd.
Terms are ordered according to increasing order of A007520(n).

Examples

			1 belongs to the sequence as 2 * 1^2 + 1^2 = 3.
5 belongs to the sequence as 2 * 5^2 + 21^2 = 491.
		

References

  • Cartier P. "An Introduction to Zeta Functions", Chap 1.2, in eds. M. Waldschmidt, P. Moussa, J.M., Luck, C. Itzykson “From Number Theory to Physics”, Springer-Verlag, Berlin, pp. 22-41, 1960.
  • Conway J.H. and Guy R.K. "The Book of Numbers", Chap. 5, Springer-Verlag, New York, pp. 127-149, 1996.
  • Hardy, G. H. and Wright, E. M. "Primes in k(i)" and "The Fundamental Theorem of Arithmetic in k(i)." 12.7 and 12.8 in An Introduction to the Theory of Numbers, 5th ed. Oxford, England: Clarendon Press, pp. 183-187, 1979.
  • Sierpinski W. "Elementary Theory of Numbers", Chap. 13.3 and 13.4, ed. A Schinzel, North Holland, Amsterdam, pp. 459-462, 1988.

Crossrefs

Formula

2 * a(n)^2 + A387129(n)^2 = A007520(n).

A387129 Second numbers B = a(n) of two numbers (A, B) such that the sums 2*A^2 + B^2 = p == 3 mod 8, where p = A007520(n) and A = A387128(n).

Original entry on oeis.org

1, 3, 1, 5, 3, 7, 9, 3, 9, 11, 1, 9, 7, 15, 3, 11, 17, 13, 3, 19, 9, 21, 15, 21, 7, 19, 23, 15, 11, 3, 13, 25, 9, 21, 23, 17, 25, 19, 27, 29, 1, 5, 15, 27, 21, 13, 33, 31, 21, 17, 33, 3, 15, 29, 27, 33, 27, 1, 5, 21, 39, 37, 39, 11, 39, 13, 33, 41, 29, 17, 27, 33, 43, 15, 3, 27, 23, 9
Offset: 1

Views

Author

Vladimir Pletser, Aug 17 2025

Keywords

Comments

Prime numbers p congruent to 3 mod 8 can be written as the sum of twice the square of an integer A and of the square of another integer B, i.e., 2*A^2 + B^2 = p, where A = A387128(n), B = a(n) (this sequence), and p = A007520(n) == 3 mod 8.
This representation is unique, i.e., for a given n, there are no other integer values of A(n) and B(n) such that p(n) = 2 * A(n)^2 + B(n)^2 where p(n) = A007520(n), the 3 mod 8 prime numbers.
For all n, A = A387128(n) and B = a(n) are always odd.
Terms are ordered according to increasing order of A007520(n).

Examples

			1 belongs to the sequence as 2 * 1^2 + 1^2 = 3.
21 belongs to the sequence as 2 * 5^2 + 21^2 = 491.
		

References

  • Cartier P. "An Introduction to Zeta Functions", Chap 1.2, in eds. M. Waldschmidt, P. Moussa, J.M., Luck, C. Itzykson “From Number Theory to Physics”, Springer-Verlag, Berlin, pp. 22-41, 1960.
  • Conway J.H. and Guy R.K. "The Book of Numbers", Chap. 5, Springer-Verlag, New York, pp. 127-149, 1996.
  • Hardy, G. H. and Wright, E. M. "Primes in k(i)" and "The Fundamental Theorem of Arithmetic in k(i)." 12.7 and 12.8 in An Introduction to the Theory of Numbers, 5th ed. Oxford, England: Clarendon Press, pp. 183-187, 1979.
  • Sierpinski W. "Elementary Theory of Numbers", Chap. 13.3 and 13.4, ed. A Schinzel, North Holland, Amsterdam, pp. 459-462, 1988.

Crossrefs

Formula

2 * A387128(n)^2 + a(n)^2 = A007520(n).

A157115 Alternate terms of A007519, A007520, A007521, A007522.

Original entry on oeis.org

17, 3, 5, 7, 41, 11, 13, 23, 73, 19, 29, 31, 89, 43, 37, 47, 97, 59, 53, 71, 113, 67, 61, 79, 137, 83, 101, 103, 193, 107, 109, 127, 233, 131, 149, 151, 241, 139, 157, 167, 257, 163, 173, 191, 281, 179, 181, 199, 313, 211, 197, 223, 337, 227, 229, 239, 353, 251, 269
Offset: 1

Views

Author

Zak Seidov and N. J. A. Sloane, Feb 23 2009

Keywords

Comments

Or, read the following table by columns:
17,41,73,89,97,113,137,193,233,241,257,281,313,337,353,401,409,... (primes = = 1 mod 8)
3,11,19,43,59,67,83,107,131,139,163,179,211,227,251,283,307,331,... (primes == 3 mod 8)
5,13,29,37,53,61,101,109,149,157,173,181,197,229,269,277,293,317,... (primes == 5 mod 8)
7,23,31,47,71,79,103,127,151,167,191,199,223,239,263,271,311,359,... (primes == 7 mod 8)

Examples

			The first four primes congruent to (1,3,5,7) mod 8 are 17,3,5,7, hence a(1..4)=17,3,5,7;
The next four primes congruent to (1,3,5,7) mod 8 are 41,11,13,23, hence a(5..8)=41,11,13,23, etc.
		

Crossrefs

Programs

  • Mathematica
    s[i_]:=(c=0;a=2*i-1;Reap[Do[If[PrimeQ[a],c++;Sow[a]];If[c>99,Break[],a = a+8],{10^8}]][[2,1]]);Flatten[Transpose[Table[s[i],{i,4}]]]; (* Zak Seidov, Jan 16 2013 *)

A186296 ( A007520(n)+1 )/2.

Original entry on oeis.org

2, 6, 10, 22, 30, 34, 42, 54, 66, 70, 82, 90, 106, 114, 126, 142, 154, 166, 174, 190, 210, 222, 234, 246, 250, 262, 274, 282, 286, 294, 310, 322, 330, 342, 346, 370, 394, 406, 414, 430, 442, 454, 474, 486, 510, 526, 546, 562, 582, 586, 594
Offset: 1

Views

Author

Marco Matosic, Feb 17 2011

Keywords

Formula

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

A186298 A007520(n)-2.

Original entry on oeis.org

1, 9, 17, 41, 57, 65, 81, 105, 129, 137, 161, 177, 209, 225, 249, 281, 305, 329, 345, 377, 417, 441, 465, 489, 497, 521, 545, 561, 569, 585, 617, 641, 657, 681, 689, 737, 785, 809, 825, 857, 881, 905, 945, 969, 1017, 1049, 1089, 1121, 1161, 1169, 1185
Offset: 1

Views

Author

Marco Matosic, Feb 17 2011

Keywords

Programs

  • PARI
    isok(n) = isprime(n+2) && (n % 8 == 1) \\ Michel Marcus, Jul 16 2013

A106856 Primes of the form x^2 + xy + 2y^2, with x and y nonnegative.

Original entry on oeis.org

2, 11, 23, 37, 43, 53, 71, 79, 107, 109, 127, 137, 149, 151, 163, 193, 197, 211, 233, 239, 263, 281, 317, 331, 337, 373, 389, 401, 421, 431, 443, 463, 487, 491, 499, 541, 547, 557, 569, 599, 613, 617, 641, 653, 659, 673, 683, 739, 743, 751, 757, 809, 821
Offset: 1

Views

Author

T. D. Noe, May 09 2005, Apr 28 2008

Keywords

Comments

Discriminant=-7. Binary quadratic forms ax^2 + bxy + cy^2 have discriminant d = b^2 - 4ac.
Consider sequences of primes produced by forms with -100
The Mathematica function QuadPrimes2 is useful for finding the primes less than "lim" represented by the positive definite quadratic form ax^2 + bxy + cy^2 for any a, b and c satisfying a>0, c>0, and discriminant d<0. It does this by examining all x>=0 and y>=0 in the ellipse ax^2 + bxy + cy^2 <= lim. To find the primes generated by positive and negative x and y, compute the union of QuadPrimes2[a,b,c,lim] and QuadPrimes2[a,-b,c,lim]. - T. D. Noe, Sep 01 2009
For other programs see the "Binary Quadratic Forms and OEIS" link.

References

  • David A. Cox, Primes of the Form x^2 + n y^2, Wiley, 1989.
  • L. E. Dickson, History of the Theory of Numbers, Vol. 3, Chelsea, 1923.

Crossrefs

Discriminants in the range -3 to -100: A007645 (d=-3), A002313 (d=-4), A045373, A106856 (d=-7), A033203 (d=-8), A056874, A106857 (d=-11), A002476 (d=-12), A033212, A106858-A106861 (d=-15), A002144, A002313 (d=-16), A106862-A106863 (d=-19), A033205, A106864-A106865 (d=-20), A106866-A106869 (d=-23), A033199, A084865 (d=-24), A002476, A106870 (d=-27), A033207 (d=-28), A033221, A106871-A106874 (d=-31), A007519, A007520, A106875-A106876 (d=-32), A106877-A106881 (d=-35), A040117, A068228, A106882 (d=-36), A033227, A106883-A106888 (d=-39), A033201, A106889 (d=-40), A106890-A106891 (d=-43), A033209, A106282, A106892-A106893 (d=-44), A033232, A106894-A106900 (d=-47), A068229 (d=-48), A106901-A106904 (d=-51), A033210, A106905-A106906 (d=-52), A033235, A106907-A106913 (d=-55), A033211, A106914-A106917 (d=-56), A106918-A106922 (d=-59), A033212, A106859 (d=-60), A106923-A106930 (d=-63), A007521, A106931 (d=-64), A106932-A106933 (d=-67), A033213, A106934-A106938 (d=-68), A033246, A106939-A106948 (d=-71), A106949-A106950 (d=-72), A033212, A106951-A106952 (d=-75), A033214, A106953-A106955 (d=-76), A033251, A106956-A106962 (d=-79), A047650, A106963-A106965 (d=-80), A106966-A106970 (d=-83), A033215, A102271, A102273, A106971-A106974 (d=-84), A033256, A106975-A106983 (d=-87), A033216, A106984 (d=-88), A106985-A106989 (d=-91), A033217 (d=-92), A033206, A106990-A107001 (d=-95), A107002-A107008 (d=-96), A107009-A107013 (d=-99).
Other collections of quadratic forms: A139643, A139827.
For a more comprehensive list of sequences giving numbers and/or primes represented by binary quadratic forms, see the "Binary Quadratic Forms and OEIS" link.
Cf. also A242660.

Programs

  • Mathematica
    QuadPrimes2[a_, b_, c_, lmt_] := Module[{p, d, lst = {}, xMax, yMax}, d = b^2 - 4a*c; If[a > 0 && c > 0 && d < 0, xMax = Sqrt[lmt/a]*(1+Abs[b]/Floor[Sqrt[-d]])]; Do[ If[ 4c*lmt + d*x^2 >= 0, yMax = ((-b)*x + Sqrt[4c*lmt + d*x^2])/(2c), yMax = 0 ]; Do[p = a*x^2 + b*x*y + c*y^2; If[ PrimeQ[ p]  && p <= lmt && !MemberQ[ lst, p], AppendTo[ lst, p]], {y, 0, yMax}], {x, 0, xMax}]; Sort[ lst]];
    QuadPrimes2[1, 1, 2, 1000]
    (This is a corrected version of the old, incorrect, program QuadPrimes. - N. J. A. Sloane, Jun 15 2014)
    max = 1000; Table[yy = {y, 1, Floor[Sqrt[8 max - 7 x^2]/4 - x/4]}; Table[ x^2 + x y + 2 y^2, yy // Evaluate], {x, 0, Floor[Sqrt[max]]}] // Flatten // Union // Select[#, PrimeQ]& (* Jean-François Alcover, Oct 04 2018 *)
  • PARI
    list(lim)=my(q=Qfb(1,1,2), v=List([2])); forprime(p=2, lim, if(vecmin(qfbsolve(q, p))>0, listput(v,p))); Vec(v) \\ Charles R Greathouse IV, Aug 05 2016

Extensions

Removed old Mathematica programs - T. D. Noe, Sep 09 2009
Edited (pointed out error in QuadPrimes, added new version of program, checked and extended b-file). - N. J. A. Sloane, Jun 06 2014
Showing 1-10 of 51 results. Next