|
|
A185074
|
|
Number of representations of n in the form sum(i=1..n, c(i)/i ), where each of the c(i)'s is in {0,1,...,n}.
|
|
1
|
|
|
1, 2, 4, 16, 36, 447, 1274, 9443, 54094, 995169, 3013040, 79403971, 244277081, 5853252222, 171545158710, 2586069434760, 8747524457442, 290539678831816, 1002826545775653, 37782799964911391, 1405277934671848125, 53429557586727235246, 189496067102901557686
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
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):
|
|
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
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|