login
Square array T(n,k), n >= 1, k >= 0, read by antidiagonals downwards, where T(n,k) = Sum_{j=1..n} (-1)^j*j^k*floor(n/j).
0

%I #11 Oct 30 2023 09:45:03

%S -1,-1,-1,-1,0,-3,-1,2,-4,-2,-1,6,-8,1,-4,-1,14,-22,11,-5,-4,-1,30,

%T -68,49,-15,-1,-6,-1,62,-214,203,-77,15,-9,-4,-1,126,-668,841,-423,

%U 119,-35,4,-7,-1,254,-2062,3491,-2285,807,-225,48,-9,-7,-1,510,-6308,14449

%N Square array T(n,k), n >= 1, k >= 0, read by antidiagonals downwards, where T(n,k) = Sum_{j=1..n} (-1)^j*j^k*floor(n/j).

%F Let A(n, k) = Sum_{j=1..n} j^k * floor(n/j). Then T(n, k) = 2^(k+1)*A(floor(n/2), k) - A(n, k).

%e Array begins:

%e -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, ...

%e -1, 0, 2, 6, 14, 30, 62, 126, 254, 510, ...

%e -3, -4, -8, -22, -68, -214, -668, -2062, -6308, -19174, ...

%e -2, 1, 11, 49, 203, 841, 3491, 14449, 59483, 243481, ...

%e -4, -5, -15, -77, -423, -2285, -12135, -63677, -331143, -1709645, ...

%o (Python)

%o from math import isqrt

%o from itertools import count, islice

%o from sympy import bernoulli

%o def A366936_T(n,k):

%o if k:

%o return ((((s:=isqrt(m:=n>>1))+1)*(bernoulli(k+1)-bernoulli(k+1,s+1))<<k+1)-((t:=isqrt(n))+1)*(bernoulli(k+1)-bernoulli(k+1,t+1))+(sum(w**k*(k+1)*((q:=m//w)+1)-bernoulli(k+1)+bernoulli(k+1,q+1) for w in range(1,s+1))<<k+1)-sum(w**k*(k+1)*((q:=n//w)+1)-bernoulli(k+1)+bernoulli(k+1,q+1) for w in range(1,t+1)))//(k+1) if n else -1

%o else:

%o return (s:=isqrt(n))**2-((t:=isqrt(m:=n>>1))**2<<1)+((sum(m//k for k in range(1, t+1))<<1)-sum(n//k for k in range(1, s+1))<<1)

%o def A366936_gen(): return (A366936_T(k+1,n-k-1) for n in count(1) for k in range(n))

%o A366936_list = list(islice(A366936_gen(),30))

%Y First column is -A059851.

%Y Second column is A024919.

%Y Third column is A366915.

%Y Fourth column is A366917.

%Y First row is -A000012.

%Y Second row is A000918.

%Y First superdiagonal is A366919.

%Y Cf. A319649.

%K sign,tabl

%O 1,6

%A _Chai Wah Wu_, Oct 29 2023