OFFSET
1,1
COMMENTS
For the first of the corresponding eight consecutive positive integers, see A262075.
LINKS
Colin Barker, Table of n, a(n) for n = 1..676
Index entries for linear recurrences with constant coefficients, signature (31,-31,1).
FORMULA
a(n) = 31*a(n-1)-31*a(n-2)+a(n-3) for n>3.
G.f.: -x*(x^2-30*x+113) / ((x-1)*(x^2-30*x+1)).
EXAMPLE
113 is in the sequence because 113^2 + ... + 119^2 (7 terms) = 94220 = 105^2 + ... + 112^2 (8 terms).
MATHEMATICA
LinearRecurrence[{31, -31, 1}, {113, 3473, 104161}, 20] (* Vincenzo Librandi, Sep 11 2015 *)
PROG
(PARI) Vec(-x*(x^2-30*x+113)/((x-1)*(x^2-30*x+1)) + O(x^20))
(Magma) I:=[113, 3473, 104161]; [n le 3 select I[n] else 31*Self(n-1)-31*Self(n-2)+Self(n-3): n in [1..20]]; // Vincenzo Librandi, Sep 11 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Colin Barker, Sep 10 2015
STATUS
approved