A082900 a(n) = A082894(n)-A000079(n), the difference of 2^n and the number closest to it and divisible by n.
0, 0, 1, 0, -2, 2, -2, 0, 1, -4, -2, -4, -2, -4, 7, 0, -2, 8, -2, 4, -8, -4, -2, 8, -7, -4, 1, 12, -2, -4, -2, 0, -8, -4, 17, 8, -2, -4, -8, -16, -2, 20, -2, -16, -17, -4, -2, -16, 19, -24, -8, -16, -2, 26, 12, 24, -8, -4, -2, -16, -2, -4, -8, 0, -32, 2, -2, -16, -8, 26, -2, 8, -2, -4, 7, -16, -18, 14, -2, -16, 1, -4, -2, 20, -32, -4, -8
Offset: 1
Links
- Antti Karttunen, Table of n, a(n) for n = 1..16384
Programs
-
Mathematica
Table[n*Floor[(Floor[n/2]+2^n)/n]-2^n, {n, 1, 100}]
-
PARI
A082894(n) = (n*(((n\2)+2^n)\n)); A082900(n) = (A082894(n)-(2^n)); \\ Antti Karttunen, Feb 18 2023
-
PARI
A082900(n) = { my(x=2^n); for(k=0,oo,if(!((x-k)%n),return(-k), if(!((x+k)%n),return(k)))); }; \\ Antti Karttunen, Feb 18 2023
-
Python
def A082900(n): return (m:=(k:=1<
>1))-m%n-k # Chai Wah Wu, Apr 23 2025
Formula
a(n)=n*floor[(floor(n/2)+2^n)/n]-2^n
Comments