login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A358012
Minimal number of coins needed to pay n cents using coins of denominations 1 and 5 cents.
0
0, 1, 2, 3, 4, 1, 2, 3, 4, 5, 2, 3, 4, 5, 6, 3, 4, 5, 6, 7, 4, 5, 6, 7, 8, 5, 6, 7, 8, 9, 6, 7, 8, 9, 10, 7, 8, 9, 10, 11, 8, 9, 10, 11, 12, 9, 10, 11, 12, 13, 10, 11, 12, 13, 14, 11, 12, 13, 14, 15, 12, 13, 14, 15, 16, 13, 14, 15, 16, 17, 14, 15, 16, 17, 18, 15, 16
OFFSET
0,3
COMMENTS
Sequence consists of runs of five consecutive integers: 0..4, 1..5, 2..6, 3..7, etc.
FORMULA
Sum of quotient and remainder of n/5.
a(n) = A002266(n) + A010874(n).
MATHEMATICA
Array[Total@ QuotientRemainder[#, 5] &, 77, 0] (* Michael De Vlieger, Nov 03 2022 *)
PROG
(PARI) a(n) = n\5 + n%5 \\ Thomas Scheuerle, Oct 24 2022
(PARI) a(n) = vecsum(divrem(n, 5)); \\ Michel Marcus, Nov 03 2022
(Python) def a(n): return n//5 + n%5 # Michael S. Branicky, Nov 03 2022
CROSSREFS
Cf. A076314 (1,10 cents), A053344 (1,5,10,25 cents).
Sequence in context: A283365 A053824 A033925 * A064866 A024855 A274651
KEYWORD
nonn,easy
AUTHOR
Sandra Snan, Oct 24 2022
STATUS
approved

  NODES
orte 1
see 1
Story 1