A113704 Triangle read by rows. The indicator function for divisibility.
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, 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, 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
Offset: 0
Examples
Triangle begins 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, 0, 1;
References
- Tom M. Apostol, Introduction to Analytic Number Theory, Springer 1976, p. 14.
Links
- Wikipedia, Indicator function
Crossrefs
Programs
-
Maple
divides := (k, n) -> ifelse(k = n or (k > 0 and irem(n, k) = 0), 1, 0): A113704_row := n -> local k; seq(divides(k, n), k = 0..n): seq(print(A113704_row(n)), n = 0..9); # Peter Luschny, Jun 28 2023
-
Mathematica
Table[If[k==0,Boole[n==0],Boole[Divisible[n,k]]],{n,0,10},{k,0,n}] (* Gus Wiseman, Mar 06 2020 *)
-
SageMath
def A113704_row(n): return [int(k.divides(n)) for k in (0..n)] for n in (0..9): print(A113704_row(n)) # Peter Luschny, Jun 28 2023
-
SageMath
dim = 10 matrix(ZZ, dim, dim, lambda n, d: d <= n and ZZ(d).divides(ZZ(n))) # Peter Luschny, Jul 01 2023
Formula
Column k has g.f. 1/(1-x^k), k >= 1. Column 0 has g.f. 1.
T(n, d) = 1 if d > 0 and d|n, otherwise 0^n. - Gus Wiseman, Mar 06 2020
Extensions
Name edited by Peter Luschny, Jul 29 2023
Comments