login
A082493
a(n) = n*ceiling(2^n/n) - 2^n.
4
0, 0, 1, 0, 3, 2, 5, 0, 1, 6, 9, 8, 11, 10, 7, 0, 15, 8, 17, 4, 13, 18, 21, 8, 18, 22, 1, 12, 27, 26, 29, 0, 25, 30, 17, 8, 35, 34, 31, 24, 39, 20, 41, 28, 28, 42, 45, 32, 19, 26, 43, 36, 51, 26, 12, 24, 49, 54, 57, 44, 59, 58, 55, 0, 33, 2, 65, 52, 61, 26, 69, 8, 71, 70, 7, 60, 59, 14
OFFSET
1,5
COMMENTS
Least nonnegative k such that (2^n+k)/n is an integer.
If n is a power of 2, a(n) = 0; otherwise a(n) = n - A015910(n). - Robert Israel, Apr 08 2015
LINKS
FORMULA
a(n) = -(2^n) mod n. - Robert Israel, Apr 08 2015
MAPLE
seq(-2&^n mod n, n = 1 .. 100); # Robert Israel, Apr 08 2015
PROG
(Python)
def A082493(n): return (-pow(2, n, n))%n # Chai Wah Wu, Aug 24 2023
CROSSREFS
KEYWORD
easy,nonn,look
AUTHOR
Vladeta Jovovic, Apr 28 2003
STATUS
approved