cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-4 of 4 results.

A053344 Minimal number of coins needed to pay n cents using coins of denominations 1, 5, 10, 25 cents.

Original entry on oeis.org

1, 2, 3, 4, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6, 3, 4, 5, 6, 7, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 3, 4, 5, 6, 7, 3, 4, 5, 6, 7, 4, 5, 6, 7, 8, 4, 5, 6, 7, 8, 3, 4, 5, 6, 7, 4, 5, 6, 7, 8, 4, 5, 6, 7, 8, 5, 6, 7, 8, 9, 5, 6, 7, 8, 9, 4
Offset: 1

Views

Author

Jean Fontaine (jfontain(AT)odyssee.net), Jan 06 2000

Keywords

Examples

			a(57) = 5 because to pay 57 cents at least 5 coins are needed: 2 of 25 cents, 1 of 5 cents and 2 of 1 cent.
		

Crossrefs

Programs

  • Magma
    I:=[1,2,3,4,1,2,3,4,5,1,2,3,4,5,2,3,4,5,6,2,3,4,5,6,1,2]; [n le 26 select I[n] else Self(n-1) +Self(n-25) - Self(n-26): n in [1..70]]; // G. C. Greubel, May 31 2018
    
  • Mathematica
    f[n_]:=Floor[n/25]+Floor[Mod[n,25]/10]+Floor[Mod[Mod[n,25],10]/5]+Mod[Mod[Mod[n,25],10],5]; lst={};Do[AppendTo[lst,f[n]],{n,6!}];lst (* Vladimir Joseph Stephan Orlovsky, Sep 28 2009 *)
    Table[Min[Total/@FrobeniusSolve[{1,5,10,25},n]],{n,100}] (* or *) LinearRecurrence[{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,-1},{1,2,3,4,1,2,3,4,5,1,2,3,4,5,2,3,4,5,6,2,3,4,5,6,1,2},100] (* Harvey P. Dale, Aug 14 2014 *)
  • PARI
    Vec(-x*(5*x^24 -x^23 -x^22 -x^21 -x^20 +4*x^19 -x^18 -x^17 -x^16 -x^15 +3*x^14 -x^13 -x^12 -x^11 -x^10 +4*x^9 -x^8 -x^7 -x^6 -x^5 +3*x^4 -x^3 -x^2 -x -1) / ((x -1)^2*(x^4 +x^3 +x^2 +x +1)*(x^20 +x^15 +x^10 +x^5 +1)) + O(x^100)) \\ Colin Barker, Jan 10 2015
    
  • Python
    def A053344(n):
        a, b = divmod(n,25)
        c, d = divmod(b,10)
        return a+c+sum(divmod(d,5)) # Chai Wah Wu, Nov 08 2022

Formula

a(n) = floor(n/25) + floor([n mod 25]/10) + floor([{n mod 25} mod 10]/5) + ([n mod 25] mod 10) mod 5.
G.f.: -x*(5*x^24 -x^23 -x^22 -x^21 -x^20 +4*x^19 -x^18 -x^17 -x^16 -x^15 +3*x^14 -x^13 -x^12 -x^11 -x^10 +4*x^9 -x^8 -x^7 -x^6 -x^5 +3*x^4 -x^3 -x^2 -x -1) / ((x -1)^2*(x^4 +x^3 +x^2 +x +1)*(x^20 +x^15 +x^10 +x^5 +1)). - Colin Barker, Jan 10 2015

A212774 Amounts (in cents) of coins in denominations 1, 5, 10, 25, and 50 (cents) which, when using the minimal number of coins, have equal numbers of all denominations used.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 10, 11, 15, 16, 20, 22, 25, 26, 30, 31, 35, 36, 40, 41, 50, 51, 55, 56, 60, 61, 65, 66, 75, 76, 80, 81, 85, 86, 90, 91, 100, 102, 120, 122, 150, 153, 200, 204, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950
Offset: 1

Views

Author

Rick L. Shepherd, May 29 2012

Keywords

Comments

Nonnegative integers representable as a linear combination of 1, 5, 10, 25, and 50 with nonnegative coefficients, minimal sum of coefficients, and all nonzero coefficients equal.
Includes all nonnegative multiples of 50 and every term > 204 is a multiple of 50.
Unlike A212773, here it is permitted--and necessary--to use a single denomination for some amounts; otherwise, this sequence would be finite.

