[go: up one dir, main page]

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
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
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
Sequence in context: A189838 A247219 A265835 * A000216 A110998 A051861
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

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 August 30 04:38 EDT 2024. Contains 375526 sequences. (Running on oeis4.)