login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A151945 Denomination sequence. Start with the 0th and first coins of value 1 cent: a(0)=a(1)=1. Thereafter a(n), the value of the n-th coin (n>=2), is the number of ways to make change for n cents in earlier coins. The two one-cent coins are considered distinct. 6

%I

%S 1,1,3,5,7,10,14,19,25,32,42,53,66,82,101,124,150,181,216,257,306,361,

%T 424,495,577,671,776,895,1029,1180,1350,1540,1752,1988,2252,2547,2872,

%U 3231,3630,4071,4558,5093,5683,6330,7040,7822,8674,9606,10625,11738

%N Denomination sequence. Start with the 0th and first coins of value 1 cent: a(0)=a(1)=1. Thereafter a(n), the value of the n-th coin (n>=2), is the number of ways to make change for n cents in earlier coins. The two one-cent coins are considered distinct.

%C a(n) is the number of nonnegative solutions to the Diophantine equation 1*x_0 + 1*x_1 + ... + a(n-1)*x_(n-1) = n. - _Melvin Peralta_, Jan 03 2016

%H Robert G. Wilson v, <a href="/A151945/b151945.txt">Table of n, a(n) for n = 0..3500</a>

%F G.f: g(x) = Product_{n >= 0} 1/(1-x^a(n)) - x.

%e Call the two one-cent coins c and d.

%e Then we can make change for 2 cents in three ways: cc,cd,dd, so a(2) = 3.

%e Then we can make change for 3 cents in five ways: ccc,ccd,cdd,ddd,3, so a(3) = 5.

%p b:= proc(n,i) option remember;

%p if n<0 then 0

%p elif n=0 then 1

%p elif i<0 then 0

%p elif i=1 then n+1

%p else b(n,i-1) +b(n-a(i),i)

%p fi

%p end:

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

%p seq(a(n), n=0..100); # _Alois P. Heinz_, Aug 14 2009

%t b[n_, i_] := b[n, i] = If[n < 0, 0, If[n == 0, 1, If[i < 0, 0, If[i == 1, n + 1, b[n, i - 1] + b[n - a[i], i]] ]]]; a[0] = a[1] = 1; a[n_] := a[n] = b[n, n - 1]; Table[ a@n, {n, 0, 50}] (* _Robert G. Wilson v_, Aug 17 2009 *)

%t Nest[Join[#,{Length[FrobeniusSolve[#,Length[#]]]}]&,{1,1},50] (* _Harvey P. Dale_, Jul 29 2018 *)

%o (Haskell)

%o a151945 n = a151945_list !! n

%o a151945_list = 1 : 1 : f [2..] where

%o f (x:xs) = p (take x a151945_list) x : f xs

%o p _ 0 = 1; p [] _ = 0

%o p ds'@(d:ds) m = if m < d then 0 else p ds' (m - d) + p ds m

%o -- _Reinhard Zumkeller_, Jan 21 2014

%K nonn,nice

%O 0,3

%A _David W. Wilson_, Aug 14 2009

%E More terms from _Alois P. Heinz_, Aug 14 2009

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 20 20:50 EDT 2019. Contains 326155 sequences. (Running on oeis4.)