OFFSET
0,11
COMMENTS
Equivalently, write n in base 8, 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,0,0,0,2,0,0,0,0,0,0,0,-1).
FORMULA
a(n) = 2*a(n-8)-a(n-16). - Colin Barker, May 11 2015
G.f.: x^9*(7*x^6+6*x^5+5*x^4+4*x^3+3*x^2+2*x+1) / ((x-1)^2*(x+1)^2*(x^2+1)^2*(x^4+1)^2). - Colin Barker, May 11 2015
MATHEMATICA
Table[Floor[n/8]Mod[n, 8], {n, 0, 90}] (* or *) LinearRecurrence[{0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, -1}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7}, 90] (* Harvey P. Dale, Nov 05 2023 *)
PROG
(PARI) a(n, b=8)=(n=divrem(n, b))[1]*n[2]
(PARI) concat([0, 0, 0, 0, 0, 0, 0, 0, 0], Vec(x^9*(7*x^6+6*x^5+5*x^4+4*x^3+3*x^2+2*x+1) / ((x-1)^2*(x+1)^2*(x^2+1)^2*(x^4+1)^2) + O(x^100))) \\ Colin Barker, May 11 2015
(Python)
def A257848(n): return (n>>3)*(n&7) # Chai Wah Wu, Jan 19 2023
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
M. F. Hasler, May 10 2015
STATUS
approved