%I #26 Aug 01 2019 03:49:43
%S 2,5,7,9,12,14,16,20,23,25,27,29,31,33,35,38,40,44,46,48,52,54,57,59,
%T 61,63,65,67,71,73,77,80,82,84,86,88,90,92,94,96,100,102,104,107,109,
%U 113,119,121,123,125,127,129,131,133,135,138,140
%N Position within the triangular array A226314(n)/A054531(n) of rationals x/y such that x < y, gcd(x,y)=1 and x+y odd.
%C If {x,y} are used as the generators of primitive Pythagorean triples (a,b,c) where a=y^2-x^2, b=2x*y and c=x^2+y^2, then the above sequence enumerates all PPT's as a 1-to-1 mapping into the integers.
%H Frank M Jackson, <a href="/A243808/b243808.txt">Table of n, a(n) for n = 1..57</a>
%H Lance Fortnow, <a href="http://blog.computationalcomplexity.org/2004/03/counting-rationals-quickly.html">Counting the Rationals Quickly</a>, Computational Complexity Weblog, Monday, March 01, 2004.
%H Yoram Sagher, <a href="http://www.jstor.org/stable/2324846">Counting the rationals</a>, Amer. Math. Monthly, 96 (1989), p. 823. Math. Rev. 90i:04001.
%e . j {A226314(n),A054531(n)}, 1<=i<=j<=12 and n=i+j(j-1)/2
%e . -- ------------------------------------------------------------
%e . 1: 1,1
%e . 2: 1,2 2,1
%e . 3: 1,3 2,3 3,1
%e . 4: 1,4 3,2 3,4 4,1
%e . 5: 1,5 2,5 3,5 4,5 5,1
%e . 6: 1,6 4,3 5,2 5,3 5,6 6,1
%e . 7: 1,7 2,7 3,7 4,7 5,7 6,7 7,1
%e . 8: 1,8 5,4 3,8 7,2 5,8 7,4 7,8 8,1
%e . 9: 1,9 2,9 7,3 4,9 5,9 8,3 7,9 8,9 9,1
%e . 10: 1,10 6,5 3,10 7,5 9,2 8,5 7,10 9,5 9,10 10,1
%e . 11: 1,11 2,11 3,11 4,11 5,11 6,11 7,11 8,11 9,11 10,11 11,1
%e . 12: 1,12 7,6 9,4 10,3 5,12 11,2 7,12 11,3 11,4 11,6 11,12 12,1 .
%e a(4)=9, as the 4th PPT is generated from the 9th term of the triangular array at index (3,4). This gives (x,y) as (3,4) and it generates the PPT (7,24,25). Conversely the PPT (7,24,25) gives (x,y) = (sqrt((25-7)/2), sqrt((25+7)/2)=(3,4). It is the 9th term of the triangular array and the 4th term of the enumerating sequence.
%t ratmap[p_, q_] := (q(q-1)/2+p); mm=20; lst={}; Do[If[OddQ[m+n]&&GCD[m, n]==1, AppendTo[lst, n/m]], {m, 1, mm}, {n, 1, m}]; Sort@Table[ratmap[Numerator[lst[[k]]], Denominator[lst[[k]]]], {k, 1, Length[lst]}]
%Y Cf. A054531, A169581, A226314.
%K nonn
%O 1,1
%A _Frank M Jackson_, Jun 13 2014
|