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.

A277632 The ordered integer image of the 1-to-1 mapping of primitive Heronian triples (PHT) into the integers using Cantor's pairing function for triples (N^3 -> N).

Original entry on oeis.org

1381, 2931, 5156, 58658, 70135, 79012, 89680, 106966, 152084, 171416, 197522, 212885, 266098, 295306, 400078, 434790, 675720, 789403, 863969, 866606, 917338, 936413, 1085618, 1149892, 1242687, 1432297, 1628115, 2116668, 2241911, 2250397, 2418925, 2694694, 2699343, 3022126, 3036895, 3059130
Offset: 1

Views

Author

Frank M Jackson, Oct 24 2016

Keywords

Comments

This mapping of the Heronian triple (a,b,c) to an integer is unique and uses Cantor's pairing function K(i,j) = (i+j)(i+j+1)/2+j so that (a,b,c) -> K(K(a,b),c). The table of PHT's used to generate the sequence was obtained from lists generated by Sascha Kurz (see Link). The list contains a triple for every possible PHT with a maximum side length of 10000. The triples are in the form (a,b,c) where a >= b >= c and where a <= 10000.

Examples

			A PHT with sides (a,b,c) = (21,20,13) maps to K(K(21,20),13) = K(881,13) = 400078 = a(15), where Cantor's pairing function K is simply A001477 in its two-argument tabular form A001477(k, n) = n + (k+n)*(k+n+1)/2.
A PHT with sides (a,b,c) = (29,21,20) maps to K(K(29,21),20) = 866606 = a(20). This is a primitive Pythagorean triangle (thus also a primitive Heronian triangle), listed as term a(5)=33 in A277557.
		

Crossrefs

Programs

  • Mathematica
    Cantor[i_, j_] := (i+j)(i+j+1)/2+j; nn=50; lst1=ReadList["C:/primitive_heronian_triangles_1_10000.txt", {Number, Number, Number}]; lst2=Select[lst1, #[[1]]<=2 nn &]; lst={}; Do[({a, b, c}=lst2[[n]]; k=Cantor[Cantor[a, b], c]; AppendTo[lst, k]), {n, 1, Length[lst2]}]; Sort[Select[lst, #
    				

A278147 Triangle read by rows of Cantor pairing function value determining primitive Pythagorean triangles or 0 if there is no such triangle.

Original entry on oeis.org

8, 0, 18, 19, 0, 32, 0, 33, 0, 50, 34, 0, 0, 0, 72, 0, 52, 0, 73, 0, 98, 53, 0, 74, 0, 99, 0, 128, 0, 75, 0, 100, 0, 0, 0, 162, 76, 0, 101, 0, 0, 0, 163, 0, 200, 0, 102, 0, 131, 0, 164, 0, 201, 0, 242, 103, 0, 0, 0, 165, 0, 202, 0, 0, 0, 288, 0, 133, 0, 166, 0, 203, 0, 244, 0, 289, 0, 338, 134, 0, 167, 0, 204
Offset: 2

Views

Author

Wolfdieter Lang, Nov 21 2016

Keywords

Comments

This entry is inspired by the increasingly ordered nonvanishing entries given in A277557.
A primitive Pythagorean triangle is characterized by the pair [n,m], 1 <= m < n, GCD(n,m) = 1 and n+m is odd. The present triangle gives the values T(n, m) = Cantor(m,n) where Cantor(x,y) = (x+y)*(x+y+1)/2 + y. See A277557, also for links.
Because the Cantor pairing function N x N -> N is bijective (N = positive integers), all nonzero entries of this triangle appear only once, but here not all positive integers appear.
Note that in this triangle in each row the nonvanishing entries increase, but in the first rows up to some n not all T(n, m) values smaller than T(n,n-1) are covered.
For the area values of primitive Pythagorean triangles see the table A249869 also for comments on these triangles and references.

Examples

			The triangle begins:
n\m  1   2   3   4   5   6   7   8   9  10...
2:  8
3:  0   18
4:  19   0  32
5:   0  33   0  50
6:  34   0   0   0  7272
7:   0  52   0  73   0  98
8:  53   0  74   0  99   0 128
9:   0  75   0 100   0   0   0 162
10: 76   0 101   0   0   0 163   0 200
11:  0 102   0 131   0 164   0 201   0 242
...
n = 12: 103 0 0 0 165 0 202 0 0 0 288,
n = 13: 0 133 0 166 0 203 0 244 0 289 0 338,
n = 14: 134 0 167 0 204 0 0 0 290 0 339 0 392,
n = 15: 0 168 0 205 0 0 0 291 0 0 0 0 0 450.
...
T(3,1) = 0 because 3+1 =4 is even.
T(4,2) = 0 because GCD(4,2) = 2 > 1.
T(3,2) = (2+3)*(2+3)/2 + 3 = 5*3 + 3 = 18.
...
In order to reach all values T(n,m) <= 50 one has to take rows n = 2..6.
...
		

Crossrefs

Formula

T(n, m) = (m+n)*(m+n+1)/2 + n, n >= 2, m = 1, 2, ..., n-1, and 0 if GCD(n,m) > 1 or n+m is even.

A337308 Natural numbers that yield a coprime pair representing a proper fraction under the inverse of Cantor's pairing function.

Original entry on oeis.org

8, 13, 18, 19, 26, 32, 33, 34, 41, 43, 50, 52, 53, 62, 64, 72, 73, 74, 75, 76, 85, 89, 98, 99, 100, 101, 102, 103, 114, 116, 118, 128, 131, 133, 134, 145, 147, 149, 151, 162, 163, 164, 165, 166, 167, 168, 169, 182, 184, 188, 200, 201, 202, 203, 204, 205, 206
Offset: 1

Views

Author

Alexander Fraebel, Aug 22 2020

Keywords

Comments

Equivalently: The image of the function f(x,y)=(x+y)*(x+y+1)/2+y for x,y coprime and 0 < x < y.

Examples

			The fully reduced proper fraction 2/5 is mapped to 33 by Cantor's pairing function.
		

Crossrefs

Superset of A277557.

Programs

  • Python
    # Edited by M. F. Hasler, Mar 25 2023
    from math import gcd
    def A337308_first(N):
        L, b = [], 0
        f = lambda a: (a + b) * (a + b + 1) // 2 + b
        while N > 0:
            b += 1
            if len(L) > 1:
                L.sort()
                while L and L[0] < f(1):
                    yield L.pop(0)
                    N -= 1
            L.extend(f(a) for a in range(1, b) if gcd(a, b) == 1)
    print(list(A337308_first(50)))
Showing 1-3 of 3 results.