OFFSET
1,2
COMMENTS
The sequence is periodic with period 9.
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (0, 0, 0, 0, 0, 0, 0, 0, 1).
FORMULA
EXAMPLE
a(3) = 4 because the 3rd centered square number is 13, the digital root of which is 4.
MATHEMATICA
FixedPoint[Plus @@ IntegerDigits[#] &, #] & /@ Table[2 n (n + 1) + 1, {n, 0, 80}] (* Michael De Vlieger, Feb 01 2015 *)
LinearRecurrence[{0, 0, 0, 0, 0, 0, 0, 0, 1}, {1, 5, 4, 7, 5, 7, 4, 5, 1}, 86] (* Ray Chandler, Aug 26 2015 *)
PROG
(PARI) m=4; vector(200, n, (m*n*(n-1)/2)%9+1)
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Colin Barker, Jan 29 2015
STATUS
approved