login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A174658 Balanced ternary numbers with equal count of negative trits and positive trits. 12
0, 2, 6, 8, 16, 18, 20, 24, 26, 32, 46, 48, 52, 54, 56, 60, 62, 70, 72, 74, 78, 80, 86, 96, 98, 104, 130, 136, 138, 142, 144, 146, 154, 156, 160, 162, 164, 168, 170, 178, 180, 182, 186, 188, 194, 208, 210, 214, 216, 218, 222, 224, 232, 234, 236, 240, 242, 248, 258 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

Numbers for which the sum of trits is zero.

LINKS

Daniel Forgues, Table of n, a(n) for n=1..14309

MATHEMATICA

(* First run the program for A065363 to define balTernDigits *) A174658 = Select[Range[0, 299], Plus@@balTernDigits[#] == 0 &] (* Alonso del Arte, Feb 24 2011 *)

PROG

(Python)

def a(n):

    s=0

    x=0

    while n>0:

        x=n%3

        n //= 3

        if x==2:

            x=-1

            n+=1

        s+=x

    return s

print([n for n in range(301) if a(n)==0]) # Indranil Ghosh, Jun 07 2017

CROSSREFS

Cf. A174657, A174659, A065363, A140267, A257869.

Sequence in context: A278834 A336896 A306906 * A326300 A266074 A191822

Adjacent sequences:  A174655 A174656 A174657 * A174659 A174660 A174661

KEYWORD

base,nonn

AUTHOR

Daniel Forgues, Mar 26 2010

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 26 02:05 EDT 2022. Contains 356986 sequences. (Running on oeis4.)