login
Square array A(n,k): A(n,1) = 1, and for k > 1, A(n,k) = the highest exponent e such that k^e divides n, read by descending antidiagonals as A(1,1), A(1,2), A(2,1), etc.
32

%I #32 Mar 10 2021 03:22:37

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

%T 0,1,0,0,0,0,1,0,0,3,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,1,2,1,1,0,0,

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

%N Square array A(n,k): A(n,1) = 1, and for k > 1, A(n,k) = the highest exponent e such that k^e divides n, read by descending antidiagonals as A(1,1), A(1,2), A(2,1), etc.

%H Antti Karttunen, <a href="/A286561/b286561.txt">Table of n, a(n) for n = 1..10585; the first 145 antidiagonals of array</a>

%e The top left 18 X 18 corner of the array:

%e n \k 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

%e .-----------------------------------------------------

%e 1 | 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

%e 2 | 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

%e 3 | 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

%e 4 | 1, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

%e 5 | 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

%e 6 | 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

%e 7 | 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

%e 8 | 1, 3, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

%e 9 | 1, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0

%e 10 | 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0

%e 11 | 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0

%e 12 | 1, 2, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0

%e 13 | 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0

%e 14 | 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0

%e 15 | 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0

%e 16 | 1, 4, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0

%e 17 | 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0

%e 18 | 1, 1, 2, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1

%e ---------------------------------------------------------

%e A(18,2) = 1, because 2^1 divides 18, but 2^2 does not. A(18,3) = 2, because 3^2 divides 18 (but 3^3 does not). A(18,4) = 0, because 4^0 (= 1) divides 18, but 4^1 does not. A(18,18) = 1, because 18^1 divides 18, but 18^2 does not.

%e A(2,18) = 0, because 18^0 divides 2, but 18^1 does not.

%t Table[Function[m, If[k == 1, 1, IntegerExponent[m, k]]][n - k + 1], {n, 15}, {k, n}] // TableForm (* _Michael De Vlieger_, May 20 2017 *)

%o (Scheme)

%o (define (A286561 n) (A286561bi (A002260 n) (A004736 n)))

%o (define (A286561bi row col) (if (= 1 col) 1 (let loop ((i 1)) (if (not (zero? (modulo row (expt col i)))) (- i 1) (loop (+ 1 i))))))

%o (PARI) A286561(n,k) = if(1==k, 1, valuation(n, k)); \\ _Antti Karttunen_, May 27 2017

%o (Python)

%o def a(n, k):

%o i=1

%o if k==1: return 1

%o while n%(k**i)==0:

%o i+=1

%o return i-1

%o for n in range(1, 21): print([a(k, n - k + 1) for k in range(1, n + 1)]) # _Indranil Ghosh_, May 20 2017

%Y Cf. A286562 (transpose), A286563 (lower triangular region), A286564 (lower triangular region reversed).

%Y Cf. A169594 (row sums), also A168512, A178638, A186643.

%Y Cf. also array A286156.

%K nonn,tabl

%O 1,14

%A _Antti Karttunen_, May 20 2017