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!)
A174657 Balanced ternary numbers with more negative trits than positive trits. 4

%I #16 May 06 2021 22:12:49

%S 5,14,15,17,23,41,42,43,44,45,47,50,51,53,59,68,69,71,77,95,122,123,

%T 124,125,126,127,128,129,131,132,133,134,135,137,140,141,143,149,150,

%U 151,152,153,155,158,159,161,167,176,177,179,185,203,204,205,206,207,209

%N Balanced ternary numbers with more negative trits than positive trits.

%C Numbers for which the sum of trits is negative.

%H Daniel Forgues, <a href="/A174657/b174657.txt">Table of n, a(n) for n=1..32685</a>

%t (* First run the program for A065363 to define balTernDigits *) Select[Range[210], Count[balTernDigits[#], -1] > Count[balTernDigits[#], 1] &] (* _Alonso del Arte_, Feb 26 2011 *)

%o (Python)

%o def a(n):

%o s=0

%o x=0

%o while n>0:

%o x=n%3

%o n//=3

%o if x==2:

%o x=-1

%o n+=1

%o s+=x

%o return s

%o print([n for n in range(301) if a(n)<0]) # _Indranil Ghosh_, Jun 07 2017

%Y Cf. A174658, A174659, A065363, A140267.

%K base,nonn

%O 1,1

%A _Daniel Forgues_, Mar 26 2010

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 April 23 22:36 EDT 2024. Contains 371917 sequences. (Running on oeis4.)