OFFSET
1,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..1000
Wikipedia, Partition (number theory)
FORMULA
MAPLE
b:= proc(n, i, r) option remember; `if`(i*(i+1)/2<n, 0,
(t-> `if`(i<n, b(n-i, min(i-1, n-i), t), 0)
+`if`(i=n, t, 0)+b(n, i-1, r))(igcd(i, r)))
end:
a:= n-> b(n$2, 0):
seq(a(n), n=1..61); # Alois P. Heinz, Mar 17 2019
MATHEMATICA
Table[Sum[GCD@@ptn, {ptn, Select[IntegerPartitions[n], UnsameQ@@#&]}], {n, 30}]
(* Second program: *)
b[n_, i_, r_] := b[n, i, r] = If[i(i+1)/2 < n, 0,
With[{t = GCD[i, r]}, If[i < n, b[n - i, Min[i - 1, n - i], t], 0] +
If[i == n, t, 0] + b[n, i - 1, r]]];
a[n_] := b[n, n, 0];
Array[a, 61] (* Jean-François Alcover, May 20 2021, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Sep 16 2018
STATUS
approved