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 A220221 #31 Sep 08 2022 08:46:04 %S A220221 1,3,5,7,9,17,23,33,65,129,257,513,1025,2049,4097,8193,16385,32769, %T A220221 65537,131073,262145,524289,1048577,2097153,4194305,8388609,16777217, %U A220221 33554433,67108865,134217729,268435457,536870913,1073741825,2147483649,4294967297 %N A220221 Odd positive integers k such that k^2 has at most three nonzero binary digits. %C A220221 It is shown in the Szalay reference that if y is a term of this sequence then y=7, y=23, or y=2^t+1 for some positive t. Also see the Bennett reference. %H A220221 Colin Barker, <a href="/A220221/b220221.txt">Table of n, a(n) for n = 1..1000</a> %H A220221 Michael A. Bennett, <a href="http://www.emis.de/journals/INTEGERS/papers/a3self/a3self.Abstract.html">Perfect powers with few ternary digits</a>, INTEGERS 12A (2012), #A3. %H A220221 László Szalay, <a href="http://dx.doi.org/10.1016/S0019-3577(02)90011-X">The equations 2^n+-2^m+-2^l=z^2</a>, Indag. Math. 13 (2002) 131-142. %H A220221 <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (3,-2). %F A220221 a(n) = 3*a(n-1)-2*a(n-2) for n>9. - _Colin Barker_, Nov 06 2014 %F A220221 G.f.: x*(12*x^8-2*x^7-10*x^6+4*x^5-2*x^4-2*x^3-2*x^2+1) / ((x-1)*(2*x-1)). - _Colin Barker_, Nov 06 2014 %t A220221 Select[Range[1, 1000000, 2], Total[IntegerDigits[#^2, 2]] <= 3 &] (* _T. D. Noe_, Dec 07 2012 *) %t A220221 CoefficientList[Series[(12 x^8 - 2 x^7 - 10 x^6 + 4 x^5 - 2 x^4 - 2 x^3 - 2 x^2 + 1) / ((x - 1) (2 x - 1)), {x, 0, 50}], x] (* _Vincenzo Librandi_, Nov 07 2014 *) %o A220221 (PARI) is(n)=n%2 && hammingweight(n^2)<4 \\ _Charles R Greathouse IV_, Dec 10 2012 %o A220221 (PARI) Vec(x*(12*x^8-2*x^7-10*x^6+4*x^5-2*x^4-2*x^3-2*x^2+1)/((x-1)*(2*x-1)) + O(x^100)) \\ _Colin Barker_, Nov 06 2014 %o A220221 (Magma) I:=[1,3,5,7,9,17,23,33,65,129]; [n le 10 select I[n] else 3*Self(n-1)-2*Self(n-2): n in [1..50]]; // _Vincenzo Librandi_, Nov 07 2014 %Y A220221 Cf. A212191 (exactly 3 powers). %K A220221 nonn,base,easy %O A220221 1,2 %A A220221 _John W. Layman_, Dec 07 2012 %E A220221 Extended by _T. D. Noe_, Dec 07 2012