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-10 of 14 results. Next

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

A077267 Number of zeros in base-3 expansion of n.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Nov 01 2002

Keywords

Examples

			a(8)=0 since 8 written in base 3 is 22 with 0 zeros;
a(9)=2 since 9 written in base 3 is 100 with 2 zeros;
a(10)=1 since 10 written in base 3 is 101 with 1 zero.
		

Crossrefs

Programs

Formula

a(1)=a(2)=0; a(3n)=a(n)+1; a(3n+1)=a(3n+2)=a(n). a(3^n-2)=a(3^n-1)=0; a(3^n)=n. a(n)=A077266(n, 3).
a(n) + A062756(n) + A081603(n) = A081604(n). - Reinhard Zumkeller, Mar 23 2003
G.f.: (Sum_{k>=0} x^(3^(k+1))/(1 + x^(3^k) + x^(2*3^k)))/(1-x). - Franklin T. Adams-Watters, Nov 03 2005
a(n) = A079978(n) if n < 3, A079978(n) + a(floor(n/3)) otherwise. - Reinhard Zumkeller, Feb 21 2013

Extensions

a(0)=1 added, offset changed to 0 and b-file adjusted by Reinhard Zumkeller, Feb 21 2013
Wrong formula deleted by Reinhard Zumkeller, Feb 21 2013

A074940 Numbers having at least one 2 in their ternary representation.

Original entry on oeis.org

2, 5, 6, 7, 8, 11, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 29, 32, 33, 34, 35, 38, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 83, 86, 87, 88, 89, 92
Offset: 1

Views

Author

Benoit Cloitre and Reinhard Zumkeller, Oct 04 2002; revised Dec 03 2003

Keywords

Comments

Also, numbers m such that 3 divides C(2m,m).
Also, numbers m such that the central trinomial coefficient A002426(m) == 0 (mod 3). - Emeric Deutsch and Bruce E. Sagan, Dec 04 2003
Also, numbers m such that A092255(m) == 0 (mod 3). - Benoit Cloitre, Mar 22 2004
Also, numbers m such that the coefficient of x^m equals 0 in Product_{k>=0} (1-x^(3^k)). - N. J. A. Sloane, Jun 01 2010

Examples

			12 is not in the sequence since it is 110_3, but 11 is in the sequence since it is 102_3. - _Michael B. Porter_, Jun 30 2016
		

Crossrefs

Complement of A005836.
A039966(a(n)) = 0.

