OFFSET
1,7
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..10000
EXAMPLE
a(528581) = -4 as A005941(528581) = 528577 = 528581-4. Notably, 528581 = 17^2 * 31 * 59, with divisors [1, 17, 31, 59, 289, 527, 1003, 1829, 8959, 17051, 31093, 528581]. Applying A364557 to these divisors gives [1, 64, 1024, 65536, 128, 1024, 65536, 65536, 2048, 131072, 65536, 131072], while applying Euler totient phi (A000010) to them gives [1, 16, 30, 58, 272, 480, 928, 1740, 8160, 15776, 27840, 473280], their differences being [0, 48, 994, 65478, -144, 544, 64608, 63796, -6112, 115296, 37696, -342208], whose sum is -4.
PROG
(PARI)
A005941(n) = { my(f=factor(n), p, p2=1, res=0); for(i=1, #f~, p = 1 << (primepi(f[i, 1])-1); res += (p * p2 * (2^(f[i, 2])-1)); p2 <<= f[i, 2]); (1+res) }; \\ (After David A. Corneth's program for A156552)
(Python)
from sympy import factorint, primepi
def A364559(n): return sum(1<<primepi(p)+i for i, p in enumerate(factorint(n, multiple=True), -1))+1-n # Chai Wah Wu, Jul 29 2023
CROSSREFS
Cf. also A364288.
KEYWORD
sign
AUTHOR
Antti Karttunen, Jul 28 2023
STATUS
approved