# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a185074 Showing 1-1 of 1 %I A185074 #44 Oct 03 2014 10:31:35 %S A185074 1,2,4,16,36,447,1274,9443,54094,995169,3013040,79403971,244277081, %T A185074 5853252222,171545158710,2586069434760,8747524457442,290539678831816, %U A185074 1002826545775653,37782799964911391,1405277934671848125,53429557586727235246,189496067102901557686 %N 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}. %H A185074 Hiroaki Yamanouchi, Table of n, a(n) for n = 1..26 %e A185074 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. %p A185074 b:= proc(r, i, n) option remember; %p A185074 `if`(r=0, 1, `if`(i>n, 0, %p A185074 add(b(r-j/i, i+1, n), j=0..min(n, r*i)))) %p A185074 end: %p A185074 a:= n-> b(n, 1, n): %p A185074 seq(a(n), n=1..10); # _Alois P. Heinz_, Mar 06 2012 %t A185074 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_ *) %o A185074 (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 %o A185074 (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 %Y A185074 Cf. A002966, A020473. %K A185074 nonn %O A185074 1,2 %A A185074 _John W. Layman_, Mar 02 2012 %E A185074 a(7)-a(10) from _R. J. Mathar_, a(11)-a(13) from _Alois P. Heinz_, Mar 06 2012 %E A185074 a(14) from _Alois P. Heinz_, Sep 27 2014 %E A185074 a(15)-a(23) from _Hiroaki Yamanouchi_, Oct 03 2014 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE