cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A174658 Balanced ternary numbers with equal count of negative trits and positive trits.

This page as a plain text file.
%I A174658 #17 Apr 28 2021 10:10:53
%S A174658 0,2,6,8,16,18,20,24,26,32,46,48,52,54,56,60,62,70,72,74,78,80,86,96,
%T A174658 98,104,130,136,138,142,144,146,154,156,160,162,164,168,170,178,180,
%U A174658 182,186,188,194,208,210,214,216,218,222,224,232,234,236,240,242,248,258
%N A174658 Balanced ternary numbers with equal count of negative trits and positive trits.
%C A174658 Numbers for which the sum of trits is zero.
%H A174658 Daniel Forgues, <a href="/A174658/b174658.txt">Table of n, a(n) for n=1..14309</a>
%t A174658 (* First run the program for A065363 to define balTernDigits *) A174658 = Select[Range[0, 299], Plus@@balTernDigits[#] == 0 &] (* _Alonso del Arte_, Feb 24 2011 *)
%o A174658 (Python)
%o A174658 def a(n):
%o A174658     s=0
%o A174658     x=0
%o A174658     while n>0:
%o A174658         x=n%3
%o A174658         n //= 3
%o A174658         if x==2:
%o A174658             x=-1
%o A174658             n+=1
%o A174658         s+=x
%o A174658     return s
%o A174658 print([n for n in range(301) if a(n)==0]) # _Indranil Ghosh_, Jun 07 2017
%Y A174658 Cf. A174657, A174659, A065363, A140267, A257869.
%K A174658 base,nonn
%O A174658 1,2
%A A174658 _Daniel Forgues_, Mar 26 2010