login
A102040
a(n) = a(n-1) + last digit of a(n-1), starting at 3.
1
3, 6, 12, 14, 18, 26, 32, 34, 38, 46, 52, 54, 58, 66, 72, 74, 78, 86, 92, 94, 98, 106, 112, 114, 118, 126, 132, 134, 138, 146, 152, 154, 158, 166, 172, 174, 178, 186, 192, 194, 198, 206, 212, 214, 218, 226, 232, 234, 238, 246, 252, 254, 258, 266, 272, 274, 278
OFFSET
1,1
FORMULA
From Colin Barker, Oct 21 2015: (Start)
a(n) = -5-(1/2+i)*(-i)^n-(1/2-i)*i^n+5*n for n>1, where i = sqrt(-1).
a(n) = 2*a(n-1)-2*a(n-2)+2*a(n-3)-a(n-4) for n>5.
G.f.: x*(5*x^4-4*x^3+6*x^2+3) / ((x-1)^2*(x^2+1)).
(End)
From Robert Israel, Oct 21 2015: (Start)
a(n) = a(n-4) + 20 for n >= 6.
a(4k) = 20 k - 6.
a(4k+1) = 20 k - 2 for k >= 1.
a(4k+2) = 20 k + 6.
a(4k+3) = 20 k + 12. (End)
EXAMPLE
26+6=32, 32+2=34.
MATHEMATICA
a[1] = 3; a[n_] := a[n] = a[n - 1] + Last@ IntegerDigits@ a[n - 1]; Array[a, {57}] (* Michael De Vlieger, Oct 21 2015 *)
NestList[#+Mod[#, 10]&, 3, 60] (* Harvey P. Dale, Dec 23 2023 *)
PROG
(PARI) a(n) = if(n==1, 3, -5-(1/2+I)*(-I)^n-(1/2-I)*I^n+5*n) \\ Colin Barker, Oct 21 2015
(PARI) Vec(x*(5*x^4-4*x^3+6*x^2+3)/((x-1)^2*(x^2+1)) + O(x^100)) \\ Colin Barker, Oct 21 2015
CROSSREFS
Sequence in context: A062053 A274652 A339552 * A232485 A232486 A077152
KEYWORD
easy,nonn,base
AUTHOR
Samantha Stones (devilsdaughter2000(AT)hotmail.com), Dec 25 2004
EXTENSIONS
Offset set to 1 by Colin Barker, Oct 21 2015
STATUS
approved