login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A102039 a(n) = a(n-1) + last digit of a(n-1), starting at 1. 6
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Sequence A001651 is the "base 3" version. In base 4 this rule leads to (1,2,4,4,4...), in base 5 to (1,2,4,8,11,12,14,18,21,22,24,28...) = A235700. - M. F. Hasler, Jan 14 2014
This and the following sequences (none of which is "base"!) could all be defined by a(1) = 1 and a(n+1) = a(n) + (a(n) mod b) with different values of b: A001651 (b=3), A235700 (b=5), A047235 (b=6), A047350 (b=7), A007612 (b=9). Using b=4 or b=8 yields a constant sequence from that term on. - M. F. Hasler, Jan 15 2014
LINKS
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
EXAMPLE
28 + 8 = 36, 36 + 6 = 42.
MATHEMATICA
LinearRecurrence[{2, -2, 2, -1}, {1, 2, 4, 8, 16}, 60] (* Harvey P. Dale, Jul 02 2022 *)
PROG
(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
CROSSREFS
Apart from initial term, same as A002081.
Sequence in context: A001856 A328265 A002081 * A045844 A254062 A341817
KEYWORD
easy,nonn,base
AUTHOR
Samantha Stones (devilsdaughter2000(AT)hotmail.com), Dec 25 2004
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 27 02:41 EDT 2024. Contains 373723 sequences. (Running on oeis4.)