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 A356880 #50 Sep 25 2022 09:34:29 %S A356880 4,9,16,36,64,144,256,576,1024,2304,4096,9216,16384,36864,65536, %T A356880 147456,262144,589824,1048576,2359296,4194304,9437184,16777216, %U A356880 37748736,67108864,150994944,268435456,603979776,1073741824,2415919104,4294967296,9663676416,17179869184 %N A356880 Squares that can be expressed as the sum of two powers of two (2^x + 2^y). %C A356880 If x is even, y = x + 3; if x is odd, y = x. %C A356880 Proof for odd x: (2^odd + 2^odd) = 2^(odd + 1) = 2^even --> must be a square. %C A356880 Proof for even x: 2^even + 2^(even + 3) = 1*(2^even) + (2^even * 2^3) = 1*(2^even) + (2^even * 8) = 1*(2^even) + 8*(2^even) = 9*(2^even); since 9 is a square and 2^even is a square, the multiplication result must be a square too. %C A356880 And 9 is the only square that can be written as 1 + a power of 2. %C A356880 Note that a(n) = A272711(n+1) for n=1..23, but beyond it differs more and more. %H A356880 <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (0,4). %F A356880 a(n) = A029744(n+1)^2. %F A356880 a(n) = 9 * 2^(n-2) if n is even (see A002063). %F A356880 a(n) = 2^(n+1) if n is odd (see A000302). %F A356880 From _Stefano Spezia_, Sep 09 2022: (Start) %F A356880 G.f.: x*(4 + 9*x)/(1 - 4*x^2). %F A356880 E.g.f.: (9*(cosh(2*x) - 1) + 8*sinh(2*x))/4. (End) %e A356880 2^4 + 2^7 = 144, a square, thus 144 is a term. %p A356880 seq(`if`(n::even, 9*2^(n-2), 2^(n+1)),n=1..50); # _Robert Israel_, Sep 15 2022 %t A356880 Select[Range[2, 2^17]^2, DigitCount[#, 2, 1] <= 2 &] (* _Amiram Eldar_, Sep 03 2022 *) %o A356880 (Python) %o A356880 def A356880(n): %o A356880 if n % 2 == 0: return 9*2**(n-2) %o A356880 else: return 2**(n+1) %o A356880 (PARI) a(n) = if (n%2, 2^(n+1), 9*2^(n-2)); \\ _Michel Marcus_, Sep 15 2022 %Y A356880 Cf. A029744, A000302, A002063. %Y A356880 Intersection of A000290 and A048645\{1}. %Y A356880 Cf. A272711, A270473 (squares that can be expressed as 3^x + 3^y). %Y A356880 Cf. A220221. %K A356880 nonn,easy %O A356880 1,1 %A A356880 _Karl-Heinz Hofmann_, Sep 02 2022