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.
%I A151774 #12 Mar 31 2021 04:34:25 %S A151774 0,0,0,1,0,1,1,0,0,1,1,0,1,0,0,0,0,1,1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1, %T A151774 1,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0, %U A151774 1,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0 %N A151774 Characteristic function of numbers with binary weight 2 (A018900). %C A151774 a(A018900(n)) = 1; a(A161989(n)) = 0. - _Reinhard Zumkeller_, Jun 24 2009 %H A151774 R. Zumkeller, <a href="/A151774/b151774.txt">Table of n, a(n) for n = 0..10000</a> %H A151774 <a href="/index/Ch#char_fns">Index entries for characteristic functions</a> %F A151774 Let Theta = Sum_{k >= 0} x^(2^k). G.f. is (x + Theta^2 - Theta)/2 (cf. A151758). %t A151774 w[n_] := IntegerDigits[n, 2] // Total; %t A151774 a[n_] := Boole[w[n] == 2]; %t A151774 a /@ Range[0, 105] (* _Jean-François Alcover_, Mar 31 2021 *) %o A151774 (PARI) a(n)=hammingweight(n)==2 \\ _Charles R Greathouse IV_, Sep 26 2015 %Y A151774 Cf. A000120, A018900, A151758. %K A151774 nonn,easy %O A151774 0,1 %A A151774 _N. J. A. Sloane_, Jun 23 2009