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

A024352 Numbers which are the difference of two positive squares, c^2 - b^2 with 1 <= b < c.

Original entry on oeis.org

3, 5, 7, 8, 9, 11, 12, 13, 15, 16, 17, 19, 20, 21, 23, 24, 25, 27, 28, 29, 31, 32, 33, 35, 36, 37, 39, 40, 41, 43, 44, 45, 47, 48, 49, 51, 52, 53, 55, 56, 57, 59, 60, 61, 63, 64, 65, 67, 68, 69, 71, 72, 73, 75, 76, 77, 79, 80, 81, 83, 84, 85, 87, 88, 89, 91, 92, 93, 95, 96
Offset: 1

Views

Author

Keywords

Comments

These are the solutions to the equation x^2 + xy = n where y mod 2 = 0, y is positive and x is any positive integer. - Andrew S. Plewe, Oct 19 2007
Ordered different terms of A120070 = 3, 8, 5, 15, 12, 7, ... (which contains two 15's, two 40's, and two 48's). Complement: A139544. (See A139491.) - Paul Curtz, Sep 01 2009
A024359(a(n)) > 0. - Reinhard Zumkeller, Nov 09 2012
If a(n) mod 6 = 3, n > 1, then a(n) = c^2 - f(a(n))^2 where f(n) = (floor(4*n/3) - 3 - n)/2. For example, 171 = 30^2 - 27^2 and f(171) = 27. - Gary Detlefs, Jul 15 2014

Crossrefs

Same as A042965 except for initial terms. - Michael Somos, Jun 08 2000
Different from A020884.

Programs

  • Haskell
    a024352 n = a024352_list !! (n-1)
    a024352_list = 3 : drop 4 a042965_list
    -- Reinhard Zumkeller, Nov 09 2012
    
  • Magma
    [3] cat [4 +Floor((4*n-3)/3): n in [2..100]]; // G. C. Greubel, Apr 22 2023
    
  • Mathematica
    Union[Flatten[Table[Select[Table[b^2 - c^2, {c, b-1}], # < 100 &], {b, 100}]]] (* Robert G. Wilson v, Jun 05 2004 *)
    LinearRecurrence[{1,0,1,-1},{3,5,7,8,9},70] (* Harvey P. Dale, Dec 20 2021 *)
  • PARI
    is(n)=(n%4!=2 && n>4) || n==3 \\ Charles R Greathouse IV, May 31 2013
    
  • Python
    def A024352(n): return 3 if n==1 else 3+(n<<2)//3 # Chai Wah Wu, Feb 10 2025
  • SageMath
    def A024352(n): return 4 + ((4*n-3)//3) - int(n==1)
    [A024352(n) for n in range(1,101)] # G. C. Greubel, Apr 22 2023
    

Formula

Consists of all positive integers except 1, 4 and numbers == 2 (mod 4).
a(n) = a(n-3) + 4, n > 4.
G.f.: (3 + 2*x + 2*x^2 - 2*x^3 - x^4)/(1 - x - x^3 + x^4). - Ralf Stephan, before May 13 2008
a(n) = a(n-1) + a(n-3) - a(n-4), for n > 5. - Ant King, Oct 03 2011
a(n) = 4 + floor((4*n-3)/3), n > 1. - Gary Detlefs, Jul 15 2014

Extensions

Edited by N. J. A. Sloane, Sep 19 2008

A139490 Numbers n such that the quadratic form x^2 + n*x*y + y^2 represents exactly the same primes as the quadratic form x^2 + m*y^2 for some m.

Original entry on oeis.org

1, 4, 6, 7, 8, 10, 14, 16, 18, 22, 26, 38, 58, 82, 86
Offset: 1

Views

Author

Artur Jasinski, Apr 24 2008, Apr 26 2008, Apr 27 2008

Keywords

Comments

For the numbers m see A139491.
Conjecture: This sequence is finite and complete (checked for range n<=200 and m<=500).
Three more terms were found by searching n <= 1000 and m <= 4000. The corresponding m are 840, 840, and 1848, which are idoneal numbers A000926. The sequence is probably complete now. [T. D. Noe, Apr 27 2009]

Examples

			a(1)=1 because the primes represented by x^2+xy+y^2 are the same as the primes represented by x^2 + 3*y^2 (see A007645).
The known pairs (n,m) are the following (checked for range n<=200 and m<=500):
n={1, 4, 4, 6, 6, 7, 8, 8, 10, 10, 10, 14, 14, 14, 16, 18, 22, 22, 26, 38, 38}
m={3, 9, 12, 8, 16, 15, 45, 60, 24, 48, 72, 24, 48, 72, 21, 40, 120, 240, 168, 120, 240}.
		

Crossrefs

Programs

  • Mathematica
    f = 200; g = 300; h = 30; j = 100; b = {}; Do[a = {}; Do[Do[If[PrimeQ[x^2 + n y^2], AppendTo[a, x^2 + n y^2]], {x, 0, g}], {y, 1, g}]; AppendTo[b, Take[Union[a], h]], {n, 1, f}]; Print[b]; c = {}; Do[a = {}; Do[Do[If[PrimeQ[n^2 + w*n*m + m^2], AppendTo[a, n^2 + w*n*m + m^2]], {n, m, g}], {m, 1, g}]; AppendTo[c, Take[Union[a], h]], {w, 1, j}]; Print[c]; bb = {}; cc = {}; Do[Do[If[b[[p]] == c[[q]], AppendTo[bb, p]; AppendTo[cc, q]], {p, 1, f}], {q, 1, j}]; Union[cc] (*Artur Jasinski*)

Extensions

Edited by N. J. A. Sloane, Apr 25 2008
Extended by T. D. Noe, Apr 27 2009
Typo fixed by Charles R Greathouse IV, Oct 28 2009

A139492 Primes of the form x^2 + 5x*y + y^2 for x and y nonnegative.

Original entry on oeis.org

7, 37, 43, 67, 79, 109, 127, 151, 163, 193, 211, 277, 331, 337, 373, 379, 421, 457, 463, 487, 499, 541, 547, 571, 613, 631, 673, 709, 739, 751, 757, 823, 877, 883, 907, 919, 967, 991, 1009, 1033, 1051, 1087, 1093, 1117, 1129, 1171, 1201, 1213, 1297, 1303
Offset: 1

Views

Author

Artur Jasinski, Apr 24 2008

Keywords

Comments

Reduced form is [1, 3, -3]. Discriminant = 21. Class number = 2.
Values of the quadratic form are {0, 1, 3, 4} mod 6, so this is a subsequence of A002476. - R. J. Mathar, Jul 30 2008
It can be checked that the primes p of the form x^2 + n*x*y + y^2, n >= 3, where x and y are nonnegative, depend on n mod 6 as follows: n mod 6 = 0 => p mod 12 = {1,5}; n mod 6 = 1 => p mod 12 = {1,7}; n mod 6 = 2 => p mod 12 = {1}; n mod 6 = 3 => p mod 12 = {1,5,7,11}; n mod 6 = 4 => p mod 12 = {1}; n mod 6 = 5 => p mod 12 = {1,7}. - Walter Kehowski, Jun 01 2008

Examples

			a(1) = 7 because we can write 7 = 1^2 + 5*1*1 + 1^2.
		

References

  • Z. I. Borevich and I. R. Shafarevich, Number Theory.
  • David A. Cox, "Primes of the Form x^2 + n y^2", Wiley, 1989.

Crossrefs

Primes in A243172.
For a list of sequences giving numbers and/or primes represented by binary quadratic forms, see the "Binary Quadratic Forms and OEIS" link.

Programs

  • Mathematica
    a = {}; w = 5; k = 1; Do[Do[If[PrimeQ[n^2 + w*n*m + k*m^2], AppendTo[a, n^2 + w*n*m + k*m^2]], {n, m, 400}], {m, 1, 400}]; Union[a]
  • Sage
    # uses[binaryQF]
    # The function binaryQF is defined in the link 'Binary Quadratic Forms'.
    Q = binaryQF([1, 5, 1])
    print(Q.represented_positives(1303, 'prime')) # Peter Luschny, May 12 2021

A139502 Primes of the form x^2 + 22x*y + y^2 for x and y nonnegative.

Original entry on oeis.org

241, 409, 601, 769, 1009, 1129, 1201, 1249, 1321, 1489, 1609, 1801, 2089, 2161, 2281, 2521, 2689, 3001, 3049, 3121, 3169, 3361, 3529, 3769, 3889, 4129, 4201, 4441, 4561, 4729, 4801, 4969, 5209, 5281, 5449, 5521, 5569, 5641, 5689, 5881, 6121, 6361, 6481
Offset: 1

Views

Author

Artur Jasinski, Apr 24 2008

Keywords

Comments

Also primes of the form x^2 + 120y^2. - T. D. Noe, Apr 29 2008
Also primes of the form x^2+240y^2. See A140633. - T. D. Noe, May 19 2008
In base 12, the sequence is 181, 2X1, 421, 541, 701, 7X1, 841, 881, 921, X41, E21, 1061, 1261, 1301, 13X1, 1561, 1681, 18X1, 1921, 1981, 1X01, 1E41, 2061, 2221, 2301, 2481, 2521, 26X1, 2781, 28X1, 2941, 2X61, 3021, 3081, 31X1, 3241, 3281, 3321, 3361, 34X1, 3661, 3821, 3901, where X is 10 and E is 11. Moreover, the discriminant is 340. - Walter Kehowski, Jun 01 2008

Crossrefs

Programs

  • Magma
    [ p: p in PrimesUpTo(7000) | p mod 120 in {1, 49}]; // Vincenzo Librandi, Jul 28 2012
  • Mathematica
    QuadPrimes2[1, 0, 120, 10000] (* see A106856 *)

Formula

The primes are congruent to {1, 49} (mod 120). - T. D. Noe, Apr 29 2008

A139544 Numbers which are not the difference of two squares of positive integers.

Original entry on oeis.org

1, 2, 4, 6, 10, 14, 18, 22, 26, 30, 34, 38, 42, 46, 50, 54, 58, 62, 66, 70, 74, 78, 82, 86, 90, 94, 98, 102, 106, 110, 114, 118, 122, 126, 130, 134, 138, 142, 146, 150, 154, 158, 162, 166, 170, 174, 178, 182, 186, 190, 194, 198, 202, 206, 210, 214, 218, 222, 226, 230
Offset: 1

Views

Author

Artur Jasinski, Apr 25 2008

Keywords

Comments

Conjecture: these numbers do not occur in A139491.
Complement sequence to A024352.
All odd numbers 2k+1 for k>0 can be represented by (k+1)^2-k^2. All multiples 4k for k>1 can be represented by (k+1)^2-(k-1)^2. No number of the form 4k+2 is the difference of two squares because, modulo 4, the differences of two squares are 0, 1, or 3. [T. D. Noe, Apr 27 2009]
A024359(a(n)) = 0. - Reinhard Zumkeller, Nov 09 2012

Crossrefs

Programs

  • Haskell
    a139544 n = a139544_list !! (n-1)
    a139544_list = 1 : 2 : 4 : tail a016825_list
    -- Reinhard Zumkeller, Nov 09 2012
    
  • Mathematica
    a[1] = 1; a[2] = 2; a[3] = 4; a[n_] := 4*n-10; Array[a, 60] (* Jean-François Alcover, May 27 2015 *)
  • PARI
    is(n)=n%4==2||n==1||n==4 \\ Charles R Greathouse IV, May 31 2013
    
  • Python
    def A139544(n): return 1<Chai Wah Wu, Feb 11 2025

Extensions

Corrected by T. D. Noe, Apr 27 2009

A139494 Primes of the form x^2 + 11x*y + y^2 for x and y nonnegative.

Original entry on oeis.org

13, 43, 61, 79, 103, 127, 139, 157, 181, 199, 211, 277, 283, 313, 337, 367, 373, 433, 439, 523, 547, 571, 601, 607, 673, 727, 751, 757, 823, 829, 859, 883, 907, 919, 937, 991, 997, 1039, 1063, 1069, 1093, 1117, 1153, 1171, 1213, 1231, 1249, 1291, 1297
Offset: 1

Views

Author

Artur Jasinski, Apr 24 2008

Keywords

Crossrefs

Programs

  • Mathematica
    a = {}; w = 11; k = 1; Do[Do[If[PrimeQ[n^2 + w*n*m + k*m^2], AppendTo[a, n^2 + w*n*m + k*m^2]], {n, m, 400}], {m, 1, 400}]; Union[a] (*Artur Jasinski*)

A139506 Primes of the form x^2 + 26x*y + y^2 for x and y nonnegative.

Original entry on oeis.org

193, 337, 457, 673, 1009, 1033, 1129, 1201, 1297, 1801, 1873, 2017, 2137, 2377, 2473, 2521, 2689, 2713, 2857, 3049, 3217, 3313, 3361, 3529, 3697, 3889, 4057, 4153, 4201, 4561, 4657, 4729, 4993, 5209, 5233, 5569, 5737, 5881, 6073, 6217, 6337, 6553, 6577
Offset: 1

Views

Author

Artur Jasinski, Apr 24 2008

Keywords

Comments

Also primes of the form x^2 + 168y^2. - T. D. Noe, Apr 29 2008
In base 12, the sequence is 141, 241, 321, 481, 701, 721, 7X1, 841, 901, 1061, 1101, 1201, 12X1, 1461, 1521, 1561, 1681, 16X1, 17X1, 1921, 1X41, 1E01, 1E41, 2061, 2181, 2301, 2421, 24X1, 2521, 2781, 2841, 28X1, 2X81, 3021, 3041, 3281, 33X1, 34X1, 3621, 3721, 3801, 3961, 3981, where X is 10 and E is 11. Moreover, the discriminant is 480. - Walter Kehowski, Jun 01 2008

Crossrefs

Programs

  • Mathematica
    a = {}; w = 26; k = 1; Do[Do[If[PrimeQ[n^2 + w*n*m + k*m^2], AppendTo[a, n^2 + w*n*m + k*m^2]], {n, m, 400}], {m, 1, 400}]; Union[a]

Formula

The primes are congruent to {1, 25, 121} (mod 168). - T. D. Noe, Apr 29 2008

A139512 Primes of the form x^2 + 32*x*y + y^2 for x and y nonnegative.

Original entry on oeis.org

229, 349, 409, 421, 661, 769, 829, 1021, 1069, 1249, 1381, 1429, 1549, 1789, 1801, 1861, 2089, 2161, 2269, 2389, 3001, 3061, 3109, 3181, 3229, 3469, 3889, 4021, 4129, 4201, 4441, 4861, 4909, 5101, 5449, 5521, 5869, 5881, 6121, 6469, 6481, 6529, 6781
Offset: 1

Views

Author

Artur Jasinski, Apr 24 2008

Keywords

Comments

Are all terms == 1 mod 12? - Zak Seidov, Apr 25 2008
Yes: (i) all terms == 1 mod 3 because the quadratic form has terms == {0,1} mod 3 and the values ==0 mod 3 are not primes. (ii) all terms == 1 mod 4 because the quadratic form has terms == {0,1,2} mod 4 and the values = {0,2} mod 4 are not primes. By the Chinese remainder constructions for coprime 3 and 4 all prime terms are == 1 mod 12. - R. J. Mathar, Jun 10 2020

Crossrefs

Programs

  • Mathematica
    a = {}; w = 32; k = 1; Do[Do[If[PrimeQ[n^2 + w*n*m + k*m^2], AppendTo[a, n^2 + w*n*m + k*m^2]], {n, m, 400}], {m, 1, 400}]; Union[a] (*Artur Jasinski*)

A139505 Primes of the form x^2 + 25x*y + y^2 for x and y nonnegative.

Original entry on oeis.org

151, 163, 307, 397, 409, 541, 547, 601, 673, 811, 823, 859, 967, 997, 1153, 1231, 1237, 1327, 1567, 1669, 1741, 1879, 2083, 2143, 2281, 2293, 2557, 2677, 2707, 2833, 2971, 3037, 3259, 3313, 3433, 3877, 4003, 4129, 4153, 4603, 4639, 4861, 4957, 5101, 5227
Offset: 1

Views

Author

Artur Jasinski, Apr 24 2008

Keywords

Crossrefs

Programs

  • Mathematica
    a = {}; w = 25; k = 1; Do[Do[If[PrimeQ[n^2 + w*n*m + k*m^2], AppendTo[a, n^2 + w*n*m + k*m^2]], {n, m, 400}], {m, 1, 400}]; Union[a] (*Artur Jasinski*)
    With[{nn=80},Select[Union[#[[1]]^2+25#[[1]]#[[2]]+#[[2]]^2&/@Tuples[ Range[ 0,nn],2]],PrimeQ[#]&&#Harvey P. Dale, Feb 10 2020 *)

A139493 Primes of the form x^2 + 9x*y + y^2 for x and y nonnegative.

Original entry on oeis.org

11, 23, 37, 53, 67, 71, 113, 137, 163, 179, 191, 317, 331, 379, 389, 401, 421, 443, 449, 463, 487, 499, 599, 617, 631, 641, 653, 683, 709, 751, 757, 823, 863, 883, 907, 911, 947, 977, 991, 1061, 1087, 1093, 1103, 1171, 1213, 1303, 1367, 1373, 1409, 1423
Offset: 1

Views

Author

Artur Jasinski, Apr 24 2008

Keywords

Comments

This is a member of the family of sequences of primes of the forms x^2 + kxy + y^2.
See for k=1 A007645 = x^2+3y^2, k=2 squares no primes, k=3 A038872, k=4 A068228 = x^2+9y^2, k=5 A139492, k=6 A007519 = x^2+8y^2, k=7 A033212 = x^2+15y^2, k=8 A107152 = x^2+45y^2, k=9 A139493, k=10 A107008 = x^2+24y^2, k=11 A139494, k=12 A139495, k=13 A139496, k=14* = 10 A107008 = x^2+24y^2, k=15 A139497, k=16 A033215 = x^2+21y^2, k=17 A139498, k=18 A107145 = x^2+40y^2, k=19 A139499, k=20 A139500, k=21 A139501, k=22 A139502, k=23 A139503, k=24 A139504, k=25 A139505, k=26,A139506, k=27 A139507, k=28 A139508, k=29 A139509, k=30 A139510, k=31 A139511, k=32 A139512

Crossrefs

Programs

  • Mathematica
    a = {}; w = 9; k = 1; Do[Do[If[PrimeQ[n^2 + w*n*m + k*m^2], AppendTo[a, n^2 + w*n*m + k*m^2]], {n, m, 400}], {m, 1, 400}]; Union[a] (*Artur Jasinski*)
Showing 1-10 of 24 results. Next