login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A345348 Triangular numbers that in base 2 have the same number of 0's and 1's. 1

%I #17 Jun 21 2021 15:12:13

%S 10,153,210,595,666,820,2278,2701,9045,9870,10585,11476,12403,13366,

%T 13861,14365,34191,34716,35245,36046,37675,37950,39340,39621,40470,

%U 41905,42195,42778,43365,44551,45150,45451,46665,48516,49455,50086,50403,51681,52003,52326

%N Triangular numbers that in base 2 have the same number of 0's and 1's.

%H Charles R Greathouse IV, <a href="/A345348/b345348.txt">Table of n, a(n) for n = 1..10000</a>

%e Triangular number 153 = '10011001' in binary, the number of 1's equals the number of 0's, so 153 is a term.

%t Select[Table[n*(n + 1)/2, {n, 0, 330}], Equal @@ DigitCount[#, 2] &] (* _Amiram Eldar_, Jun 15 2021 *)

%o (PARI) isA031443(n)=2*hammingweight(n)==exponent(n)+1

%o list(lim)=my(v=List(),n=4,t); while((t=n*n++/2)<=lim, if(isA031443(t), listput(v,t))); Vec(v) \\ _Charles R Greathouse IV_, Jun 21 2021

%o (Python)

%o A345348_list = [n for n in (m*(m+1)//2 for m in range(10**6)) if len(bin(n))-2 == 2*bin(n).count('1')] # _Chai Wah Wu_, Jun 21 2021

%Y Intersection of A000217 and A031443.

%Y Cf. A164343.

%K nonn,base

%O 1,1

%A _Ctibor O. Zizka_, Jun 15 2021

%E More terms from _Jinyuan Wang_, Jun 15 2021

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 05:20 EDT 2024. Contains 371906 sequences. (Running on oeis4.)