OFFSET
1,2
COMMENTS
The main sequence is A331786; this is added because some people may search for this.
LINKS
Jianing Song, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,0,0,0,0,0,0,0,10,-10).
FORMULA
If n = 9*s + t, 1 <= t <= 9, then a(n) = 10^s*(2*t-gcd(t,9)+1) - 1. See A331787 for a proof of the formula in base b.
a(n) = A331786(n) + 1.
Conjectures from Colin Barker, Jan 26 2020: (Start)
G.f.: x*(1 + 2*x + 4*x^3 + 2*x^4 + 4*x^6 + 2*x^7 - 6*x^8) / ((1 - x)*(1 - 10*x^9)).
a(n) = a(n-1) + 10*a(n-9) - 10*a(n-10) for n>10.
(End) [This conjecture is correct.]
a(n) = O(10^(n/9)).
EXAMPLE
See A331786.
PROG
(PARI) a(n) = my(s=(n-1)\9, t=(n-1)%9+1); 10^s*(2*t-gcd(t, 9)+1)-1
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Jianing Song, Jan 25 2020
STATUS
approved