Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #11 Feb 18 2023 08:08:20
%S 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,
%T 12,-2,-4,-2,0,-8,-4,17,8,-2,-4,-8,-16,-2,20,-2,-16,-17,-4,-2,-16,19,
%U -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
%N a(n) = A082894(n)-A000079(n), the difference of 2^n and the number closest to it and divisible by n.
%C n=5:2^5=32 and number divisible by n=5 and closest to 32 is 30 = A082894(5), a(5)=30-32=-2 is the corresponding difference.
%H Antti Karttunen, <a href="/A082900/b082900.txt">Table of n, a(n) for n = 1..16384</a>
%F a(n)=n*floor[(floor(n/2)+2^n)/n]-2^n
%t Table[n*Floor[(Floor[n/2]+2^n)/n]-2^n, {n, 1, 100}]
%o (PARI)
%o A082894(n) = (n*(((n\2)+2^n)\n));
%o A082900(n) = (A082894(n)-(2^n)); \\ _Antti Karttunen_, Feb 18 2023
%o (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
%Y Cf. A082893, A082894, A082895, A082896, A082898, A082899, A082901.
%K sign,look
%O 1,5
%A _Labos Elemer_, Apr 22 2003