OFFSET
1,21
EXAMPLE
The divisors of 12 are 1, 2, 3, 4, 6 and 12. If the permutation K is, for example, (12,6,3,1,2,4), then the partial sums are: 12 = 12, 12+6 = 18, 12+6+3 = 21, 12+6+3+1 = 22, 12+6+3+1+2 = 24, and 12+6+3+1+2+4 = 28. None of these sums are coprime to 12, proving that the minimum number of partial sums coprime to 12 = a(12) = 0.
PROG
(PARI) c(perm, n) = {my(s=0, k=0); for(i = 1, #perm, s += perm[i]; if(gcd(s, n) == 1, k++)); k; }
a(n) = {my(d = divisors(n), cmin = #d, c1); forperm(d, v, c1 = c(v, n); if(c1 < cmin, cmin = c1)); cmin; } \\ Amiram Eldar, Jul 09 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, May 26 2009
EXTENSIONS
Extended thru a(59) by Ray Chandler, Jun 15 2009
a(60)-a(95) from Amiram Eldar, Jul 09 2023
STATUS
approved