OFFSET
1,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,0,1,-1).
FORMULA
a(n) = a(n-3)+9. If n is a multiple of 3 then a(n) = 3n, otherwise a(n) = 3n-2. Numbers of form {0, 1, 4} modulo 9 - Henry Bottomley, Jun 30 2000
a(1)=1, a(2)=4, a(3)=9, a(4)=10, a(n)=a(n-1)+a(n-3)-a(n-4). - Harvey P. Dale, Jan 26 2015
G.f.: x*(1+3*x+5*x^2) / ( (1+x+x^2)*(x-1)^2 ). - R. J. Mathar, Sep 22 2016
E.g.f.: (exp(x)*(9*x - 4) + 4*exp(-x/2)*cos(sqrt(3)*x/2))/3. - Stefano Spezia, Mar 07 2024
EXAMPLE
E.g. 58 -> 5+8 = 13 -> 1+3 = 4 is a square.
MATHEMATICA
LinearRecurrence[{1, 0, 1, -1}, {1, 4, 9, 10}, 60] (* Harvey P. Dale, Jan 26 2015 *)
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
EXTENSIONS
More terms from Patrick De Geest, Jun 15 1999
STATUS
approved