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-7 of 7 results.

A001132 Primes == +-1 (mod 8).

Original entry on oeis.org

7, 17, 23, 31, 41, 47, 71, 73, 79, 89, 97, 103, 113, 127, 137, 151, 167, 191, 193, 199, 223, 233, 239, 241, 257, 263, 271, 281, 311, 313, 337, 353, 359, 367, 383, 401, 409, 431, 433, 439, 449, 457, 463, 479, 487, 503, 521, 569, 577, 593, 599
Offset: 1

Views

Author

Keywords

Comments

Primes p such that 2 is a quadratic residue mod p.
Also primes p such that p divides 2^((p-1)/2) - 1. - Cino Hilliard, Sep 04 2004
A001132 is exactly formed by the prime numbers of A118905: in fact at first every prime p of A118905 is p = u^2 - v^2 + 2uv, with for example u odd and v even so that p - 1 = 4u'(u' + 1) + 4v'(2u' + 1 - v') when u = 2u' + 1 and v = 2v'. u'(u' + 1) is even and v'(2u' + 1 - v') is always even. At second hand if p = 8k +- 1, p has the shape x^2 - 2y^2; letting u = x - y and v = y, comes p = (x - y)^2 - y^2 + 2(x - y)y = u^2 - v^2 + 2uv so p is a sum of the two legs of a Pythagorean triangle. - Richard Choulet, Dec 16 2008
These are also the primes of form x^2 - 2y^2, excluding 2. See A038873. - Tito Piezas III, Dec 28 2008
Primes p such that p^2 mod 48 = 1. - Gary Detlefs, Dec 29 2011
Primes in A047522. - Reinhard Zumkeller, Jan 07 2012
This sequence gives the odd primes p which satisfy C(p, x = 0) = +1, where C(p, x) is the minimal polynomial of 2*cos(Pi/p) (see A187360). For the proof see a comment on C(n, 0) in A230075. - Wolfdieter Lang, Oct 24 2013
Each a(n) corresponds to precisely one primitive Pythagorean triangle. For a proof see the W. Lang link, also for a table. See also the comment by Richard Choulet above, where the case u even and v odd has not been considered. - Wolfdieter Lang, Feb 17 2015
Primes p such that p^2 mod 16 = 1. - Vincenzo Librandi, May 23 2016
Rational primes that decompose in the field Q(sqrt(2)). - N. J. A. Sloane, Dec 26 2017

References

  • Milton Abramowitz and Irene A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 870.
  • Ronald S. Irving, Integers, Polynomials, and Rings. New York: Springer-Verlag (2004): 274.
  • 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

For primes p such that x^m = 2 (mod p) has a solution see A001132 (for m = 2), A040028 (m = 3), A040098 (m = 4), A040159 (m = 5), A040992 (m = 6), A042966 (m = 7), A045315 (m = 8), A049596 (m = 9), A049542 (m = 10) - A049595 (m = 63). Jeff Lagarias (lagarias(AT)umich.edu) points out that all these sequences are different, although this may not be apparent from looking just at the initial terms.
Agrees with A038873 except for initial term.
Union of A007519 and A007522.

Programs

  • Haskell
    a001132 n = a001132_list !! (n-1)
    a001132_list = [x | x <- a047522_list, a010051 x == 1]
    -- Reinhard Zumkeller, Jan 07 2012
    
  • Magma
    [p: p in PrimesUpTo (600) | p^2 mod 16 eq 1]; // Vincenzo Librandi, May 23 2016
  • Maple
    seq(`if`(member(ithprime(n) mod 8, {1,7}),ithprime(n),NULL),n=1..109); # Nathaniel Johnston, Jun 26 2011
    for n from 1 to 600 do if (ithprime(n)^2 mod 48 = 1) then print(ithprime(n)) fi od. # Gary Detlefs, Dec 29 2011
  • Mathematica
    Select[Prime[Range[250]], MemberQ[{1, 7}, Mod[#, 8]] &]  (* Harvey P. Dale, Apr 29 2011 *)
    Select[Union[8Range[100] - 1, 8Range[100] + 1], PrimeQ] (* Alonso del Arte, May 22 2016 *)
  • PARI
    select(p->p%8==1 ||p%8==7, primes(100)) \\ Charles R Greathouse IV, May 18 2015
    

Formula

a(n) ~ 2n log n. - Charles R Greathouse IV, May 18 2015

A225949 Triangle for sum of the two legs (catheti) of primitive Pythagorean triangles.

Original entry on oeis.org

7, 0, 17, 23, 0, 31, 0, 41, 0, 49, 47, 0, 0, 0, 71, 0, 73, 0, 89, 0, 97, 79, 0, 103, 0, 119, 0, 127, 0, 113, 0, 137, 0, 0, 0, 161, 119, 0, 151, 0, 0, 0, 191, 0, 199, 0, 161, 0, 193, 0, 217, 0, 233, 0, 241, 167, 0, 0, 0, 239, 0, 263, 0, 0, 0, 287, 0, 217, 0, 257, 0, 289, 0, 313, 0, 329, 0, 337, 223, 0, 271, 0, 311, 0, 0, 0, 367, 0, 383, 0, 391
Offset: 2

Views

Author

Wolfdieter Lang, May 21 2013

Keywords

Comments

For primitive Pythagorean triples (x,y,z) see the Niven et al. reference, Theorem 5.5, p. 232, and the Hardy-Wright reference, Theorem 225, p. 190.
Here a(n,m) = 0 for non-primitive Pythagorean triangles.
There is a one-to-one correspondence between the values n and m of this number triangle for which a(n,m) does not vanish and primitive solutions of x^2 + y^2 = z^2 with y even, namely x = n^2 - m^2, y = 2*n*m and z = n^2 + m^2. The mirror triangles with x even are not considered here. Therefore a(n,m) = n^2 - m^2 + 2*n*m (for these solutions).
The number of non-vanishing entries in row n is A055034(n).
The sequence of the main diagonal is 2*n^2-1 = A056220(n), n>= 2.
The sequence of the main diagonal is j^2 + k^2 - 2 or 2*j*k if n>=2 and j = n + sqrt(2)/2 and k = n - sqrt(2)/2. - Avi Friedlich, Mar 30 2015
If the 0 entries are eliminated and the numbers are ordered increasingly (keeping multiple entries) the sequence becomes A198441(n-1), n>=2. If multiple entries are recorded only once this becomes A058529 (a proper subsequence of A118905). Note that all leg sums <= N are certainly reached if one considers rows n = 2, ..., floor(-1 + sqrt(N+2)).
a(n, m) also gives twice the member t(n, m) of the triple (r(n, m), s(n, m), t(n, m)) with squares r(n, m)^2, s(n, m)^2 and t(n, m)^2 in arithmetic progression with common difference A(n, m) = A249869(n, m), the area of the primitive Pythagorean triangle, or 0 if there is no such triangle. The other members are given by 2*r(n, m) = A278717(n, m) and 2*s(n, m) = A222946(n, m). See A278717 for details and the Keith Conrad reference. - Wolfdieter Lang, Nov 30 2016

Examples

			The triangle a(n,m) begins:
n\m   1   2   3   4   5   6    7    8    9   10   11 ...
2:    7
3:    0  17
4:   23   0  31
5:    0  41   0  49
6:   47   0   0   0  71
7:    0  73   0  89   0  97
8:   79   0 103   0 119   0  127
9:    0 113   0 137   0   0    0  161
10: 119   0 151   0   0   0  191    0  199
11:   0 161   0 193   0 217    0  233    0  241
12: 167   0   0   0 239   0  263    0    0    0  287
...
---------------------------------------------------------
The primitive triangle for (n,m) = (2,1) is (x,y,z) = (3,4,5), with a(2,1) = 3 + 4 = 7.
The primitive triangle for (n,m) = (7,4) is (x,y,z) = (33,56,65), with a(7,4) = 33 + 56 = 89.
The primitive triangle for (n,m) = (8,1) is (x,y,z) = (63,16,65), with a(8,1) = 63 + 16 = 79.
All primitive Pythagorean triangles with leg sums <= 167 are certainly covered by this triangle (rows n = 2..12), and the multiplicities are also correct, e.g., 119 appears twice.
		

References

  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, Fifth Edition, Clarendon Press, Oxford, 2003.
  • Ivan Niven, Herbert S. Zuckerman and Hugh L. Montgomery, An Introduction to the Theory Of Numbers, Fifth Edition, John Wiley and Sons, Inc., NY 1991.

Crossrefs

Cf. A222946 (hypotenuses), A222951 (perimeters), A056220 (main diagonals), A198441 (no zeros, ordered), A258149 (absolute leg differences), A278717 (leg differences).

Programs

  • Mathematica
    T[n_, m_] := If[n > m >= 1 && GCD[n, m] == 1 && (-1)^(n+m) == -1, (n+m)^2 - 2 m^2, 0];
    Table[T[n, m], {n, 2, 14}, {m, 1, n-1}] // Flatten (* Jean-François Alcover, Oct 22 2021 *)

Formula

a(n,m) = (n+m)^2 - 2*m^2 if n > m >= 1, gcd(n,m) = 1, and n and m are integers of opposite parity (i.e., (-1)^(n+m) = -1); otherwise a(n,m) = 0.

A120681 Sum of legs of primitive Pythagorean triangles sorted first on hypotenuse, then long leg.

Original entry on oeis.org

7, 17, 23, 31, 41, 47, 49, 73, 71, 89, 79, 103, 113, 97, 119, 137, 119, 151, 127, 161, 193, 167, 161, 191, 217, 239, 217, 199, 257, 233, 263, 223, 289, 271, 311, 241, 281, 313, 329, 287, 343, 287, 329, 367, 391, 401, 353, 431, 409, 337, 383, 457, 359, 463, 479
Offset: 1

Views

Author

Lekraj Beedassy, Jun 24 2006

Keywords

Comments

The prime numbers congruent to +1 or -1 modulo 8 of this sequence appear exactly once. For a proof see the W. Lang link under A001132. - Wolfdieter Lang, Feb 17 2015

Crossrefs

Programs

  • Mathematica
    A[s_Integer] := With[{s6 = StringPadLeft[ToString[s], 6, "0"]}, Cases[ Import["https://oeis.org/A" <> s6 <> "/b" <> s6 <> ".txt", "Table"], {, }][[All, 2]]];
    A046086 = A@046086;
    A046087 = A@046087;
    a[n_] := A046087[[n]] + A046086[[n]];
    a /@ Range[10000] (* Jean-François Alcover, Mar 07 2020 *)

Formula

a(n) = A046087(n) + A046086(n).

Extensions

Edited and corrected by Ray Chandler, Apr 10 2010

A331671 Number of Pythagorean triangles with sum of legs n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 2, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 2, 0, 0, 0, 1
Offset: 1

Views

Author

Ray Chandler, Feb 26 2020

Keywords

Crossrefs

A118903 Areas of rectangles with integer sides and diagonal.

Original entry on oeis.org

12, 48, 60, 108, 120, 168, 192, 240, 300, 360, 420, 432, 480, 540, 588, 660, 672, 768, 960, 972, 1008, 1080, 1092, 1200, 1260, 1440, 1452, 1500, 1512, 1680, 1728, 1848, 1920, 1980, 2028, 2160, 2352, 2448, 2640, 2688, 2700, 2772, 2940, 3000
Offset: 1

Views

Author

Giovanni Resta, May 05 2006

Keywords

Examples

			12 = 3*4 and 3^2+4^2=5^2.
		

Crossrefs

Formula

Twice A009112.

A082523 Number of times k^2 + (n-k)^2 is a square for 1 <= k <= n-1.

Original entry on oeis.org

0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 2, 2, 0, 4, 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 2, 2, 2, 2, 0, 2, 0, 0, 0, 2, 0, 2, 0, 0, 2, 0, 2, 2, 0, 0, 0
Offset: 2

Views

Author

CHAUVIN thierry (thierry.chauvin2(AT)wanadoo.fr), Apr 30 2003

Keywords

Comments

a(n) is not zero for n = 7, 14, 17, 21, 23, 28, ... : A118905. - Michel Marcus, Jun 09 2013

Crossrefs

Cf. A118905.

Programs

  • Magma
    [#[k:k in [1..n-1]|IsSquare(k^2+(n-k)^2)]:n in [2..90]]; // Marius A. Burtea, Jul 29 2019
  • Mathematica
    Table[Total[Boole[IntegerQ[Sqrt[#]]&/@Table[k^2+(n-k)^2,{k,n-1}]]],{n,2,90}] (* Harvey P. Dale, Aug 15 2017 *)
  • PARI
    a(n) = sum(k=1, n-1, issquare(k^2+(n-k)^2)) \\ Michel Marcus, Jun 09 2013
    

Extensions

Edited and extended by Michel Marcus, Jun 09 2013

A118904 Perimeters of rectangles with integer sides and diagonal.

Original entry on oeis.org

14, 28, 34, 42, 46, 56, 62, 68, 70, 82, 84, 92, 94, 98, 102, 112, 124, 126, 136, 138, 140, 142, 146, 154, 158, 164, 168, 170, 178, 182, 184, 186, 188, 194, 196, 204, 206, 210, 224, 226, 230, 238, 246, 248, 252, 254, 266, 272, 274, 276, 280, 282, 284, 292, 294
Offset: 1

Views

Author

Giovanni Resta, May 05 2006

Keywords

Examples

			14 = 2*(3+4) and 3^2+4^2=5^2.
		

Crossrefs

Formula

Twice A118905.
Showing 1-7 of 7 results.