cp's OEIS Frontend

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.

A056007 Difference between 2^n and largest square strictly less than 2^n.

This page as a plain text file.
%I A056007 #21 Oct 12 2022 05:21:21
%S A056007 1,1,3,4,7,7,15,7,31,28,63,23,127,92,255,7,511,28,1023,112,2047,448,
%T A056007 4095,1792,8191,7168,16383,5503,32767,22012,65535,88048,131071,166831,
%U A056007 262143,296599,524287,444943,1048575,296863,2097151,1187452,4194303
%N A056007 Difference between 2^n and largest square strictly less than 2^n.
%C A056007 Note that this is not a strictly ascending sequence. - _Alonso del Arte_, Apr 28 2022
%F A056007 a(n) = 2^n - (ceiling(2^(n/2)) - 1)^2 = A000079(n) - (A017912(n) - 1)^2. - _Vladeta Jovovic_, May 01 2003
%F A056007 a(n) = A071797(A000079(n)). - _Michel Marcus_, Apr 29 2022
%F A056007 a(n) = 2^n - A357754(n). - _Kevin Ryde_, Oct 12 2022
%e A056007 a(5) = 2^5 - 5^2 =  7;
%e A056007 a(6) = 2^6 - 7^2 = 15.
%t A056007 Table[2^n - Floor[Sqrt[2^n - Boole[EvenQ[n]]]]^2, {n, 0, 47}] (* _Alonso del Arte_, Apr 28 2022 *)
%o A056007 (Python)
%o A056007 from math import isqrt
%o A056007 def a(n): return 2**n - isqrt(2**n-1)**2
%o A056007 print([a(n) for n in range(43)]) # _Michael S. Branicky_, Apr 29 2022
%o A056007 (PARI) a(n) = if(n%2, sqrtint(1<<n,&n);n, bitneg(0,n/2+1)); \\ _Kevin Ryde_, Oct 12 2022
%Y A056007 Cf. A000079, A017912, A071797, A357754.
%Y A056007 Cf. A051213, A056008.
%K A056007 nonn,easy
%O A056007 0,3
%A A056007 _Henry Bottomley_, Jul 24 2000