cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A367055 Triangle read by rows: T(n, k) = A000120(n) + A000120(k), 0 <= k <= n.

This page as a plain text file.
%I A367055 #32 Nov 12 2024 09:06:28
%S A367055 0,1,2,1,2,2,2,3,3,4,1,2,2,3,2,2,3,3,4,3,4,2,3,3,4,3,4,4,3,4,4,5,4,5,
%T A367055 5,6,1,2,2,3,2,3,3,4,2,2,3,3,4,3,4,4,5,3,4,2,3,3,4,3,4,4,5,3,4,4,3,4,
%U A367055 4,5,4,5,5,6,4,5,5,6,2,3,3,4,3,4,4,5,3
%N A367055 Triangle read by rows: T(n, k) = A000120(n) + A000120(k), 0 <= k <= n.
%C A367055 T(n, k) is the sum of the Hamming weight of n and the Hamming weight of k.
%C A367055 See A365618 for a table read by antidiagonals.
%F A367055 T(n, k) = A000120(n) + A000120(k).
%e A367055 Triangle begins:
%e A367055       k=0  1  2  3  4  5
%e A367055   n=0:  0;
%e A367055   n=1:  1, 2;
%e A367055   n=2:  1, 2, 2;
%e A367055   n=3:  2, 3, 3, 4;
%e A367055   n=4:  1, 2, 2, 3, 2;
%e A367055   n=5:  2, 3, 3, 4, 3, 4;
%e A367055         ...
%t A367055 T[n_, k_] := DigitCount[n, 2, 1] + DigitCount[k, 2, 1]
%o A367055 (Python)
%o A367055 from math import comb, isqrt
%o A367055 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
%Y A367055 Cf. A000069, A000120, A000788, A001969, A365618.
%K A367055 nonn,easy,tabl
%O A367055 0,3
%A A367055 _Mithra Karamchedu_ and _Sophia Pi_, Nov 03 2023