OFFSET
0,3
COMMENTS
T(n, k) is the sum of the Hamming weight of n and the Hamming weight of k.
See A365618 for a table read by antidiagonals.
EXAMPLE
Triangle begins:
k=0 1 2 3 4 5
n=0: 0;
n=1: 1, 2;
n=2: 1, 2, 2;
n=3: 2, 3, 3, 4;
n=4: 1, 2, 2, 3, 2;
n=5: 2, 3, 3, 4, 3, 4;
...
MATHEMATICA
T[n_, k_] := DigitCount[n, 2, 1] + DigitCount[k, 2, 1]
PROG
(Python)
from math import comb, isqrt
def A367055(n): return (n-comb(r:=(m:=isqrt(k:=n+1<<1))+(k>m*(m+1)), 2)).bit_count()+(r-1).bit_count() # Chai Wah Wu, Nov 11 2024
CROSSREFS
KEYWORD
AUTHOR
Mithra Karamchedu and Sophia Pi, Nov 03 2023
STATUS
approved