login
A082901
a(n) = A082895(n)-A000203(n); the distance from sigma(n) to that multiple of n which is closest to sigma(n), positive terms for cases where the closest multiple is after sigma(n), and negative terms where it is before sigma(n). In case of ties, a positive term is selected.
5
0, 1, -1, 1, -1, 0, -1, 1, -4, 2, -1, -4, -1, 4, 6, 1, -1, -3, -1, -2, 10, 8, -1, 12, -6, 10, -13, 0, -1, -12, -1, 1, -15, 14, -13, 17, -1, 16, -17, -10, -1, -12, -1, 4, 12, 20, -1, 20, -8, 7, -21, 6, -1, -12, -17, -8, -23, 26, -1, 12, -1, 28, 22, 1, -19, -12, -1, 10, -27, -4, -1, 21, -1, 34, 26, 12, -19, -12, -1, -26, -40, 38, -1, 28
OFFSET
1,9
LINKS
FORMULA
a(n) = n*floor[(floor(n/2)+sigma(n))/n] - sigma(n).
EXAMPLE
n=2: sigma(2)=3, the closest even numbers to 3 are 2 and 4, we choose 4 to get a positive difference, thus a(2) = 4-3 = 1.
n=28: sigma(28) = 56, thus a multiple of 28 which is closest to 28 is 28, so the difference is zero. Positions of zeros for this sequence is given by the multiply perfect numbers, A007691.
When n is a prime p > 2, sigma(p) = p+1, thus the multiple of p closest to p+1 is p, so difference is -1.
MATHEMATICA
Table[n*Floor[(Floor[n/2]+DivisorSigma[1, n])/n]- DivisorSigma[1, n], {n, 1, 100}]
PROG
(PARI) a(n)=my(s=sigma(n)); s\/n*n-s \\ Charles R Greathouse IV, Feb 15 2013
(PARI) A082901(n) = { my(s=sigma(n), a = ((s\n)*n)-s, b = ((1+(s\n))*n)-s); if(b <= abs(a), b, a); }; \\ Antti Karttunen, Oct 01 2018
CROSSREFS
KEYWORD
sign,look
AUTHOR
Labos Elemer, Apr 22 2003
EXTENSIONS
Definition clarified and the example section edited by Antti Karttunen, Sep 25 2018
STATUS
approved