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

A224921 Number of Pythagorean triples (a, b, c) with a^2 + b^2 = c^2 and 0 < a < b < c < n.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 6, 8, 9, 9, 9, 10, 11, 11, 11, 11, 12, 13, 13, 14, 14, 15, 16, 17, 17, 17, 17, 18, 18, 18, 18, 18, 20, 21, 22, 23, 23, 24, 24, 24, 25, 25, 26, 27, 27, 27, 27, 31, 31, 31, 32, 32, 33, 33, 33
Offset: 1

Views

Author

Reiner Moewald, Apr 19 2013

Keywords

Comments

a(n+1) > a(n) iff n is in A009003. - Benoit Cloitre, Dec 08 2021

Crossrefs

Cf. A156685. Essentially partial sums of A046080.
Cf. A009003.

Programs

  • Maple
    a046080:= proc(n) local F,t;
      F:= select(t -> t[1] mod 4 = 1, ifactors(n)[2]);
      1/2*(mul(2*t[2]+1, t=F)-1)
    end proc:
    ListTools:-PartialSums(map(a046080, [$0..100])); # Robert Israel, Jul 18 2016
  • Mathematica
    b[0] = b[1] = 0; b[n_] := With[{fi = Select[FactorInteger[n], Mod[#[[1]], 4] == 1&][[All, 2]]}, (Times @@ (2*fi + 1) - 1)/2];
    Table[b[n], {n, 0, 100}] // Accumulate (* Jean-François Alcover, Feb 27 2019 *)
  • PARI
    a(n)=sum(a=1,n-3,sum(b=a+1,sqrtint((n-1)^2-a^2), issquare(a^2+b^2))) \\ Charles R Greathouse IV, Apr 29 2013

A277557 The ordered image of the 1-to-1 mapping of an integer ordered pair (x,y) into an integer using Cantor's pairing function, where 0 < x < y, gcd(x,y)=1 and x+y odd.

Original entry on oeis.org

8, 18, 19, 32, 33, 34, 50, 52, 53, 72, 73, 74, 75, 76, 98, 99, 100, 101, 102, 103, 128, 131, 133, 134, 162, 163, 164, 165, 166, 167, 168, 169, 200, 201, 202, 203, 204, 205, 206, 207, 208, 242, 244, 247, 248, 250, 251, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 338
Offset: 1

Views

Author

Frank M Jackson, Oct 19 2016

Keywords

Comments

The mapping of the ordered pair (x,y) to an integer uses Cantor's pairing function to generate the integer as (x+y)(x+y+1)/2+y. Also for every ordered pair (x,y) such that 0 < x < y, gcd(x,y)=1 and x+y odd, there exists a primitive Pythagorean triple (PPT) (a, b, c) such that a = y^2-x^2, b = 2xy, c = x^2+y^2. Therefore each term in the sequence represents a unique PPT.
Numbers n for which 0 < A025581(n) < A002262(n) and A025581(n)+A002262(n) is odd, and gcd(A025581(n), A002262(n)) = 1. [The definition expressed with A-numbers.] - Antti Karttunen, Nov 02 2016
See also the triangle T(y, x) with the values for PPTs given in A278147. - Wolfdieter Lang, Nov 24 2016

Examples

			a(5)=33 because the ordered pair (2,5) maps to 33 by Cantor's pairing function (see below) and is the 5th such occurrence. Also x=2, y=5 generates a PPT with sides (21,20,29).
Note: Cantor's pairing function is simply A001477 in its two-argument tabular form A001477(k, n) = n + (k+n)*(k+n+1)/2, thus A001477(2,5) = 5 + (2+5)*(2+5+1)/2 = 33. - _Antti Karttunen_, Nov 02 2016
		

Crossrefs

Cf. A020882 (is obtained when A048147(a(n)) is sorted into ascending order), A008846 (same with duplicates removed).

Programs

  • Mathematica
    Cantor[{i_, j_}] := (i+j)(i+j+1)/2+j; getparts[n_] := Reverse@Select[Reverse[IntegerPartitions[n, {2}], 2], GCD@@#==1 &]; pairs=Flatten[Table[getparts[2n+1], {n, 1, 20}], 1]; Table[Cantor[pairs[[n]]], {n, 1, Length[pairs]}]

A383181 Family of 2-colorings of {1..7824} with no monochromatic Pythagorean triples.

Original entry on oeis.org

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

Views

Author

David Dewan, Apr 18 2025

Keywords

Comments

We use the codes: 1=red, 2=blue, 0=unconstrained (may be red or blue).
Choose any Pythagorean triangle (r,s,t) with t<=7824, then a(r), a(s), a(t) cannot all be the same color (see Examples).
Solution and proof by Heule, Kullmann, and Marek (2016).
Because each of the 2899 numbers for which a(n)=0 can be independently colored red or blue, this sequence represents 2^2899 unique 2-colorings with no monochromatic Pythagorean triples.
There is no 2-coloring of {1..7825} with no monochromatic Pythagorean triples.

Examples

			The triple (5,12,13) is not monochromatic:
  a(5)= 1 red,
  a(12)=2 blue,
  a(13)=2 blue.
The triple (3,4,5) is not monochromatic whether 4 is red or blue:
  a(3)=2 blue,
  a(4)=0 red or blue,
  a(5)=1 red.
		

Crossrefs

Showing 1-3 of 3 results.