|
|
A145204
|
|
Numbers whose representation in base 3 (A007089) ends in an odd number of zeros.
|
|
20
|
|
|
0, 3, 6, 12, 15, 21, 24, 27, 30, 33, 39, 42, 48, 51, 54, 57, 60, 66, 69, 75, 78, 84, 87, 93, 96, 102, 105, 108, 111, 114, 120, 123, 129, 132, 135, 138, 141, 147, 150, 156, 159, 165, 168, 174, 177, 183, 186, 189, 192, 195, 201, 204, 210, 213, 216, 219, 222, 228, 231
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
Previous name: Complement of A007417.
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
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
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
The asymptotic density of this sequence is 1/4. - Amiram Eldar, Sep 20 2020
|
|
LINKS
|
|
|
FORMULA
|
|
|
MAPLE
|
isA145204 := proc(n) local d, c;
if n = 0 then return true fi;
while irem(d, 10) = 0 do c := c+1; d := iquo(d, 10) od;
type(c, odd) end:
|
|
MATHEMATICA
|
Select[ Range[0, 235], (# // IntegerDigits[#, 3]& // Split // Last // Count[#, 0]& // OddQ)&] (* Jean-François Alcover, Mar 18 2013 *)
Join[{0}, Select[Range[235], OddQ @ IntegerExponent[#, 3] &]] (* Amiram Eldar, Sep 20 2020 *)
|
|
PROG
|
(Haskell)
a145204 n = a145204_list !! (n-1)
a145204_list = 0 : map (+ 1) (findIndices even a051064_list)
(Python)
import numpy as np
def isA145204(n):
if n == 0: return True
c = 0
d = int(np.base_repr(n, base = 3))
while d % 10 == 0:
c += 1
d //= 10
return c % 2 == 1
print([n for n in range(231) if isA145204(n)]) # Peter Luschny, Aug 05 2020
|
|
CROSSREFS
|
Excluding 0: the positions of odd numbers in A007949; equivalently, of even numbers in A051064; symmetric difference of A003159 and A036668.
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|