OFFSET
0,3
COMMENTS
Note that this is not a strictly ascending sequence. - Alonso del Arte, Apr 28 2022
FORMULA
a(n) = 2^n - (ceiling(2^(n/2)) - 1)^2 = A000079(n) - (A017912(n) - 1)^2. - Vladeta Jovovic, May 01 2003
a(n) = 2^n - A357754(n). - Kevin Ryde, Oct 12 2022
EXAMPLE
a(5) = 2^5 - 5^2 = 7;
a(6) = 2^6 - 7^2 = 15.
MATHEMATICA
Table[2^n - Floor[Sqrt[2^n - Boole[EvenQ[n]]]]^2, {n, 0, 47}] (* Alonso del Arte, Apr 28 2022 *)
PROG
(Python)
from math import isqrt
def a(n): return 2**n - isqrt(2**n-1)**2
print([a(n) for n in range(43)]) # Michael S. Branicky, Apr 29 2022
(PARI) a(n) = if(n%2, sqrtint(1<<n, &n); n, bitneg(0, n/2+1)); \\ Kevin Ryde, Oct 12 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Henry Bottomley, Jul 24 2000
STATUS
approved