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.

Showing 1-5 of 5 results.

A032924 Numbers whose ternary expansion contains no 0.

Original entry on oeis.org

1, 2, 4, 5, 7, 8, 13, 14, 16, 17, 22, 23, 25, 26, 40, 41, 43, 44, 49, 50, 52, 53, 67, 68, 70, 71, 76, 77, 79, 80, 121, 122, 124, 125, 130, 131, 133, 134, 148, 149, 151, 152, 157, 158, 160, 161, 202, 203, 205, 206, 211, 212, 214, 215, 229, 230, 232, 233, 238, 239
Offset: 1

Views

Author

Keywords

Comments

Complement of A081605. - Reinhard Zumkeller, Mar 23 2003
Subsequence of A154314. - Reinhard Zumkeller, Jan 07 2009
The first 28 terms are the range of A059852 (Morse codes for letters, when written in base 3) union {44, 50} (which correspond to Morse codes of Ü and Ä). Subsequent terms represent the Morse code of other symbols in the same coding. - M. F. Hasler, Jun 22 2020

Crossrefs

Zeroless numbers in some other bases <= 10: A000042 (base 2), A023705 (base 4), A248910 (base 6), A255805 (base 8), A255808 (base 9), A052382 (base 10).

Programs

  • Haskell
    a032924 n = a032924_list !! (n-1)
    a032924_list = iterate f 1 where
       f x = 1 + if r < 2 then x else 3 * f x'  where (x', r) = divMod x 3
    -- Reinhard Zumkeller, Mar 07 2015, May 04 2012
    
  • Maple
    f:= proc(n) local L,i,m;
       L:= convert(n,base,2);
       m:= nops(L);
       add((1+L[i])*3^(i-1),i=1..m-1);
    end proc:
    map(f, [$2..101]); # Robert Israel, Aug 04 2015
  • Mathematica
    Select[Range@ 240, Last@ DigitCount[#, 3] == 0 &] (* Michael De Vlieger, Aug 05 2015 *)
    Flatten[Table[FromDigits[#,3]&/@Tuples[{1,2},n],{n,5}]] (* Harvey P. Dale, May 28 2016 *)
  • PARI
    apply( {A032924(n)=if(n<3,n,3*self()((n-1)\2)+2-n%2)}, [1..99]) \\ M. F. Hasler, Jun 22 2020
    
  • PARI
    a(n) = fromdigits(apply(d->d+1,binary(n+1)[^1]), 3); \\ Kevin Ryde, Jun 23 2020
    
  • Python
    def a(n): return sum(3**i*(int(b)+1) for i, b in enumerate(bin(n+1)[:2:-1]))
    print([a(n) for n in range(1, 61)]) # Michael S. Branicky, Aug 15 2022
    
  • Python
    def is_A032924(n):
        while n > 2:
           n,r = divmod(n,3)
           if r==0: return False
        return n > 0
    print([n for n in range(250) if is_A032924(n)]) # M. F. Hasler, Feb 15 2023
    
  • Python
    def A032924(n): return int(bin(m:=n+1)[3:],3) + (3**(m.bit_length()-1)-1>>1) # Chai Wah Wu, Oct 13 2023

Formula

a(n) = A107680(n) + A107681(n). - Reinhard Zumkeller, May 20 2005
A081604(A107681(n)) <= A081604(A107680(n)) = A081604(a(n)) = A000523(n+1). - Reinhard Zumkeller, May 20 2005
A077267(a(n)) = 0. - Reinhard Zumkeller, Mar 02 2008
a(1)=1, a(n+1) = f(a(n)+1,a(n)+1) where f(x,y) = if x<3 and x<>0 then y, else if x mod 3 = 0 then f(y+1,y+1), else f(floor(x/3),y). - Reinhard Zumkeller, Mar 02 2008
a(2*n) = a(2*n-1)+1, n>0. - Zak Seidov, Jul 27 2009
A212193(a(n)) = 0. - Reinhard Zumkeller, May 04 2012
a(2*n+1) = 3*a(n)+1. - Robert Israel, Aug 05 2015
G.f.: x/(1-x)^2 + Sum_{m >= 1} 3^(m-1)*x^(2^(m+1)-1)/((1-x^(2^m))*(1-x)). - Robert Israel, Aug 04 2015
A065361(a(n)) = n. - Rémy Sigrist, Feb 06 2023
Sum_{n>=1} 1/a(n) = 3.4977362637842652509313189236131190039368413460747606236619907531632476445332666030262441154353753276457... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Apr 14 2025

A081605 Numbers having at least one 0 in their ternary representation.

Original entry on oeis.org

0, 3, 6, 9, 10, 11, 12, 15, 18, 19, 20, 21, 24, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 42, 45, 46, 47, 48, 51, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 69, 72, 73, 74, 75, 78, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 23 2003

Keywords

Comments

Complement of A032924.
A212193(a(n)) <> 0. [Reinhard Zumkeller, May 04 2012]

Crossrefs

Programs

  • Haskell
    import Data.List (findIndices)
    a081605 n = a081605_list !! (n-1)
    a081605_list = findIndices (/= 0) a212193_list
    -- Reinhard Zumkeller, May 04 2012
    
  • Mathematica
    Select[Range[0,100],DigitCount[#,3,0]>0&] (* Harvey P. Dale, Aug 10 2021 *)
  • Python
    from itertools import count, islice
    def A081605_gen(): # generator of terms
        a = -1
        for n in count(2):
            b = int(bin(n)[3:],3) + (3**(n.bit_length()-1)-1>>1)
            yield from range(a+1,b)
            a = b
    A081605_list = list(islice(A081605_gen(),30)) # Chai Wah Wu, Oct 13 2023

A154314 Numbers with not more than two distinct digits in ternary representation.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 16, 17, 18, 20, 22, 23, 24, 25, 26, 27, 28, 30, 31, 36, 37, 39, 40, 41, 43, 44, 49, 50, 52, 53, 54, 56, 60, 62, 67, 68, 70, 71, 72, 74, 76, 77, 78, 79, 80, 81, 82, 84, 85, 90, 91, 93, 94, 108, 109, 111, 112, 117, 118, 120, 121, 122
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 07 2009

Keywords

Crossrefs

Complement of A031944.
Union of A032924, A005823 and A005836.

Programs

  • Haskell
    import Data.List (findIndices)
    a154314 n = a154314_list !! (n-1)
    a154314_list = findIndices (/= 3) a212193_list
    -- Reinhard Zumkeller, May 04 2012
    
  • Mathematica
    Select[Range[0,200],Length[Union[IntegerDigits[#,3]]]<3&] (* Harvey P. Dale, Nov 23 2012 *)
  • PARI
    is(n)=#Set(digits(n,3))<3 \\ Charles R Greathouse IV, Mar 17 2014

Formula

A043530(a(n)) <= 2.
A212193(a(n)) <> 3. - Reinhard Zumkeller, May 04 2012
a(n) >> n^1.58..., where the exponent is log(3)/log(2). - Charles R Greathouse IV, Mar 17 2014
Sum_{n>=2} 1/a(n) = 5.47555542241781419692840472181029603722178623821762258873485212626135391726959422416350447132335696748507... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Apr 14 2025

A031944 Numbers in which digits 0,1,2 all occur in base 3.

Original entry on oeis.org

11, 15, 19, 21, 29, 32, 33, 34, 35, 38, 42, 45, 46, 47, 48, 51, 55, 57, 58, 59, 61, 63, 64, 65, 66, 69, 73, 75, 83, 86, 87, 88, 89, 92, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 110, 113, 114, 115, 116, 119, 123, 126, 127, 128, 129, 132, 135
Offset: 1

Views

Author

Keywords

Comments

A043530(a(n)) = 3; complement of A154314. - Reinhard Zumkeller, Jan 07 2009
A212193(a(n)) = 3. - Reinhard Zumkeller, May 04 2012

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a031944 n = a031944_list !! (n-1)
    a031944_list = elemIndices 3 a212193_list
    -- Reinhard Zumkeller, May 04 2012
    
  • Mathematica
    Select[Range[200],Min[DigitCount[#,3]]>0&] (* Harvey P. Dale, Nov 21 2015 *)
  • Python
    from sympy.ntheory import count_digits
    def ok(n): c = count_digits(n, 3); return all(c[d] > 0 for d in [0, 1, 2])
    print([k for k in range(136) if ok(k)]) # Michael S. Branicky, Nov 15 2021

A067898 Least digit not used in n (or 10 if n is pandigital).

Original entry on oeis.org

1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 3, 2, 2
Offset: 0

Views

Author

Rick L. Shepherd, May 13 2003

Keywords

Comments

a(A050278(1)) = a(1023456789) = 10, the first term with that value, as 1023456789 is the first base 10 pandigital number.
a(A052382(n)) = 0; a(A011540(n)) > 0. [Reinhard Zumkeller, May 04 2012]

Examples

			a(10)=2 because decimal digits 0 and 1 are both used in 10, a(102)=3 because decimal digits 0, 1 and 2 are used in 102.
		

Crossrefs

Cf. A050278 (pandigital numbers).
Cf. A212193 (ternary).

Programs

  • Haskell
    import Data.List (delete)
    a067898 n = f n [0..10] where
       f x ys | x <= 9    = head $ delete x ys
              | otherwise = f x' $ delete d ys where (x',d) = divMod x 10
    -- Reinhard Zumkeller, May 04 2012
    
  • Python
    def A067898(n):
        s = set(str(n))
        for i in range(10):
            if str(i) not in s:
                return i
        return 10 # Chai Wah Wu, Apr 13 2024
Showing 1-5 of 5 results.