%I #39 Jul 29 2023 17:37:19
%S 1,0,1,0,1,1,0,1,0,1,0,1,1,0,1,0,1,0,0,0,1,0,1,1,1,0,0,1,0,1,0,0,0,0,
%T 0,1,0,1,1,0,1,0,0,0,1,0,1,0,1,0,0,0,0,0,1,0,1,1,0,0,1,0,0,0,0,1,0,1,
%U 0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1
%N Triangle read by rows. The indicator function for divisibility.
%C From _Peter Luschny_, Jul 01 2023: (Start)
%C Definition: d divides n <=> n = m*d for some m.
%C Equivalently, d divides n iff d = n or d > 0, and the integer remainder of n divided by d is 0.
%C This definition is sufficient to define the infinite lower triangular array, i.e., if we consider only the range 0 <= d <= n. But see the construction of the inverse square array in A363914, which has to make this restriction explicit because with the above definition every integer divides 0, and thus the first row of the square matrix becomes 1 for all d.
%C (End)
%D Tom M. Apostol, Introduction to Analytic Number Theory, Springer 1976, p. 14.
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Indicator_function">Indicator function</a>
%F Column k has g.f. 1/(1-x^k), k >= 1. Column 0 has g.f. 1.
%F T(n,d) = 1 if d|n, otherwise 0. - _Gus Wiseman_, Mar 06 2020
%e Triangle begins
%e 1;
%e 0, 1;
%e 0, 1, 1;
%e 0, 1, 0, 1;
%e 0, 1, 1, 0, 1;
%e 0, 1, 0, 0, 0, 1;
%e 0, 1, 1, 1, 0, 0, 1;
%e 0, 1, 0, 0, 0, 0, 0, 1;
%p divides := (k, n) -> ifelse(k = n or (k > 0 and irem(n, k) = 0), 1, 0):
%p A113704_row := n -> local k; seq(divides(k, n), k = 0..n):
%p seq(print(A113704_row(n)), n = 0..9); # _Peter Luschny_, Jun 28 2023
%t Table[If[k==0,Boole[n==0],Boole[Divisible[n,k]]],{n,0,10},{k,0,n}] (* _Gus Wiseman_, Mar 06 2020 *)
%o (SageMath)
%o def A113704_row(n): return [int(k.divides(n)) for k in (0..n)]
%o for n in (0..9): print(A113704_row(n)) # _Peter Luschny_, Jun 28 2023
%o (SageMath)
%o dim = 10
%o matrix(ZZ, dim, dim, lambda n, d: d <= n and ZZ(d).divides(ZZ(n))) # _Peter Luschny_, Jul 01 2023
%Y Cf. A051731, A113705 (reversed rows concatenated).
%Y Cf. A000005 (row sums), A000007, A000961, A007947, A057427, A126988, A363914 (inverse triangle).
%K easy,nonn,tabl
%O 0,1
%A _Paul Barry_, Nov 05 2005
%E Name edited by _Peter Luschny_, Jul 29 2023