login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A004488 Tersum n + n. 18
0, 2, 1, 6, 8, 7, 3, 5, 4, 18, 20, 19, 24, 26, 25, 21, 23, 22, 9, 11, 10, 15, 17, 16, 12, 14, 13, 54, 56, 55, 60, 62, 61, 57, 59, 58, 72, 74, 73, 78, 80, 79, 75, 77, 76, 63, 65, 64, 69, 71, 70, 66, 68, 67, 27, 29, 28, 33, 35, 34, 30, 32, 31, 45, 47, 46, 51 (list; graph; refs; listen; history; internal format)
OFFSET

0,2

COMMENTS

Could also be described as "Write n in base 3, then replace each digit by its base 3 negative" as with A048647 for base 4 - Henry Bottomley, Apr 19 2000

a(a(n)) = n, a self-inverse permutation of natural numbers. - Reinhard Zumkeller, Dec 19 2003

LINKS

Alois P. Heinz, Table of n, a(n) for n = 0..6560

Index entries for sequences that are permutations of the natural numbers

FORMULA

Tersum m + n: write m and n in base 3 and add mod 3 with no carries, e.g. 5 + 8 = "21" + "22" = "10" = 1.

a(n) = Sum(3-d(i)-3*0^d(i): n=Sum(d(i)*3^d(i): 0<=d(i)<3)); - Reinhard Zumkeller, Dec 19 2003

MAPLE

a:= proc(n) local t, r, i;

      t, r:= n, 0;

      for i from 0 while t>0 do

        r:= r+3^i *irem (2*irem (t, 3, 't'), 3)

      od; r

    end:

seq (a(n), n=0..80); # Alois P. Heinz, Sep 07 2011

CROSSREFS

Sequence in context: A026220 A138750 A048850 * A011419 A011133 A197806

Adjacent sequences:  A004485 A004486 A004487 * A004489 A004490 A004491

KEYWORD

nonn

AUTHOR

N. J. A. Sloane (njas(AT)research.att.com).

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 17 13:18 EST 2012. Contains 206031 sequences.