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.

A049687 Array T read by diagonals: T(i,j)=number of lines passing through (0,0) and at least one other lattice point (h,k) satisfying 0<=h<=i, 0<=k<=j.

Original entry on oeis.org

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

Views

Author

Keywords

Examples

			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 ...
...
		

Crossrefs

Main diagonal is A049691.

Programs

  • 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 *)
  • 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

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)

Extensions

More terms from Michael Somos