OFFSET
1,1
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
LINKS
Wikipedia, Cantor's pairing function, and Pythagorean triple
EXAMPLE
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
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]}]
PROG
(Scheme, with Antti Karttunen's IntSeq-library)
(define A277557 (MATCHING-POS 1 1 (lambda (n) (let ((x (A025581 n)) (y (A002262 n))) (and (not (zero? x)) (< x y) (odd? (+ x y)) (= 1 (gcd x y))))))) ;; Antti Karttunen, Nov 02 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Frank M Jackson, Oct 19 2016
STATUS
approved