OFFSET
1,5
COMMENTS
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.
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..16384
FORMULA
a(n)=n*floor[(floor(n/2)+2^n)/n]-2^n
MATHEMATICA
Table[n*Floor[(Floor[n/2]+2^n)/n]-2^n, {n, 1, 100}]
PROG
(PARI)
A082894(n) = (n*(((n\2)+2^n)\n));
(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
CROSSREFS
KEYWORD
sign,look
AUTHOR
Labos Elemer, Apr 22 2003
STATUS
approved