login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A056008 Difference between (smallest square strictly greater than 2^n) and 2^n. 3
3, 2, 5, 1, 9, 4, 17, 16, 33, 17, 65, 68, 129, 89, 257, 356, 513, 697, 1025, 1337, 2049, 2449, 4097, 4001, 8193, 4417, 16385, 17668, 32769, 24329, 65537, 4633, 131073, 18532, 262145, 74128, 524289, 296512, 1048577, 1186048, 2097153, 1778369 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,1

COMMENTS

If n is even, a(n) = 2*2^(n/2) + 1, since 2^n = (2^(n/2))^2, and  a(n) = (2^(n/2) + 1)^2 - (2^(n/2))^2 = 2*2^(n/2) + 1. - Jean-Marc Rebert, Mar 02 2016

If n is odd, a(n) = 4*a(n-2) or 4*a(n-2) - 4*sqrt(a(n-2) + 2^(n-2)) + 1. - Robert Israel, Mar 02 2016

LINKS

Harvey P. Dale, Table of n, a(n) for n = 0..1000

FORMULA

a(n) = (floor(2^(n/2))+1)^2 - 2^n = (A017910(n)+1)^2 - A000079(n). - Vladeta Jovovic, May 01 2003

a(2k) = 2*2^k + 1 = 2*a(2(k-1)) - 1. - Jean-Marc Rebert, Mar 02 2016

EXAMPLE

a(5)=6^2-2^5=4; a(6)=9^2-2^6=17

MAPLE

f:= proc(n) local m;

   if n::even then m:= 2*2^(n/2)+1

   else m:= ceil(sqrt(2)*2^((n-1)/2))

   fi;

   m^2-2^n

end proc:

map(f, [$0..100]); # Robert Israel, Mar 02 2016

MATHEMATICA

ssg[n_]:=Module[{s=2^n}, (1+Floor[Sqrt[s]])^2-s]; Array[ssg, 50, 0] (* Harvey P. Dale, Aug 22 2015 *)

Table[((Floor[2^(n/2)] + 1)^2 - 2^n), {n, 0, 50}] (* Vincenzo Librandi, Mar 03 2016 *)

PROG

(MAGMA) [(Floor(2^(n/2))+1)^2-2^n : n in [0..50]]; // Vincenzo Librandi, Mar 03 2016

CROSSREFS

Bisections: A000051, A238454.

Cf. A051204, A056007.

Sequence in context: A111701 A093527 A088233 * A074830 A182983 A231146

Adjacent sequences:  A056005 A056006 A056007 * A056009 A056010 A056011

KEYWORD

nonn

AUTHOR

Henry Bottomley, Jul 24 2000

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 October 25 01:40 EDT 2021. Contains 348233 sequences. (Running on oeis4.)