A102039 a(n) = a(n-1) + last digit of a(n-1), starting at 1.
1, 2, 4, 8, 16, 22, 24, 28, 36, 42, 44, 48, 56, 62, 64, 68, 76, 82, 84, 88, 96, 102, 104, 108, 116, 122, 124, 128, 136, 142, 144, 148, 156, 162, 164, 168, 176, 182, 184, 188, 196, 202, 204, 208, 216, 222, 224, 228, 236, 242, 244, 248, 256, 262, 264, 268, 276, 282
Offset: 1
Examples
28 + 8 = 36, 36 + 6 = 42.
Links
- Colin Barker, Table of n, a(n) for n = 1..1000
- Index entries for linear recurrences with constant coefficients, signature (2,-2,2,-1).
Crossrefs
Apart from initial term, same as A002081.
Programs
-
Mathematica
LinearRecurrence[{2,-2,2,-1},{1,2,4,8,16},60] (* Harvey P. Dale, Jul 02 2022 *)
-
PARI
print1(a=1);for(i=1,99,print1(","a+=a%10)) \\ M. F. Hasler, Jan 14 2014
-
PARI
Vec(x*(5*x^4+2*x^3+2*x^2+1)/((x-1)^2*(x^2+1)) + O(x^100)) \\ Colin Barker, Sep 20 2014
-
PARI
a(n) = if(n==1, 1, (-10-(1-I/2)*(-I)^n-(1+I/2)*I^n+5*n)) \\ Colin Barker, Oct 18 2015
Formula
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+2*x^3+2*x^2+1) / ((x-1)^2*(x^2+1)). - Colin Barker, Sep 20 2014
a(n) = (-10 - (1-i/2)*(-i)^n - (1+i/2)*i^n + 5*n) for n>1, where i = sqrt(-1). - Colin Barker, Oct 18 2015
Comments