login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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

%I #44 Oct 03 2014 10:31:35

%S 1,2,4,16,36,447,1274,9443,54094,995169,3013040,79403971,244277081,

%T 5853252222,171545158710,2586069434760,8747524457442,290539678831816,

%U 1002826545775653,37782799964911391,1405277934671848125,53429557586727235246,189496067102901557686

%N 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 Hiroaki Yamanouchi, <a href="/A185074/b185074.txt">Table of n, a(n) for n = 1..26</a>

%e 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 b:= proc(r, i, n) option remember;

%p `if`(r=0, 1, `if`(i>n, 0,

%p add(b(r-j/i, i+1, n), j=0..min(n, r*i))))

%p end:

%p a:= n-> b(n, 1, n):

%p seq(a(n), n=1..10); # _Alois P. Heinz_, Mar 06 2012

%t 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 (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 (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 Cf. A002966, A020473.

%K nonn

%O 1,2

%A _John W. Layman_, Mar 02 2012

%E a(7)-a(10) from _R. J. Mathar_, a(11)-a(13) from _Alois P. Heinz_, Mar 06 2012

%E a(14) from _Alois P. Heinz_, Sep 27 2014

%E a(15)-a(23) from _Hiroaki Yamanouchi_, Oct 03 2014

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 19:24 EDT 2024. Contains 371962 sequences. (Running on oeis4.)