OFFSET
1,2
COMMENTS
a(1)=1; a(n)=n*[10...0 - a(n-1)] for n>1 (00...0 and a[n-1] have the same number of digits). - Emeric Deutsch, Jul 31 2005
LINKS
Sidney Cadot, Table of n, a(n) for n = 1..200
EXAMPLE
a(4) = 4* 10's complement of a(3) = 4*(1000-246) = 3016.
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])-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<2, n,
n*(p-> 10^length(p)-p)(a(n-1)))
end:
seq(a(n), n=1..25); # Alois P. Heinz, Sep 22 2015
MATHEMATICA
a110395[numTerms_] := Block[{complement, a},
complement[n_] := 10^IntegerLength[n] - n;
a[n_] := a[n] = If[n == 1, 1, n*complement[a[n - 1]]];
Table[a[n], {n, 1, numTerms}
]]; (* Sidney Cadot, Sep 22 2015 *)
a110395[50]
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Amarnath Murthy, Jul 29 2005
EXTENSIONS
More terms from Emeric Deutsch, Jul 31 2005
Incorrect formula and corresponding Mathematica program removed by Sidney Cadot, Sep 22 2015
STATUS
approved