OFFSET
1,2
LINKS
Hiroaki Yamanouchi, Table of n, a(n) for n = 1..26
EXAMPLE
For n=3, 1/1+2/2+3/3 = 2/1+0/2+3/3 = 2/1+2/2+0/3 = 3/1+0/2+0/3 = 3 and no other sums of the required type give 3, so a(3)=4. For n=4, 0/1+4/2+3/3+4/4 and 15 other sums of the required type give 4, so a(4)=16.
MAPLE
b:= proc(r, i, n) option remember;
`if`(r=0, 1, `if`(i>n, 0,
add(b(r-j/i, i+1, n), j=0..min(n, r*i))))
end:
a:= n-> b(n, 1, n):
seq(a(n), n=1..10); # Alois P. Heinz, Mar 06 2012
MATHEMATICA
b[r_, i_, n_] := b[r, i, n] = If[r == 0, 1, If[i>n, 0, Sum[b[r-j/i, i+1, n], {j, 0, Min[n, r*i]}]]]; a[n_] := b[n, 1, n]; Table[Print[a[n]]; a[n], {n, 1, 13}] (* Jean-François Alcover, Feb 27 2014, after Alois P. Heinz *)
PROG
(PARI) A185074(n, i=1, m)={n || return(1); m || m=n; i>m & return; sum(j=0, min(m, n*i), A185074(n-j/i, i+1, m))} \\ - M. F. Hasler, Mar 07 2012
(PARI) /* version with memoization - seems not faster */ R185074=Set("[0]"); A185074(n, i=1, m)={n || return(1); m || m=n; i>m & return; my(t=eval(R185074[setsearch(R185074, [n, i, m], 1)-1])); t[1]==n & t[2]==i & t[3]==m & return(t[4]); t=sum(j=0, min(m, n*i), A185074(n-j/i, i+1, m)); R185074=setunion(R185074, Set([[n, i, m, t]])); t} \\ - M. F. Hasler, Mar 07 2012
CROSSREFS
KEYWORD
nonn
AUTHOR
John W. Layman, Mar 02 2012
EXTENSIONS
a(7)-a(10) from R. J. Mathar, a(11)-a(13) from Alois P. Heinz, Mar 06 2012
a(14) from Alois P. Heinz, Sep 27 2014
a(15)-a(23) from Hiroaki Yamanouchi, Oct 03 2014
STATUS
approved