OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (4,1,-4).
FORMULA
G.f.: x*(3+x) / ( (x-1)*(4*x-1)*(1+x) ). - R. J. Mathar, Apr 26 2015
a(n) = floor(13*4^n/15). - Karl V. Keller, Jr., Aug 04 2021
EXAMPLE
In base 4, we get: 3, 31, 313, 3131, 31313, 313131, 3131313, 31313131, ... = A037589.
MATHEMATICA
Table[FromDigits[PadRight[{}, n, {3, 1}], 4], {n, 30}] (* or *) LinearRecurrence[ {4, 1, -4}, {3, 13, 55}, 30] (* Harvey P. Dale, Sep 20 2020 *)
PROG
(Python) print([13*4**n//15 for n in range(1, 30)]) # Karl V. Keller, Jr., Aug 04 2021
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
STATUS
approved