OFFSET
1,2
COMMENTS
a(1)=1; a(n)=n*[99...9 - a(n-1)] for n>1 (99...9 and a[n-1] have the same number of digits). - Emeric Deutsch, Jul 31 2005
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..400
EXAMPLE
a(4) = 4 times 9's complement of a(3) = 4*(999-249) = 3000.
MAPLE
s:=proc(m) nops(convert(m, base, 10)) end: a[1]:=1: for n from 2 to 21 do a[n]:=n*(10^s(a[n-1])-1-a[n-1]) od: seq(a[n], n=1..21); # Emeric Deutsch, Jul 31 2005
# second Maple program:
a:= proc(n) option remember; `if`(n=1, 1,
n*(p-> 10^length(p)-1-p)(a(n-1)))
end:
seq(a(n), n=1..30); # Alois P. Heinz, Sep 22 2015
MATHEMATICA
nxt[{n_, a_}]:={n+1, (n+1)(FromDigits[PadRight[{}, IntegerLength[a], 9]]-a)}; NestList[nxt, {1, 1}, 20][[;; , 2]] (* Harvey P. Dale, Mar 13 2024 *)
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Amarnath Murthy, Jul 29 2005
EXTENSIONS
More terms from Emeric Deutsch, Jul 31 2005
STATUS
approved