login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A055120 Digital complement of n (replace each nonzero digit d with 10-d). 14
0, 9, 8, 7, 6, 5, 4, 3, 2, 1, 90, 99, 98, 97, 96, 95, 94, 93, 92, 91, 80, 89, 88, 87, 86, 85, 84, 83, 82, 81, 70, 79, 78, 77, 76, 75, 74, 73, 72, 71, 60, 69, 68, 67, 66, 65, 64, 63, 62, 61, 50, 59, 58, 57, 56, 55, 54, 53, 52, 51, 40, 49, 48, 47, 46, 45, 44, 43, 42, 41, 30, 39 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,2

COMMENTS

a(n) = -n in carryless arithmetic mod 10 - that is, n + a(n) = 0 (cf. A169894). - N. J. A. Sloane, Aug 03 2010

LINKS

N. J. A. Sloane, Table of n, a(n) for n = 0..10000

David Applegate, Marc LeBrun and N. J. A. Sloane, Carryless Arithmetic (I): The Mod 10 Version.

Index entries for sequences related to carryless arithmetic

Index entries for sequences that are permutations of the natural numbers

FORMULA

From Robert Israel, Sep 04 2017: (Start)

a(10*n) = 10*a(n).

a(10*n+j) = 10*a(n) + 10 - j for 1 <= j <= 9.

G.f. g(x) satisfies g(x) = 10*(1+x+x^2+...+x^9)*g(x^10) + (9*x+8*x^2+7*x^3+6*x^4+5*x^5+4*x^6+3*x^7+2*x^8+x^9)/(1-x^10).

(End)

EXAMPLE

a(20)=80 because 2 + 8 = 0 mod 10 and 0 + 0 = 0 mod 10.

MAPLE

f:=proc(n) local t0, t1, i;

t0:=0; t1:=convert(n, base, 10);

for i from 1 to nops(t1) do

if t1[i]>0 then t0:=t0+(10-t1[i])*10^(i-1); fi;

od:

RETURN(t0);

end;

# N. J. A. Sloane, Jan 21 2011

MATHEMATICA

a[n_] := FromDigits[ IntegerDigits[n] /. d_?Positive -> 10-d]; Table[a[n], {n, 0, 100}](* Jean-Fran├žois Alcover, Nov 28 2011 *)

PROG

(Haskell)

a055120 = foldl f 0 . reverse . unfoldr g where

   f v d = if d == 0 then 10 * v else 10 * v + 10 - d

   g x = if x == 0 then Nothing else Just $ swap $ divMod x 10

-- Reinhard Zumkeller, Oct 04 2011

(PARI) a(n)=fromdigits(apply(d->if(d, 10-d, 0), digits(n))) \\ Charles R Greathouse IV, Feb 08 2017

CROSSREFS

Cf. A004488, A048647, A055115-A055126, A061601.

Column k=10 of A248813.

Sequence in context: A251984 A298372 A089186 * A090671 A132673 A107927

Adjacent sequences:  A055117 A055118 A055119 * A055121 A055122 A055123

KEYWORD

base,easy,nice,nonn

AUTHOR

Henry Bottomley, Apr 19 2000

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified February 27 11:38 EST 2021. Contains 341656 sequences. (Running on oeis4.)