Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #12 Jul 09 2023 03:18:14
%S 1,1,1,1,1,0,1,1,1,0,1,0,1,0,0,1,1,0,1,0,2,0,1,0,1,0,1,0,1,0,1,1,0,0,
%T 2,1,1,0,2,0,1,0,1,0,0,0,1,0,1,1,0,0,1,0,2,0,2,0,1,0,1,0,2,1,2,0,1,0,
%U 0,0,1,0,1,0,1,0,2,0,1,0,1,0,1,0,2,0,0,0,1,0,0,0,2,0,0
%N Consider a permutation K = (k(1),k(2),...k(A000005(n))) of the positive divisors of n. Consider the partial sums S = Sum_{j=1..m} k(j), 1 <= m <= A000005(n). Then, a(n) = the minimum number, for any permutation K, of partial sums S that are coprime to n.
%e 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.
%o (PARI) c(perm, n) = {my(s=0, k=0); for(i = 1, #perm, s += perm[i]; if(gcd(s, n) == 1, k++)); k;}
%o 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
%Y Cf. A000005, A151613.
%K nonn
%O 1,21
%A _Leroy Quet_, May 26 2009
%E Extended thru a(59) by _Ray Chandler_, Jun 15 2009
%E a(60)-a(95) from _Amiram Eldar_, Jul 09 2023