OFFSET
0,8
COMMENTS
Equivalently, write n in base 5, multiply the last digit by the number with its last digit removed.
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,2,0,0,0,0,-1).
FORMULA
a(n) = 2*a(n-5) - a(n-10). - Colin Barker, May 11 2015
G.f.: x^6*(1+2*x+3*x^2+4*x^3) / ((1-x)^2*(1+x+x^2+x^3+x^4)^2). - Colin Barker, May 11 2015
MATHEMATICA
LinearRecurrence[{0, 0, 0, 0, 2, 0, 0, 0, 0, -1}, {0, 0, 0, 0, 0, 0, 1, 2, 3, 4}, 80] (* Harvey P. Dale, Aug 15 2021 *)
PROG
(PARI) a(n, b=5)=(n=divrem(n, b))[1]*n[2]
(PARI) concat([0, 0, 0, 0, 0, 0], Vec(x^6*(1+2*x+3*x^2+4*x^3)/(1-x^5)^2 + O(x^100))) \\ Colin Barker, May 11 2015
(Magma)
A257845:= func< n | Floor(n/5)*(n mod 5) >;
[A257845(n): n in [0..40]]; // G. C. Greubel, Jan 21 2026
(SageMath)
def A257845(n): return (n//5) * (n%5)
print([A257845(n) for n in range(101)]) # G. C. Greubel, Jan 21 2026
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
M. F. Hasler, May 10 2015
STATUS
approved
