%I #29 Aug 29 2024 16:00:08
%S 0,0,0,1,0,1,2,1,1,2,3,2,3,2,3,4,3,4,4,3,4,5,4,6,6,6,4,5,6,5,7,8,8,7,
%T 5,6,7,6,9,9,11,9,9,6,7,8,7,10,12,12,12,12,10,7,8,9,8,12,13,16,14,16,
%U 13,12,8,9,10,9,13,15,17,18,18,17,15,13,9,10
%N Array T by antidiagonals; T(i,j) = number of lattice points (x,y) hidden from (i,j), where 0<=x<=i, 0<=y<=j; (x,y) is hidden if there is a lattice point (h,k) collinear with and between (x,y) and (i,j).
%C From _Robert Israel_, Jun 25 2015: (Start)
%C T(i,j) = number of (x,y) with 1 <= x <= i, 1 <= y <= j and gcd(x,y) > 1.
%C T(n,n) - T(n-1,n) = A062830(n) for x >= 2.
%C T(m+1,n+1) - T(m+1,n) - T(m,n+1) + T(m,n) = 1 if gcd(m+1,n+1) > 1, 0 otherwise. (End)
%H Ivan Neretin, <a href="/A049615/b049615.txt">Table of n, a(n) for n = 0..5049</a>
%e Antidiagonals (each starting on row 0):
%e {0};
%e {0,0};
%e {1,0,1};
%e ...
%e Array begins:
%e 0 0 1 2 3 4 5
%e 0 0 1 2 3 4 5
%e 1 1 3 4 6 7 9
%e 2 2 4 6 8 9 12
%e 3 3 6 8 11 12 16
%e 4 4 7 9 12 14 18
%e 5 5 9 12 16 18 23
%e ...
%p N := 20: # to get the first N*(N+1)/2 terms
%p T:= Array(1..N+1,1..N+1):
%p B:= Array(1..N+1,1..N+1, (i,j) -> `if`(igcd(i-1,j-1)>1,1,0)):
%p T[1,1..N+1]:= Statistics:-CumulativeSum(B[1,1..N+1]):
%p for i from 2 to N+1 do
%p T[i,1..N+1]:= T[i-1,1..N+1] + Statistics:-CumulativeSum(B[i,1..N+1])
%p od:
%p seq(seq(round(T[i+1,t-i+1]),i=0..t),t=0..N); # _Robert Israel_, Jun 25 2015
%p # alternative program _R. J. Mathar_, Oct 26 2015
%p A049615 := proc(n,k)
%p local a,x,y;
%p a := 0 ;
%p for x from 0 to n do
%p for y from 0 to k do
%p if igcd(x,y) > 1 then
%p a := a+1 ;
%p end if;
%p end do:
%p end do:
%p a;
%p end proc:
%p seq(seq(A049615(d-k,k),k=0..d),d=0..10) ;
%t Table[Length[Select[Flatten[Table[{x, y}, {x, 0, n - k}, {y, 0, k}], 1], GCD @@ # > 1 &]], {n, 0, 11}, {k, 0, n}] // Flatten (* _Ivan Neretin_, Jun 25 2015 *)
%o (PARI) T(n,k) = sum(i=0, n, sum(j=0, k, gcd(i,j)>1));
%o tabl(7, 7, n, k, T(n-1, k-1)) \\ _Michel Marcus_, Aug 06 2021
%Y Cf. A032766, A062830.
%K nonn,tabl
%O 0,7
%A _Clark Kimberling_