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

 

Logo

Annual Appeal: Please make a donation to keep the OEIS running. In 2018 we replaced the server with a faster one, added 20000 new sequences, and reached 7000 citations (often saying "discovered thanks to the OEIS").
Other ways to donate

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A140268 a(n) = negative integer -n presented in balanced ternary system. 2
2, 21, 20, 22, 211, 210, 212, 201, 200, 202, 221, 220, 222, 2111, 2110, 2112, 2101, 2100, 2102, 2121, 2120, 2122, 2011, 2010, 2012, 2001, 2000, 2002, 2021, 2020, 2022, 2211, 2210, 2212, 2201, 2200, 2202, 2221, 2220, 2222, 21111, 21110, 21112 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

Sequence A117968 in ternary. (See there for more references.)

LINKS

Table of n, a(n) for n=1..43.

EXAMPLE

For example a(2) = 21, as -2 = -1*3 + 1*1.

Similarly, a(19) = 2102, as -19 = -1*27 + 1*9 + 0*3 + -1*1.

PROG

(Python)

from sympy.ntheory.factor_ import digits

def a117968(n):

    if n==1: return 2

    if n%3==0: return 3*a117968(n/3)

    elif n%3==1: return 3*a117968((n - 1)/3) + 2

    else: return 3*a117968((n + 1)/3) + 1

def a(n): return int("".join(map(str, digits(a117968(n), 3)[1:]))) # Indranil Ghosh, Jun 06 2017

CROSSREFS

a(n) = A007089(A117968(n)). Cf. A140267.

Sequence in context: A212483 A084313 A074769 * A106422 A320523 A171549

Adjacent sequences:  A140265 A140266 A140267 * A140269 A140270 A140271

KEYWORD

nonn,base

AUTHOR

Antti Karttunen, May 19 2008, prompted by Eric Angelini's posting on SeqFan mailing list on Sep 15 2005.

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 December 13 05:16 EST 2018. Contains 318082 sequences. (Running on oeis4.)