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.

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

This page as a plain text file.
%I A057536 #26 Jun 17 2022 03:41:17
%S A057536 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,
%T A057536 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,
%U A057536 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
%N A057536 Minimal number of coins needed to pay n Euro-cents using the Euro currency.
%C A057536 Euro currency has coins and bills of size 1, 2, 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000 cents.
%H A057536 Joan Ludevid, <a href="/A057536/b057536.txt">Table of n, a(n) for n = 0..10000</a>
%H A057536 <a href="/index/Mag#change">Index entries for sequences related to making change.</a>
%F A057536 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.
%e A057536 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.
%t A057536 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 *)
%t A057536 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);
%t A057536 Table[numCoins[n], {n, 0, 105}] (* _Joan Ludevid_, Jun 16 2022 *)
%Y A057536 Cf. A011542, A001299.
%K A057536 easy,nonn
%O A057536 0,4
%A A057536 Thomas Brendan Murphy (murphybt(AT)tcd.ie), Sep 06 2000
%E A057536 a(0)=0 prepended by _Alois P. Heinz_, May 26 2015