OFFSET
0,2
COMMENTS
Number of distinct n-digit suffixes of base 7 squares.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..200
Index entries for linear recurrences with constant coefficients, signature (7,1,-7).
FORMULA
a(n) = floor( (7^n + 3)*7/16 ).
G.f.: (1 - 3*x - 7*x^2)/((1-x)*(1+x)*(1-7*x)). - Colin Barker, Mar 08 2012
a(n) = 7*a(n-1) + a(n-2) - 7*a(n-3). - Vincenzo Librandi, Apr 21 2012
a(n) = A000224(7^n). - R. J. Mathar, Sep 28 2017
MAPLE
A039304 := proc(n)
floor((7^n+3)*7/16) ;
end proc:
seq(A039304(n), n=0..10) ; # R. J. Mathar, Sep 28 2017
MATHEMATICA
CoefficientList[Series[(1-3*x-7*x^2)/((1-x)*(1+x)*(1-7*x)), {x, 0, 40}], x] (* Vincenzo Librandi, Apr 21 2012 *)
LinearRecurrence[{7, 1, -7}, {1, 4, 22}, 30] (* Harvey P. Dale, Aug 03 2016 *)
PROG
(Magma) [Floor((7^n+3)*7/16): n in [0..25]]; // Vincenzo Librandi, May 14 2011
(Magma) I:=[1, 4, 22]; [n le 3 select I[n] else 7*Self(n-1)+Self(n-2)-7*Self(n-3): n in [1..30]]; // Vincenzo Librandi, Apr 21 2012
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved