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.

A195872 Positive integers a for which there is a (-1/2)-Pythagorean triple (a,b,c) satisfying a<=b.

Original entry on oeis.org

1, 2, 3, 4, 5, 5, 6, 6, 6, 7, 7, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 18, 18, 18, 19, 19, 19, 20, 20, 20, 21, 21, 21, 22, 22, 22, 22, 22, 23, 23, 23, 24, 24, 24, 25, 25, 26, 26, 26, 26
Offset: 1

Views

Author

Clark Kimberling, Sep 25 2011

Keywords

Comments

See A195770 for definitions of k-Pythagorean triple, primitive k-Pythagorean triple, and lists of related sequences.

Examples

			(-1/2)-Pythagorean triples:
1,2,2
2,4,4
3,6,6
4,8,8
5,48,47
(For primitive triples, see A195875.)
		

Crossrefs

Programs

  • Mathematica
    z8 = 800; z9 = 400; z7 = 100;
    k = -1/2; c[a_, b_] := Sqrt[a^2 + b^2 + k*a*b];
    d[a_, b_] := If[IntegerQ[c[a, b]], {a, b, c[a, b]}, 0]
    t[a_] := Table[d[a, b], {b, a, z8}]
    u[n_] := Delete[t[n], Position[t[n], 0]]
    Table[u[n], {n, 1, 15}]
    t = Table[u[n], {n, 1, z8}];
    Flatten[Position[t, {}]]
    u = Flatten[Delete[t, Position[t, {}]]];
    x[n_] := u[[3 n - 2]];
    Table[x[n], {n, 1, z7}]    (* A195872 *)
    y[n_] := u[[3 n - 1]];
    Table[y[n], {n, 1, z7}]    (* A195873 *)
    z[n_] := u[[3 n]];
    Table[z[n], {n, 1, z7}]    (* A195874 *)
    x1[n_] := If[GCD[x[n], y[n], z[n]] == 1, x[n], 0]
    y1[n_] := If[GCD[x[n], y[n], z[n]] == 1, y[n], 0]
    z1[n_] := If[GCD[x[n], y[n], z[n]] == 1, z[n], 0]
    f = Table[x1[n], {n, 1, z9}];
    x2 = Delete[f, Position[f, 0]]    (* A195875 *)
    g = Table[y1[n], {n, 1, z9}];
    y2 = Delete[g, Position[g, 0]]    (* A195876 *)
    h = Table[z1[n], {n, 1, z9}];
    z2 = Delete[h, Position[h, 0]]    (* A195877 *)