Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #13 Feb 19 2023 16:59:19
%S 0,1,21,28,190,231,276,378,435,630,741,903,946,1326,1540,1596,1830,
%T 1953,2016,2278,2701,4278,4465,5460,5778,5886,6328,6441,6670,6903,
%U 8646,11026,11781,11935,12246,12720,15225,15400,15931,16471,17391,17578,17955,18336,20100
%N Triangular numbers whose Hamming weight is also triangular.
%H Alois P. Heinz, <a href="/A344603/b344603.txt">Table of n, a(n) for n = 1..20000</a>
%H Audrey Baumheckel and Tamás Forgács, <a href="https://arxiv.org/abs/2105.10354">Guided by the primes -- an exploration of very triangular numbers</a>, arXiv:2105.10354 [math.HO], 2021.
%p q:= n-> issqr(8*add(i, i=Bits[Split](n))+1):
%p select(q, [j*(j+1)/2$j=0..200])[]; # _Alois P. Heinz_, May 24 2021
%t Select[Table[n*(n + 1)/2, {n, 0, 200}], IntegerQ @ Sqrt[8 * Plus @@ IntegerDigits[#, 2] + 1] &] (* _Amiram Eldar_, May 24 2021 *)
%t Select[Accumulate[Range[0,200]],OddQ[Sqrt[8 DigitCount[#,2,1]+1]]&] (* _Harvey P. Dale_, Feb 19 2023 *)
%o (PARI) isok(n) = ispolygonal(n, 3) && ispolygonal(hammingweight(n), 3);
%Y Cf. A000120.
%Y Intersection of A000217 and A344602.
%K nonn,base
%O 1,3
%A _Michel Marcus_, May 24 2021