OFFSET
2,1
COMMENTS
Note that the sum of divisors of 2^e * p for an odd prime p is (2^(e+1)-1) * (p+1).
LINKS
Amiram Eldar, Table of n, a(n) for n = 2..10000
FORMULA
Let p = prime(n), then a(n) = p * 2^floor(log_2(p+1)). Also a(n) = p * 2^floor(log_2(p)) is p is not a Mersenne prime (A000668), p * 2^(floor(log_2(p))+1) otherwise.
a(n) ~ prime(n)^2.
EXAMPLE
For p = prime(4) = 7, 2^0 * 7 = 7, 2^1 * 7 = 14 are both deficient, 2^2 * 7 = 28 is perfect and 2^3 * 7 = 56 is abundant. Hence a(4) = 56.
MATHEMATICA
a[n_] := Module[{p = Prime[n]}, p * 2^Floor[Log2[p+1]]]; Array[a, 100, 2] (* Amiram Eldar, Jul 25 2024 *)
PROG
(PARI) a(n) = my(p=prime(n)); p << logint(p+1, 2)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jianing Song, Feb 09 2021
STATUS
approved