OFFSET
1,3
COMMENTS
10% of the nonnegative integers are in the sequence, approximatively.
LINKS
Jean-Marc Falcoz, Table of n, a(n) for n = 1..10001
Index entries for linear recurrences with constant coefficients, signature (1,0,0,0,0,0,0,0,1,-1).
FORMULA
From Robert Israel, Apr 23 2017: (Start)
a(n) = 10*n-19-9*((n-2) mod 9) for n > 1.
G.f.: (x^2+x^3+x^4+x^5+x^6+x^7+x^8+x^9+x^10+81*x^11)/(1-x-x^9+x^10). (End)
EXAMPLE
The digital root of 91 is 1 and "1" is the last digit of "91", so 91 is in the sequence.
The digital root of 90 is 9 and "9" is not the last digit of "90", so 90 is not in the sequence.
The digital root of 92 is 2 and "2" is the last digit of "92", so 92 is in the sequence.
Etc.
MAPLE
0, seq(10*x-19-9*((x-2) mod 9), x=2..100); # Robert Israel, Apr 23 2017
MATHEMATICA
dr[n_]:=NestWhile[Total[IntegerDigits[#]]&, n, #>9&]; Select[Range[ 0, 700], Mod[ #, 10]==dr[#]&] (* or *) LinearRecurrence[{1, 0, 0, 0, 0, 0, 0, 0, 1, -1}, {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 91}, 100] (* Harvey P. Dale, Aug 20 2021 *)
PROG
(PARI) a(n)=if(n==1, 0, n--; 90*((n-1)\9)+(n-1)%9+1) \\ David A. Corneth, Apr 21 2017
(PARI) nxt(n) = if((n-1)%9+1==9&&n, n+82, n+1) \\ David A. Corneth, Apr 21 2017
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Eric Angelini and Jean-Marc Falcoz, Apr 12 2017
STATUS
approved