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-4 of 4 results.

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

A061392 a(n) = a(floor(n/3)) + a(ceiling(n/3)) with a(0) = 0 and a(1) = 1.

Original entry on oeis.org

0, 1, 1, 2, 2, 2, 2, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 10, 10, 10, 10, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 14, 14, 14, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16
Offset: 0

Views

Author

Henry Bottomley, Apr 30 2001

Keywords

Comments

Number of nonnegative integers < n having no 1 in their ternary representation. - Reinhard Zumkeller, Mar 23 2003; corrected by Henry Bottomley, Mar 24 2003

Crossrefs

k appears A061393(k) times.
Essentially the partial sums of A088917.

Programs

Formula

a(n+1) + A081609(n) = n+1. - Reinhard Zumkeller, Mar 23 2003; corrected by Henry Bottomley, Mar 24 2003
From Johannes W. Meijer, Jun 05 2011: (Start)
a(3*n+1) = a(n+1) + a(n), a(3*n+2) = a(n+1) + a(n) and a(3*n+3) = 2*a(n+1), for n>=1, with a(0)=0, a(1)=1, a(2)=1 and a(3)=2. [Northshield]
G.f.: x*Product_{n>=0} (1 + x^(3^n) + 2*x^(2*3^n) + x^(3*3^n) + x^(4*3^n)). [Northshield] (End)
Apparently, for any n >= 0 and k such that n < 3^k, a(n) = 2^k * c(n / 3^k) where c is the Cantor function. - Rémy Sigrist, Jul 12 2019

A081610 Number of numbers <= n having at least one 2 in their ternary representation.

Original entry on oeis.org

0, 0, 1, 1, 1, 2, 3, 4, 5, 5, 5, 6, 6, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 19, 19, 20, 20, 20, 21, 22, 23, 24, 24, 24, 25, 25, 25, 26, 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
Offset: 0

Views

Author

Reinhard Zumkeller, Mar 23 2003

Keywords

Comments

a(n) + A081611(n) = n+1. Partial sums of A189820.

Crossrefs

Programs

  • Maple
    num2tern := proc(n) return numboccur(convert(n,base,3),2): end: a:=0: for n from 0 to 80 do a:=a+`if`(num2tern(n)>0,1,0): printf("%d, ",a): od: # Nathaniel Johnston, May 17 2011
  • Mathematica
    Accumulate[Table[If[DigitCount[n,3,2]>0,1,0],{n,0,70}]] (* Harvey P. Dale, Aug 20 2012 *)
  • PARI
    first(n)=my(s,t); vector(n,k,t=Set(digits(k,3)); s+=t[#t]==2) \\ Charles R Greathouse IV, Sep 02 2015
    
  • Python
    from gmpy2 import digits
    def A081610(n):
        l = (s:=digits(n,3)).find('2')
        if l >= 0: s = s[:l]+'1'*(len(s)-l)
        return n-int(s,2) # Chai Wah Wu, Dec 05 2024

Formula

a(n) ~ n. - Charles R Greathouse IV, Sep 02 2015

A081607 Number of numbers <= n having at least one 0 in their ternary representation.

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 5, 6, 7, 7, 7, 8, 8, 8, 9, 10, 11, 12, 12, 12, 13, 13, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 26, 26, 27, 27, 27, 28, 29, 30, 31, 31, 31, 32, 32, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 45, 45, 46, 46, 46, 47, 48, 49, 50
Offset: 0

Views

Author

Reinhard Zumkeller, Mar 23 2003

Keywords

Comments

a(n) + A081608(n) = n+1.

Crossrefs

Programs

  • Maple
    f:= n -> `if`(has(convert(n,base,3),0),1,0):
    ListTools:-PartialSums(map(f, [$0..100])); # Robert Israel, Mar 18 2018
  • Mathematica
    Accumulate[Boole[Table[DigitCount[n,3,0]>0,{n,0,80}]]] (* Harvey P. Dale, Jun 23 2017 *)
  • PARI
    first(n)=my(s,t); vector(n,k, t=Set(digits(k,3)); s+=(t[1]==0)) \\ Charles R Greathouse IV, Sep 02 2015
Showing 1-4 of 4 results.