OFFSET
1,2
COMMENTS
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..3200 (terms 1..700 from Andrew Howroyd)
EXAMPLE
For n = 4 the sum of the divisors of 4 is 1 + 2 + 4 = 7. Then we have that, in list of colexicographically ordered partitions of 7, the divisors of 4 are in the 9th partition, so a(4) = 9 (see below):
------------------------------------------------------
k Diagram Partitions of 7
------------------------------------------------------
_ _ _ _ _ _ _
1 |_| | | | | | | [1, 1, 1, 1, 1, 1, 1]
2 |_ _| | | | | | [2, 1, 1, 1, 1, 1]
3 |_ _ _| | | | | [3, 1, 1, 1, 1]
4 |_ _| | | | | [2, 2, 1, 1, 1]
5 |_ _ _ _| | | | [4, 1, 1, 1]
6 |_ _ _| | | | [3, 2, 1, 1]
7 |_ _ _ _ _| | | [5, 1, 1]
8 |_ _| | | | [2, 2, 2, 1]
9 |_ _ _ _| | | [4, 2, 1] <---- Divisors of 4
10 |_ _ _| | | [3, 3, 1]
11 |_ _ _ _ _ _| | [6, 1]
12 |_ _ _| | | [3, 2, 2]
13 |_ _ _ _ _| | [5, 2]
14 |_ _ _ _| | [4, 3]
15 |_ _ _ _ _ _ _| [7]
.
MATHEMATICA
b[n_, k_] := b[n, k] = If[k < 1 || k > n, 0, If[n == k, 1, b[n, k + 1] + b[n - k, k]]];
PartIndex[v_] := Module[{s = 1, t = 0}, For[i = Length[v], i >= 1, i--, t += v[[i]]; s += b[t, If[i == 1, 1, v[[i - 1]]]] - b[t, v[[i]]]]; s];
a[n_] := PartIndex[Divisors[n]];
a /@ Range[1, 100] (* Jean-François Alcover, Sep 27 2019, after Andrew Howroyd *)
PROG
(PARI) a(n)={my(d=divisors(n)); vecsearch(vecsort(partitions(vecsum(d))), d)} \\ Andrew Howroyd, Jul 15 2018
(PARI) \\ here b(n, k) is A026807.
b(n, k)=polcoeff(1/prod(i=k, n, 1-x^i + O(x*x^n)), n)
PartIndex(v)={my(s=1, t=0); forstep(i=#v, 1, -1, t+=v[i]; s+=b(t, if(i==1, 1, v[i-1])) - b(t, v[i])); s}
a(n)=PartIndex(divisors(n)); \\ Andrew Howroyd, Jul 15 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Omar E. Pol, Mar 25 2018
EXTENSIONS
Terms a(8) and beyond from Andrew Howroyd, Jul 15 2018
STATUS
approved