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.

A113704 Triangle read by rows. The indicator function for divisibility.

This page as a plain text file.
%I A113704 #44 Apr 23 2025 16:54:39
%S A113704 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 A113704 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 A113704 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 A113704 Triangle read by rows. The indicator function for divisibility.
%C A113704 From _Peter Luschny_, Jul 01 2023: (Start)
%C A113704 Definition: d divides n <=> n = m*d for some m.
%C A113704 Equivalently, d divides n iff d = n or d > 0, and the integer remainder of n divided by d is 0.
%C A113704 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 A113704 (End)
%D A113704 Tom M. Apostol, Introduction to Analytic Number Theory, Springer 1976, p. 14.
%H A113704 Wikipedia, <a href="https://en.wikipedia.org/wiki/Indicator_function">Indicator function</a>
%F A113704 Column k has g.f. 1/(1-x^k), k >= 1. Column 0 has g.f. 1.
%F A113704 T(n, d) = 1 if d > 0 and d|n, otherwise 0^n. - _Gus Wiseman_, Mar 06 2020
%e A113704 Triangle begins
%e A113704   1;
%e A113704   0, 1;
%e A113704   0, 1, 1;
%e A113704   0, 1, 0, 1;
%e A113704   0, 1, 1, 0, 1;
%e A113704   0, 1, 0, 0, 0, 1;
%e A113704   0, 1, 1, 1, 0, 0, 1;
%e A113704   0, 1, 0, 0, 0, 0, 0, 1;
%p A113704 divides := (k, n) -> ifelse(k = n or (k > 0 and irem(n, k) = 0), 1, 0):
%p A113704 A113704_row := n -> local k; seq(divides(k, n), k = 0..n):
%p A113704 seq(print(A113704_row(n)), n = 0..9);  # _Peter Luschny_, Jun 28 2023
%t A113704 Table[If[k==0,Boole[n==0],Boole[Divisible[n,k]]],{n,0,10},{k,0,n}] (* _Gus Wiseman_, Mar 06 2020 *)
%o A113704 (SageMath)
%o A113704 def A113704_row(n): return [int(k.divides(n)) for k in (0..n)]
%o A113704 for n in (0..9): print(A113704_row(n))  # _Peter Luschny_, Jun 28 2023
%o A113704 (SageMath)
%o A113704 dim = 10
%o A113704 matrix(ZZ, dim, dim, lambda n, d: d <= n and ZZ(d).divides(ZZ(n)))  # _Peter Luschny_, Jul 01 2023
%Y A113704 Cf. A051731, A113705 (reversed rows concatenated).
%Y A113704 Cf. A000005 (row sums), A000007, A000961, A007947, A057427, A126988, A363914 (inverse triangle).
%K A113704 easy,nonn,tabl
%O A113704 0,1
%A A113704 _Paul Barry_, Nov 05 2005
%E A113704 Name edited by _Peter Luschny_, Jul 29 2023