OFFSET
0,1
LINKS
Nathaniel Johnston, Table of n, a(n) for n = 0..10000
FORMULA
EXAMPLE
a(17) = 28. Digit reversal of 17 = 71, 9's complement of 71 is 99-71 = 28.
MAPLE
R := proc(n) local nn, nnn: nn:=convert(n, base, 10): add(nn[nops(nn)+1-j]*10^(j-1), j=1..nops(nn)): end:
A109910 := proc(n) return 10^length(max(R(n), 1)) - R(n) - 1: end:
seq(A109910(n), n=0..70); # Nathaniel Johnston, Apr 28 2011
MATHEMATICA
Table[10^If[# == 0, 1, IntegerLength@ #] - 1 - # &@ FromDigits@ Reverse@ IntegerDigits@ n, {n, 0, 70}] (* Michael De Vlieger, Feb 01 2017 *)
PROG
(Python)
def A109910(n):
....x=int(str(n)[::-1])
....return 10**len(str(x))-1-x # Indranil Ghosh, Jan 30 2017
CROSSREFS
KEYWORD
AUTHOR
Amarnath Murthy, Jul 16 2005
STATUS
approved