OFFSET
1,4
COMMENTS
a(n)=1 if and only if n is prime.
a(n)=n-1 if n is a power of 2.
a(n)=n if n is an even perfect number (is the converse true?)
Note: the count excludes an empty subset of proper divisors that would give 0 as a sum. - Antti Karttunen, Mar 07 2018
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..20000 (first 10000 terms from Amiram Eldar)
MAPLE
with(linalg): a:=proc(n) local dl, t: dl:=convert(numtheory[divisors](n) minus {n}, list): t:=nops(dl): return nops({seq(innerprod(dl, convert(2^t+i, base, 2)[1..t]), i=1..2^t-1)}): end: seq(a(n), n=1..76); # Nathaniel Johnston, Jul 23 2011
MATHEMATICA
a[n_] := Module[{d = Most @ Divisors[n], x}, Count[CoefficientList[Product[1 + x^i, {i, d}], x], _?(# > 0 &)] - 1]; Array[a, 100] (* Amiram Eldar, Jun 13 2020 *)
PROG
(PARI)
\\ Slow and naive:
A193279(n) = if(1==n, 0, my(pds = (divisors(n)[1..(numdiv(n)-1)]), maxsum = vecsum(pds), sums = vector(maxsum), psetsiz = (2^length(pds))-1, k = 0, s); for(i=1, psetsiz, s = vecsum(choosebybits(pds, i)); if(!sums[s], k++; sums[s]++)); (k)); \\ Antti Karttunen, Mar 07 2018
(PARI) A193279(n) = { my(p=1); fordiv(n, d, if(d<n, p *= (1 + 'x^d))); sum(i=1, poldegree(p), (0<polcoeff(p, i))); }; \\ Antti Karttunen, Nov 29 2024
(PARI) A193279(n) = { my(c=[0]); fordiv(n, d, if(d<n, c = Set(concat(c, vector(#c, i, c[i]+d))))); (#c)-1; }; \\ (see A119347) - Antti Karttunen, Nov 29 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Michael Engling, Jul 20 2011
STATUS
approved