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.
%I A145204 #79 Feb 16 2025 01:18:42 %S A145204 0,3,6,12,15,21,24,27,30,33,39,42,48,51,54,57,60,66,69,75,78,84,87,93, %T A145204 96,102,105,108,111,114,120,123,129,132,135,138,141,147,150,156,159, %U A145204 165,168,174,177,183,186,189,192,195,201,204,210,213,216,219,222,228,231 %N A145204 Numbers whose representation in base 3 (A007089) ends in an odd number of zeros. %C A145204 Previous name: Complement of A007417. %C A145204 Also numbers having infinitary divisor 3, or the same, having factor 3 in their Fermi-Dirac representation as product of distinct terms of A050376. - _Vladimir Shevelev_, Mar 18 2013 %C A145204 For n > 1: where even terms occur in A051064. - _Reinhard Zumkeller_, May 23 2013 %C A145204 If we exclude a(1) = 0, these are numbers whose squarefree part is divisible by 3, which can be partitioned into numbers whose squarefree part is congruent to 3 mod 9 (A055041) and 6 mod 9 (A055040) respectively. - _Peter Munn_, Jul 14 2020 %C A145204 The inclusion of 0 as a term might be viewed as a cultural preference: if we habitually wrote numbers enclosed in brackets and then used a null string of digits for zero, the natural number sequence in ternary would be [], [1], [2], [10], [11], [12], [20], ... . - _Peter Munn_, Aug 02 2020 %C A145204 The asymptotic density of this sequence is 1/4. - _Amiram Eldar_, Sep 20 2020 %H A145204 Reinhard Zumkeller, <a href="/A145204/b145204.txt">Table of n, a(n) for n = 1..10000</a> %H A145204 Aviezri S. Fraenkel, <a href="http://dx.doi.org/10.1016/j.disc.2011.03.032">The vile, dopey, evil and odious game players</a>, Discrete Math. 312 (2012), no. 1, 42-46. %H A145204 <a href="/index/Ar#3-automatic">Index entries for 3-automatic sequences</a>. %F A145204 a(n) = 3 * A007417(n-1) for n > 1. %F A145204 A014578(a(n)) = 0. %F A145204 For n > 1, A007949(a(n)) mod 2 = 1. [Edited by _Peter Munn_, Aug 02 2020] %F A145204 {a(n) : n >= 2} = {A052330(A042964(k)) : k >= 1} = {A064614(A036554(k)) : k >= 1}. - _Peter Munn_, Aug 31 2019 and Dec 06 2020 %p A145204 isA145204 := proc(n) local d, c; %p A145204 if n = 0 then return true fi; %p A145204 d := A007089(n); c := 0; %p A145204 while irem(d, 10) = 0 do c := c+1; d := iquo(d, 10) od; %p A145204 type(c, odd) end: %p A145204 select(isA145204, [$(0..231)]); # _Peter Luschny_, Aug 05 2020 %t A145204 Select[ Range[0, 235], (# // IntegerDigits[#, 3]& // Split // Last // Count[#, 0]& // OddQ)&] (* _Jean-François Alcover_, Mar 18 2013 *) %t A145204 Join[{0}, Select[Range[235], OddQ @ IntegerExponent[#, 3] &]] (* _Amiram Eldar_, Sep 20 2020 *) %o A145204 (Haskell) %o A145204 a145204 n = a145204_list !! (n-1) %o A145204 a145204_list = 0 : map (+ 1) (findIndices even a051064_list) %o A145204 -- _Reinhard Zumkeller_, May 23 2013 %o A145204 (Python) %o A145204 import numpy as np %o A145204 def isA145204(n): %o A145204 if n == 0: return True %o A145204 c = 0 %o A145204 d = int(np.base_repr(n, base = 3)) %o A145204 while d % 10 == 0: %o A145204 c += 1 %o A145204 d //= 10 %o A145204 return c % 2 == 1 %o A145204 print([n for n in range(231) if isA145204(n)]) # _Peter Luschny_, Aug 05 2020 %o A145204 (Python) %o A145204 from sympy import integer_log %o A145204 def A145204(n): %o A145204 if n == 1: return 0 %o A145204 def bisection(f,kmin=0,kmax=1): %o A145204 while f(kmax) > kmax: kmax <<= 1 %o A145204 kmin = kmax >> 1 %o A145204 while kmax-kmin > 1: %o A145204 kmid = kmax+kmin>>1 %o A145204 if f(kmid) <= kmid: %o A145204 kmax = kmid %o A145204 else: %o A145204 kmin = kmid %o A145204 return kmax %o A145204 def f(x): return n-1+sum(((m:=x//9**i)-2)//3+(m-1)//3+2 for i in range(integer_log(x,9)[0]+1)) %o A145204 return bisection(f,n,n) # _Chai Wah Wu_, Feb 15 2025 %Y A145204 Subsequence of A008585, A028983. %Y A145204 Subsequences: A016051, A055040, A055041, A329575. %Y A145204 Cf. A007089, A007417 (complement), A050376, A182581 (characteristic function). %Y A145204 Positions of 0s in A014578. %Y A145204 Excluding 0: the positions of odd numbers in A007949; equivalently, of even numbers in A051064; symmetric difference of A003159 and A036668. %Y A145204 Related to A042964 via A052330. %Y A145204 Related to A036554 via A064614. %K A145204 nonn %O A145204 1,2 %A A145204 _Reinhard Zumkeller_, Oct 04 2008 %E A145204 New name using a comment of _Vladimir Shevelev_ by _Peter Luschny_, Aug 05 2020