OFFSET
0,5
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..1274
FORMULA
From Andrew Howroyd, Sep 17 2017: (Start)
T(i, j) = 2 + Sum_{g=1..min(i,j)} floor(i/g) * floor(j/g) * mu(g) for i > 0, j > 0.
T(i, j) = signum(i) + signum(j) + A135646(i, j).
T(i, j) = |{(x, y): gcd(x, y) = 1, 0<=x<=i, 0<=y<=j}|.
(End)
EXAMPLE
The array begins:
0 1 1 1 1 ...
1 3 4 5 6 ...
1 4 5 7 8 ...
1 5 7 9 11 ...
1 6 8 11 13 ...
...
MATHEMATICA
a[0, 0] = 0; a[0, _] = a[_, 0] = 1; a[i_, j_] := Module[{slopes, cnt}, slopes = Union @ Flatten @ Table[k/h, {h, 1, i }, {k, 1, j }]; cnt[ slope_] := Count[Flatten[Table[{h, k}, {h, 1, i }, {k, 1, j }], 1], {h_, k_} /; k/h == slope]; Count[cnt /@ slopes, c_ /; c >= 1] + 2]; Table[a[i-j, j], {i, 0, 12}, {j, 0, i}] // Flatten (* Jean-François Alcover, Apr 03 2017 *)
PROG
(PARI)
T(i, j) = (i>0) + (j>0) + sum(g=1, min(i, j), (i\g) * (j\g) * moebius(g));
for (i=0, 10, for(j=0, 10, print1(T(i, j), ", ")); print); \\ Andrew Howroyd, Sep 17 2017
(PARI)
T(i, j) = sum(h=0, i, sum(k=0, j, gcd(h, k) == 1)); \\ Andrew Howroyd, Sep 17 2017
CROSSREFS
KEYWORD
AUTHOR
EXTENSIONS
More terms from Michael Somos
STATUS
approved