Examples

			a(37) = 91 is a term because the minimal number of coins to equal the amount 91 is five, 91 = 1*1 + 1*5 + 1*10 + 1*25 + 1*50, and there is one of each of the five denominations used.
a(45) = 204 is a term because the minimal number of coins for 204 is eight, 204 = 4*1 + 4*50, and there are four of each of the two denominations used.
Although 12 can be represented as 12*1 or 2*1 + 2*5, requiring 12 or 4 coins and each otherwise meeting the criteria, three (2*1 + 1*10) is the minimal number of coins required and 2 does not equal 1, so 12 is not a term.
		

Crossrefs

Formula

a(n) = (n-41)*50 for n >= 46.

A057536 Minimal number of coins needed to pay n Euro-cents using the Euro currency.

Original entry on oeis.org

0, 1, 1, 2, 2, 1, 2, 2, 3, 3, 1, 2, 2, 3, 3, 2, 3, 3, 4, 4, 1, 2, 2, 3, 3, 2, 3, 3, 4, 4, 2, 3, 3, 4, 4, 3, 4, 4, 5, 5, 2, 3, 3, 4, 4, 3, 4, 4, 5, 5, 1, 2, 2, 3, 3, 2, 3, 3, 4, 4, 2, 3, 3, 4, 4, 3, 4, 4, 5, 5, 2, 3, 3, 4, 4, 3, 4, 4, 5, 5, 3, 4, 4, 5, 5, 4, 5, 5, 6, 6, 3, 4, 4, 5, 5, 4, 5, 5, 6, 6, 1, 2, 2, 3, 3, 2
Offset: 0

Views

Author

Thomas Brendan Murphy (murphybt(AT)tcd.ie), Sep 06 2000

Keywords

Comments

Euro currency has coins and bills of size 1, 2, 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000 cents.

Examples

			a(57) = 3 because to pay 57 cents at least 3 coins are needed: 1 of 50 cents, 1 of 5 cents and 1 of 2 cents.
		

Crossrefs

Programs

  • Mathematica
    Table[Min[Map[Total,FrobeniusSolve[{1,2,5,10,20,50,100,200,500,1000,2000,5000,10000,20000,50000},n]]],{n, 0, 105}] (* Joan Ludevid, Jun 15 2022 *)
    numCoins[n_]:=(amount = n; coins = {50000, 20000, 10000, 5000, 2000, 1000, 500, 200, 100, 50, 20, 10, 5, 2, 1}; total=0; For[i = 1, i <= Length[coins], i++, total+=Quotient[amount, coins[[i]]]; amount = Mod[amount, coins[[i]]]]; total);
    Table[numCoins[n], {n, 0, 105}] (* Joan Ludevid, Jun 16 2022 *)

Formula

a(n) = floor(n/50000) + floor((n mod 50000)/20000) + floor(((n mod 50000) mod 20000)/10000) + ... + floor(((n mod 50000) mod 20000 ... mod 5)/2) + ((n mod 50000) mod 20000)... mod 2.

Extensions

a(0)=0 prepended by Alois P. Heinz, May 26 2015

A245574 Minimal coin changing sequence for denominations 1, 2, 5, 10, 20 and 50 cents.

Original entry on oeis.org

0, 1, 1, 2, 2, 1, 2, 2, 3, 3, 1, 2, 2, 3, 3, 2, 3, 3, 4, 4, 1, 2, 2, 3, 3, 2, 3, 3, 4, 4, 2, 3, 3, 4, 4, 3, 4, 4, 5, 5, 2, 3, 3, 4, 4, 3, 4, 4, 5, 5, 1, 2, 2, 3, 3, 2, 3, 3, 4, 4, 2, 3, 3, 4, 4, 3, 4, 4, 5, 5, 2, 3, 3, 4, 4, 3, 4, 4, 5, 5, 3, 4, 4, 5, 5, 4, 5, 5, 6, 6, 3, 4, 4, 5, 5, 4, 5, 5, 6, 6, 2
Offset: 0

Views

Author

Marko Riedel, Jul 25 2014

Keywords

Comments

a(100) = 2 is the first term where the sequence is different from A057536. - Colin Barker, Jul 26 2014

Crossrefs

Extensions

More terms from Colin Barker, Jul 26 2014
a(0)=0 prepended by Alois P. Heinz, May 26 2015
Showing 1-4 of 4 results.