[go: up one dir, main page]

login
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