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-7 of 7 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

A125292 Numbers having either no ones or no twos in their ternary representation.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 9, 10, 12, 13, 18, 20, 24, 26, 27, 28, 30, 31, 36, 37, 39, 40, 54, 56, 60, 62, 72, 74, 78, 80, 81, 82, 84, 85, 90, 91, 93, 94, 108, 109, 111, 112, 117, 118, 120, 121, 162, 164, 168, 170, 180, 182, 186, 188, 216, 218, 222, 224, 234, 236, 240, 242, 243
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 26 2006

Keywords

Comments

Complement of A125293; union of A005823 and A005836;
A125291(a(n)) = 1; A062756(a(n))*A081603(a(n)) = 0.

Crossrefs

Subsequence of A154314.

Programs

  • Mathematica
    not[n_]:=Module[{c=DigitCount[n,3]},c[[1]]==0||c[[2]]==0]; Select[ Range[ 250],not] (* Harvey P. Dale, Dec 15 2012 *)
  • PARI
    is(n, base=3) = #Set(select(sign, digits(n, base)))==1 \\ Rémy Sigrist, Mar 28 2020
    
  • PARI
    a(n, base=3) = { for (w=0, oo, if (n<=(base-1)*2^w, my (d=1+(n-1)\2^w, k=2^w+(n-1)%(2^w)); return (d*fromdigits(binary(k), base)), n -= (base-1)*2^w)) } \\ Rémy Sigrist, Mar 28 2020

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

A212193 In ternary representation of n: a(n) = if n is pandigital then 3 else least digit not used.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, May 04 2012

Keywords

Comments

a(A032924(n)) = 0; a(A081605(n)) <> 0;
a(A031944(n)) = 3; a(A154314(n)) <> 3.

Examples

			.   0 ->   '0':   a(0) = 1
.   1 ->   '1':   a(1) = 0
.   2 ->   '2':   a(2) = 0
.   3 ->  '10':   a(3) = 2
.   4 ->  '11':   a(4) = 0
.   5 ->  '12':   a(5) = 0
.   6 ->  '20':   a(6) = 1
.   7 ->  '21':   a(7) = 0
.   8 ->  '22':   a(8) = 0
.   9 -> '100':   a(9) = 2
.  10 -> '101':  a(10) = 2
.  11 -> '102':  a(11) = 3  <-- 11 is the smallest 3-pandigital number
.  12 -> '110':  a(12) = 2
.  13 -> '111':  a(13) = 0
.  14 -> '112':  a(14) = 0
.  15 -> '120':  a(15) = 3.
		

Crossrefs

Cf. A007089, A067898 (decimal).

Programs

  • Haskell
    import Data.List (delete)
    a212193 n = f n [0..3] where
       f x ys | x <= 2    = head $ delete x ys
              | otherwise = f x' $ delete d ys where (x',d) = divMod x 3

A043530 Number of distinct base-3 digits of n.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

a(A031944(n)) = 3; a(A154314(n)) < 3. - Reinhard Zumkeller, Jan 07 2009
Image, under the coding sending i -> 1+floor(i/3), of the fixed point, starting with 0, of the morphism 0 -> 012, 1 -> 314, 2 -> 542, 3 -> 336, 4 -> 644, 5 -> 565, 6 -> 666. - Jeffrey Shallit, May 15 2016

Crossrefs

Programs

  • Mathematica
    Table[Length[Union[IntegerDigits[n,3]]],{n,90}] (* Harvey P. Dale, May 13 2020 *)
  • PARI
    a(n) = #vecsort(digits(n,3),,8); \\ Michel Marcus, May 16 2016

A239348 Numbers that are not pandigital in any base b >= 3.

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, 79, 80, 81, 82, 84, 85, 90, 91, 93, 94, 109, 111, 112, 117, 118, 121, 122, 124
Offset: 1

Views

Author

Joonas Pohjonen, Mar 16 2014

Keywords

Comments

Identical to A154314 until a(51).

Examples

			11 is not in the sequence because 11 = 102_3.
		

Crossrefs

Cf. A154314.

Programs

  • Mathematica
    nop[n_] := Block[{b=3, d}, While[ Length[d = IntegerDigits[n, b]] >= b &&  Union[d] != Range[0, b-1], b++]; Length[d] < b]; Select[Range[0, 124], nop] (* Giovanni Resta, Mar 17 2014 *)
  • PARI
    isok(n) = {for (b = 3, n, d = digits(n, b); if (#vecsort(d,,8) == b, return(0));); return (1);} \\ Michel Marcus, Mar 17 2014
    
  • PARI
    is(n)=for(b=3,log(n)\lambertw(log(n))+1, if(#Set(digits(n,b))==b, return(0))); 1 \\ Charles R Greathouse IV, Mar 17 2014

Formula

a(n) >> n^1.58..., where the exponent is log(3)/log(2). - Charles R Greathouse IV, Mar 17 2014

A239437 Least number that is pandigital in some base >= n but not pandigital in bases 3 through n-1.

Original entry on oeis.org

11, 78, 698, 12280, 179685, 5518135, 1037845296, 1037845296, 46935813565, 2860727439460, 285947759601954, 1018897102759406, 672654273047783383
Offset: 3

Views

Author

Keywords

Comments

Gives an upper bound on the testing needed to check membership in A239348.

Crossrefs

Subsequence of A154314. Cf. A239348.

Programs

  • PARI
    See Greathouse link.
    
  • Python
    from itertools import permutations
    from gmpy2 import digits
    def A239437(n): # requires 3 <= n <= 62
        m = n
        while True:
            s = ''.join([digits(i,m) for i in range(m)])
            for d in permutations(s,m):
                if d[0] != '0':
                    c = mpz(''.join(d),m)
                    for b in range(3,n):
                        if len(set(digits(c,b))) == b:
                            break
                    else:
                        return int(c)
            m += 1 # Chai Wah Wu, May 31 2015

Formula

Trivially a(n) >= A049363(n) > n^(n-1).

Extensions

a(15) from Giovanni Resta, Mar 19 2014
Showing 1-7 of 7 results.