[go: up one dir, main page]

login
A164880
Maximum number of copies of proper divisors of n required to express n as a sum; a(1) = 0 by convention.
2
0, 2, 3, 2, 5, 1, 7, 2, 3, 2, 11, 1, 13, 2, 2, 2, 17, 1, 19, 1, 2, 2, 23, 1, 5, 2, 3, 1, 29, 1, 31, 2, 3, 2, 4, 1, 37, 2, 3, 1, 41, 1, 43, 2, 2, 2, 47, 1, 7, 2, 3, 2, 53, 1, 4, 1, 3, 2, 59, 1, 61, 2, 2, 2, 4, 1, 67, 2, 3, 2, 71, 1, 73, 2, 2, 2, 5, 1, 79, 1, 3, 2, 83, 1, 4, 2, 3, 1, 89, 1, 5, 2, 3, 2, 4, 1
OFFSET
1,2
COMMENTS
For p prime, a(p^k) = p.
a(n) = 1 iff n in A005835.
a(n) >= n/(sigma(n)-n) = n/A001065(n), where sigma is A000203; when the right hand side is an integer, this is an equality.
PROG
(PARI) a(n)=local(ds, p); if(n<=1, return(0)); ds=divisors(n); if(#ds==2, return(n)); p=prod(i=1, #ds-1, (1+x^ds[i])); for(k=0, n, if(polcoeff(p^k, n)!=0, return(k)))
/* The test for #ds==2 is for speed; the program works without it. */
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved