A235499 For k in {2,3,...,9} define a sequence as follows: a(0)=0; for n>=0, a(n+1)=a(n)+1, unless a(n) ends in k, in which case a(n+1) is obtained by replacing the last digit of a(n) with the digit(s) of k^2. This is k(3).
0, 1, 2, 3, 9, 10, 11, 12, 13, 19, 20, 21, 22, 23, 29, 30, 31, 32, 33, 39, 40, 41, 42, 43, 49, 50, 51, 52, 53, 59, 60, 61, 62, 63, 69, 70, 71, 72, 73, 79, 80, 81, 82, 83, 89, 90, 91, 92, 93, 99, 100, 101, 102, 103, 109, 110, 111, 112, 113, 119, 120, 121, 122, 123, 129
Offset: 0
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (1,0,0,0,1,-1).
Programs
-
Mathematica
CoefficientList[Series[(x^5 + 6 x^4 + x^3 + x^2 + x)/(x^6 - x^5 - x + 1), {x, 0, 50}], x] (* Vincenzo Librandi, Feb 08 2014 *) nxt[n_]:=If[Mod[n,10]==3,FromDigits[Join[Most[IntegerDigits[n]],{9}]], n+ 1]; NestList[nxt,0,70] (* or *) LinearRecurrence[{1,0,0,0,1,-1},{0,1,2,3,9,10},70] (* Harvey P. Dale, Oct 02 2016 *)
Formula
G.f.: (x^5+6*x^4+x^3+x^2+x)/(x^6-x^5-x+1). - Alois P. Heinz, Feb 07 2014
Extensions
Definition by N. J. A. Sloane, Feb 07 2014