login
This site is supported by donations to The OEIS Foundation.

 

Logo

Please make a donation to keep the OEIS running. We are now in our 55th year. In the past year we added 12000 new sequences and reached 8000 citations (which often say "discovered thanks to the OEIS"). We need to raise money to hire someone to manage submissions, which would reduce the load on our editors and speed up editing.
Other ways to donate

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A220221 Odd positive integers k such that k^2 has at most three nonzero binary digits. 1
1, 3, 5, 7, 9, 17, 23, 33, 65, 129, 257, 513, 1025, 2049, 4097, 8193, 16385, 32769, 65537, 131073, 262145, 524289, 1048577, 2097153, 4194305, 8388609, 16777217, 33554433, 67108865, 134217729, 268435457, 536870913, 1073741825, 2147483649, 4294967297 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

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.

LINKS

Colin Barker, Table of n, a(n) for n = 1..1000

Michael A. Bennett, Perfect powers with few ternary digits, INTEGERS 12A (2012), #A3.

László Szalay, The equations 2^n+-2^m+-2^l=z^2, Indag. Math. 13 (2002) 131-142.

Index entries for linear recurrences with constant coefficients, signature (3,-2).

FORMULA

a(n) = 3*a(n-1)-2*a(n-2) for n>9. - Colin Barker, Nov 06 2014

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

MATHEMATICA

Select[Range[1, 1000000, 2], Total[IntegerDigits[#^2, 2]] <= 3 &] (* T. D. Noe, Dec 07 2012 *)

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 *)

PROG

(PARI) is(n)=n%2 && hammingweight(n^2)<4 \\ Charles R Greathouse IV, Dec 10 2012

(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

(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

CROSSREFS

Cf. A212191 (exactly 3 powers).

Sequence in context: A084229 A191356 A144753 * A212292 A270837 A057482

Adjacent sequences:  A220218 A220219 A220220 * A220222 A220223 A220224

KEYWORD

nonn,base,easy

AUTHOR

John W. Layman, Dec 07 2012

EXTENSIONS

Extended by T. D. Noe, Dec 07 2012

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified December 6 06:34 EST 2019. Contains 329784 sequences. (Running on oeis4.)