OFFSET
1,3
COMMENTS
In other words: a(n) is the sum of the divisors of n that are not powers of 2.
a(n) is also the sum of odd divisors greater than 1 of n, multiplied by the sum of the divisors of n that are powers of 2.
a(n) = 0 if and only if n is a power of 2.
a(n) = n if and only if n is an odd prime.
From Bernard Schott, Sep 17 2019: (Start)
a(n) = 3*n/2 if and only if n is an even semiprime greater than or equal to 6 (A100484).
a(n) = n + sqrt(n) if and only if n is the square of an odd prime (see A001248 without its first term). (End)
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = Sum_{d|n, d > 1} d * (1 - [rad(d) = 2]), where rad is the squarefree kernel (A007947) and [] is the Iverson bracket, which gives 1 if the condition is true, 0 if it's false. - Wesley Ivan Hurt, Apr 29 2020
EXAMPLE
For n = 18 the divisors of 18 are [1, 2, 3, 6, 9, 18]. There are four divisors of 18 that are not powers of 2, they are [3, 6, 9, 18]. The sum of them is 3 + 6 + 9 + 18 = 36, so a(18) = 36.
On the other hand, the sum of odd divisors greater than 1 of 18 is 3 + 9 = 12, and the sum of the divisors of 18 that are powers of 2 is 1 + 2 = 3, then we have that 12 * 3 = 36, so a(18) = 36.
MAPLE
f:= n -> numtheory:-sigma(n) - 2^(1+padic:-ordp(n, 2))+1:
map(f, [$1..100]); # Robert Israel, Apr 29 2020
MATHEMATICA
Table[DivisorSigma[1, n] - Denominator[DivisorSigma[1, 2n]/DivisorSigma[1, n]], {n, 100}] (* Wesley Ivan Hurt, Aug 24 2019 *)
PROG
(Magma) sol:=[]; m:=1; for n in [1..80] do v:=Set(Divisors(n)) diff {2^k:k in [0..Floor(Log(2, n))]}; sol[m]:=&+v; m:=m+1; end for; sol; // Marius A. Burtea, Aug 24 2019
(PARI) ispp2(n) = (n==1) || (isprimepower(n, &p) && (p==2));
a(n) = sumdiv(n, d, if (!ispp2(d), d)); \\ Michel Marcus, Aug 26 2019
(Scala) def divisors(n: Int): IndexedSeq[Int] = (1 to n).filter(n % _ == 0)
(1 to 80).map(divisors(_).filter(n => n != Integer.highestOneBit(n)).sum) // Alonso del Arte, Apr 29 2020
(Python)
from sympy import divisor_sigma
def A326988(n): return divisor_sigma(n)-(n^(n-1)) # Chai Wah Wu, Aug 04 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Omar E. Pol, Aug 18 2019
STATUS
approved