login
A366936
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
-1, -1, -1, -1, 0, -3, -1, 2, -4, -2, -1, 6, -8, 1, -4, -1, 14, -22, 11, -5, -4, -1, 30, -68, 49, -15, -1, -6, -1, 62, -214, 203, -77, 15, -9, -4, -1, 126, -668, 841, -423, 119, -35, 4, -7, -1, 254, -2062, 3491, -2285, 807, -225, 48, -9, -7, -1, 510, -6308, 14449
OFFSET
1,6
FORMULA
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).
EXAMPLE
Array begins:
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, ...
-1, 0, 2, 6, 14, 30, 62, 126, 254, 510, ...
-3, -4, -8, -22, -68, -214, -668, -2062, -6308, -19174, ...
-2, 1, 11, 49, 203, 841, 3491, 14449, 59483, 243481, ...
-4, -5, -15, -77, -423, -2285, -12135, -63677, -331143, -1709645, ...
PROG
(Python)
from math import isqrt
from itertools import count, islice
from sympy import bernoulli
def A366936_T(n, k):
if k:
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
else:
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)
def A366936_gen(): return (A366936_T(k+1, n-k-1) for n in count(1) for k in range(n))
A366936_list = list(islice(A366936_gen(), 30))
CROSSREFS
First column is -A059851.
Second column is A024919.
Third column is A366915.
Fourth column is A366917.
First row is -A000012.
Second row is A000918.
First superdiagonal is A366919.
Cf. A319649.
Sequence in context: A280348 A332397 A004608 * A201673 A343764 A117905
KEYWORD
sign,tabl
AUTHOR
Chai Wah Wu, Oct 29 2023
STATUS
approved