Programs

  • Haskell
    a074940 n = a074940_list !! (n-1)
    a074940_list = filter ((== 0) . a039966) [0..]
    -- Reinhard Zumkeller, Jun 06 2012, Sep 29 2011
    
  • Mathematica
    Select[Range@ 120, MemberQ[IntegerDigits[#, 3], 2] &] (* or *)
    Select[Range@ 120, Divisible[Binomial[2 #, #], 3] &] (* Michael De Vlieger, Jun 29 2016 *)
    Select[Range[100],DigitCount[#,3,2]>0&] (* Harvey P. Dale, Aug 25 2019 *)
  • PARI
    is(n)=while(n,if(n%3==2,return(1));n\=3);0 \\ Charles R Greathouse IV, Aug 21 2011
    
  • Python
    from gmpy2 import digits
    def A074940(n):
        def f(x):
            s = digits(x,3)
            for i in range(l:=len(s)):
                if s[i]>'1':
                    break
            else:
                return n+int(s,2)
            return n+int(s[:i]+'1'*(l-i),2)
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return m # Chai Wah Wu, Oct 29 2024

Formula

a(n) = n + O(n^0.631). - Charles R Greathouse IV, Aug 21 2011

Extensions

More terms from Emeric Deutsch and Bruce E. Sagan, Dec 04 2003

A081606 Numbers having at least one 1 in their ternary representation.

Original entry on oeis.org

1, 3, 4, 5, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 19, 21, 22, 23, 25, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 55, 57, 58, 59, 61, 63, 64, 65, 66, 67, 68, 69, 70, 71, 73, 75, 76, 77, 79, 81, 82, 83, 84, 85, 86
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 23 2003

Keywords

Comments

Complement of A005823.
Integers m such that central Delannoy number A001850(m) == 0 (mod 3). - Emeric Deutsch and Bruce E. Sagan, Dec 04 2003
Integers m such that A026375(m) == 0 (mod 3). - Fabio Visonà, Aug 03 2023

Crossrefs

Programs

  • Mathematica
    Select[Range[100],DigitCount[#,3,1]>0&] (* Harvey P. Dale, Nov 26 2022 *)
  • Python
    from itertools import count, islice
    def A081606_gen(): # generator of terms
        a = 0
        for n in count(1):
            b = int(bin(n)[2:],3)<<1
            yield from range(a+1,b)
            a = b
    A081606_list = list(islice(A081606_gen(),30)) # Chai Wah Wu, Oct 13 2023
    
  • Python
    from gmpy2 import digits
    def A081606(n):
        def f(x):
            s = digits(x>>1,3)
            for i in range(l:=len(s)):
                if s[i]>'1':
                    break
            else:
                return n+int(s,2)
            return n-1+(int(s[:i] or '0',2)+1<Chai Wah Wu, Oct 29 2024

Extensions

More terms from Emeric Deutsch and Bruce E. Sagan, Dec 04 2003

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

A382413 Numbers with at least one zero in their base-7 representation.

Original entry on oeis.org

0, 7, 14, 21, 28, 35, 42, 49, 50, 51, 52, 53, 54, 55, 56, 63, 70, 77, 84, 91, 98, 99, 100, 101, 102, 103, 104, 105, 112, 119, 126, 133, 140, 147, 148, 149, 150, 151, 152, 153, 154, 161, 168, 175, 182, 189, 196, 197, 198, 199, 200, 201, 202, 203, 210, 217, 224, 231, 238
Offset: 1

Views

Author

Paolo Xausa, Mar 24 2025

Keywords

Crossrefs

Cf. analogous sequences in other bases: A062289 (base 2), A081605 (base 3), A196032 (base 4), A382415 (base 5), A382416 (base 6), A382417 (base 8), A382418 (base 9), A011540 (base 10).
Cf. A007093, A043393, A382412 (complement).

Programs

  • Mathematica
    Select[Range[0, 250], DigitCount[#, 7, 0] > 0 &]

A370916 Positive integers whose ternary representation includes at least one 0, and every 0 is followed by 1.

Original entry on oeis.org

10, 19, 31, 32, 37, 46, 58, 59, 64, 73, 91, 94, 95, 97, 98, 112, 113, 118, 127, 139, 140, 145, 154, 172, 175, 176, 178, 179, 193, 194, 199, 208, 220, 221, 226, 235, 274, 275, 280, 283, 284, 286, 287, 289, 292, 293, 295, 296, 334, 337, 338, 340, 341, 355, 356
Offset: 1

Views

Author

Clark Kimberling, Mar 13 2024

Keywords

Examples

			The ternary representations of 10, 19, and 31 are 101, 201, and 1011.
		

Crossrefs

Programs

  • Mathematica
    Map[#[[1]] &, Select[Map[{#, #[[1]] > 0 && #[[1]] == #[[2]] &[{Length[
    StringCases[#, "0"]], Length[StringCases[#, "01"]]}] &[
    IntegerString[#, 3]]} &, Range[500]], #[[2]] &]]
     (* Peter J. C. Moses, Mar 05 2024 *)

A370917 Positive integers whose ternary representation includes at least one 0, and every 0 is followed by 2.

Original entry on oeis.org

11, 20, 34, 35, 38, 47, 61, 62, 65, 74, 101, 103, 104, 106, 107, 115, 116, 119, 128, 142, 143, 146, 155, 182, 184, 185, 187, 188, 196, 197, 200, 209, 223, 224, 227, 236, 304, 305, 308, 310, 311, 313, 314, 317, 319, 320, 322, 323, 344, 346, 347, 349, 350, 358
Offset: 1

Views

Author

Clark Kimberling, Mar 15 2024

Keywords

Examples

			The ternary representations of 11, 20, and 34 are 102, 202, and 1021.
		

Crossrefs

Programs

  • Mathematica
    Map[#[[1]] &, Select[Map[{#, #[[1]] > 0 && #[[1]] == #[[2]] &[{Length[
    StringCases[#, "0"]], Length[StringCases[#, "02"]]}] &[
    IntegerString[#, 3]]} &, Range[500]], #[[2]] &]]
      (* Peter J. C. Moses, Mar 05 2024 *)

A382415 Numbers with at least one zero in their base-5 representation.

Original entry on oeis.org

0, 5, 10, 15, 20, 25, 26, 27, 28, 29, 30, 35, 40, 45, 50, 51, 52, 53, 54, 55, 60, 65, 70, 75, 76, 77, 78, 79, 80, 85, 90, 95, 100, 101, 102, 103, 104, 105, 110, 115, 120, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145
Offset: 1

Views

Author

Paolo Xausa, Mar 25 2025

Keywords

Crossrefs

Cf. analogous sequences in other bases: A062289 (base 2), A081605 (base 3), A196032 (base 4), A382416 (base 6), A382413 (base 7), A382417 (base 8), A382418 (base 9), A011540 (base 10).
Cf. A007091, A023721 (complement), A023722.

Programs

  • Mathematica
    Select[Range[0, 150], DigitCount[#, 5, 0] > 0 &]

A382416 Numbers with at least one zero in their base-6 representation.

Original entry on oeis.org

0, 6, 12, 18, 24, 30, 36, 37, 38, 39, 40, 41, 42, 48, 54, 60, 66, 72, 73, 74, 75, 76, 77, 78, 84, 90, 96, 102, 108, 109, 110, 111, 112, 113, 114, 120, 126, 132, 138, 144, 145, 146, 147, 148, 149, 150, 156, 162, 168, 174, 180, 181, 182, 183, 184, 185, 186, 192, 198
Offset: 1

Views

Author

Paolo Xausa, Mar 25 2025

Keywords

Crossrefs

Cf. analogous sequences in other bases: A062289 (base 2), A081605 (base 3), A196032 (base 4), A382415 (base 5), A382413 (base 7), A382417 (base 8), A382418 (base 9), A011540 (base 10).
Cf. A007092, A043369, A248910 (complement).

Programs

  • Mathematica
    Select[Range[0, 200], DigitCount[#, 6, 0] > 0 &]
Showing 1-10 of 14 results. Next