login
Triangle read by rows. The indicator function for prime divisors, the Euclid matrix.
1

%I #12 Aug 05 2023 21:22:00

%S 0,0,0,0,0,1,0,0,0,1,0,0,1,0,0,0,0,0,0,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,

%T 0,1,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,

%U 0,0,0,0,0,0,0,0,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0

%N Triangle read by rows. The indicator function for prime divisors, the Euclid matrix.

%C Definition: d prime-divides n <=> d is prime and n = m*d for some m.

%C Equivalently: d prime-divides n iff d is prime, and the integer remainder of n divided by d is 0. (Here the 'and' is understood as an short-circuit operator.)

%C This definition is sufficient to define the infinite lower triangular array, i.e., if we consider only the range 0 <= d <= n. But when looking at the square array this restriction has to be made explicit because with the above definition every integer divides 0, and thus the first row of the square matrix becomes the indicator function of the primes A010051 (with an extra zero term at the start).

%D Tom M. Apostol, Introduction to Analytic Number Theory, Springer 1976, p. 14.

%H Paolo Xausa, <a href="/A363915/b363915.txt">Table of n, a(n) for n = 0..11475</a> (rows 0..150 of the triangle, flattened)

%F (A010051, A008472, A087624 with an extra zero term at the start).

%F T(n, k) = A113704(n, k) * A010051(k).

%F Sum_{k=0..n} k * T(n, k) = A008472(n).

%F Sum_{k=0..n-1} k * T(n, k) = A087624(n).

%e Triangle T(n, k) starts:

%e [0] 0;

%e [1] 0, 0;

%e [2] 0, 0, 1;

%e [3] 0, 0, 0, 1;

%e [4] 0, 0, 1, 0, 0;

%e [5] 0, 0, 0, 0, 0, 1;

%e [6] 0, 0, 1, 1, 0, 0, 0;

%e [7] 0, 0, 0, 0, 0, 0, 0, 1;

%e [8] 0, 0, 1, 0, 0, 0, 0, 0, 0;

%e [9] 0, 0, 0, 1, 0, 0, 0, 0, 0, 0;

%e .

%e T(0, 0) = 0, because: [0 is prime] and [0 | 0] = False and True = False.

%e T(6, 5) = 0, because: [5 is prime] and [5 | 6] = True and False = False.

%e T(6, 4) = 0, because: [4 is prime] and [4 | 6] = False and False = False.

%e T(6, 2) = 1, because: [2 is prime] and [2 | 6] = True and True = True.

%p divides := (k, n) -> k = n or (k > 0 and irem(n, k) = 0):

%p T := (n, k) -> ifelse(isprime(k) and divides(k, n), 1, 0):

%p for n from 0 to 9 do seq(T(n, k), k = 0..n) od;

%t A363915list[rowmax_]:=Table[Boole[PrimeQ[k]&&Divisible[n,k]],{n,0,rowmax},{k,0,n}];A363915list[20] (* Generates 21 rows *) (* _Paolo Xausa_, Aug 04 2023 *)

%o (SageMath)

%o matrix(ZZ, 10, 10, lambda n, k: k <= n and is_prime(k) and ZZ(k).divides(ZZ(n)))

%Y Cf. A001221 (row sums), A351619 (alternating row sums), A008472, A087624.

%Y Cf. A113704, A010051, A363914.

%K nonn,tabl

%O 0

%A _Peter Luschny_, Jul 03 2023