login
Number of partitions of n such that the number of parts and the greatest part are coprime.
24

%I #13 Dec 05 2020 09:37:23

%S 1,2,2,4,4,8,8,14,18,28,32,48,58,82,104,144,178,240,294,386,478,616,

%T 750,958,1172,1476,1808,2262,2752,3418,4144,5096,6168,7532,9056,10998,

%U 13174,15888,18968,22772,27074,32364,38366,45662,54006,64062,75534,89324

%N Number of partitions of n such that the number of parts and the greatest part are coprime.

%H Alois P. Heinz, <a href="/A200750/b200750.txt">Table of n, a(n) for n = 1..500</a>

%e a(5) = 4: [1,1,1,1,1], [1,2,2], [2,3], [5].

%e a(6) = 8: [1,1,1,1,1,1], [1,1,1,1,2], [2,2,2], [1,1,1,3], [3,3], [1,1,4], [1,5], [6].

%p b:= proc(n, j, t) option remember;

%p add(b(n-i, i, t+1), i=j..iquo(n, 2))+`if`(igcd(t, n)=1, 1, 0)

%p end:

%p a:= n-> b(n, 1, 1):

%p seq(a(n), n=1..60);

%t b[n_, j_, t_] := b[n, j, t] = Sum[b[n-i, i, t+1], {i, j, Quotient[n, 2]}] + If[GCD[t, n] == 1, 1, 0];

%t a[n_] := b[n, 1, 1];

%t Array[a, 60] (* _Jean-François Alcover_, Dec 05 2020, after _Alois P. Heinz_ *)

%Y Cf. A199886.

%K nonn

%O 1,2

%A _Alois P. Heinz_, Nov 21 2011