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

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

A083093 Triangle, read by rows, formed by reading Pascal's triangle (A007318) mod 3.

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, Apr 22 2003

Keywords

Comments

Start with [1], repeatedly apply the map 0 -> [000/000/000], 1 -> [111/120/100], 2 -> [222/210/200]. - Philippe Deléham, Apr 16 2009
{T(n,k)} is a fractal gasket with fractal (Hausdorff) dimension log(A000217(3))/log(3) = log(6)/log(3) = 1.63092... (see Reiter reference). Replacing values greater than 1 with 1 produces a binary gasket with the same dimension (see Bondarenko reference). - Richard L. Ollerton, Dec 14 2021

Examples

			.            Rows 0 .. 3^3:
.    0:                             1
.    1:                            1 1
.    2:                           1 2 1
.    3:                          1 0 0 1
.    4:                         1 1 0 1 1
.    5:                        1 2 1 1 2 1
.    6:                       1 0 0 2 0 0 1
.    7:                      1 1 0 2 2 0 1 1
.    8:                     1 2 1 2 1 2 1 2 1
.    9:                    1 0 0 0 0 0 0 0 0 1
.   10:                   1 1 0 0 0 0 0 0 0 1 1
.   11:                  1 2 1 0 0 0 0 0 0 1 2 1
.   12:                 1 0 0 1 0 0 0 0 0 1 0 0 1
.   13:                1 1 0 1 1 0 0 0 0 1 1 0 1 1
.   14:               1 2 1 1 2 1 0 0 0 1 2 1 1 2 1
.   15:              1 0 0 2 0 0 1 0 0 1 0 0 2 0 0 1
.   16:             1 1 0 2 2 0 1 1 0 1 1 0 2 2 0 1 1
.   17:            1 2 1 2 1 2 1 2 1 1 2 1 2 1 2 1 2 1
.   18:           1 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 1
.   19:          1 1 0 0 0 0 0 0 0 2 2 0 0 0 0 0 0 0 1 1
.   20:         1 2 1 0 0 0 0 0 0 2 1 2 0 0 0 0 0 0 1 2 1
.   21:        1 0 0 1 0 0 0 0 0 2 0 0 2 0 0 0 0 0 1 0 0 1
.   22:       1 1 0 1 1 0 0 0 0 2 2 0 2 2 0 0 0 0 1 1 0 1 1
.   23:      1 2 1 1 2 1 0 0 0 2 1 2 2 1 2 0 0 0 1 2 1 1 2 1
.   24:     1 0 0 2 0 0 1 0 0 2 0 0 1 0 0 2 0 0 1 0 0 2 0 0 1
.   25:    1 1 0 2 2 0 1 1 0 2 2 0 1 1 0 2 2 0 1 1 0 2 2 0 1 1
.   26:   1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1
.   27:  1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 .
- _Reinhard Zumkeller_, Jul 11 2013
		

References

  • Boris A. Bondarenko, Generalized Pascal Triangles and Pyramids (in Russian), FAN, Tashkent, 1990, ISBN 5-648-00738-8.
  • Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. Mentions this sequence - see "List of Sequences" in Vol. 2.

Crossrefs

Cf. A006996 (central terms), A173019, A206424, A227428.
Sequences based on the triangles formed by reading Pascal's triangle mod m: A047999 (m = 2), (this sequence) (m = 3), A034931 (m = 4), A095140 (m = 5), A095141 (m = 6), A095142 (m = 7), A034930(m = 8), A095143 (m = 9), A008975 (m = 10), A095144 (m = 11), A095145 (m = 12), A275198 (m = 14), A034932 (m = 16).

Programs

  • Haskell
    a083093 n k = a083093_tabl !! n !! k
    a083093_row n = a083093_tabl !! n
    a083093_tabl = iterate
       (\ws -> zipWith (\u v -> mod (u + v) 3) ([0] ++ ws) (ws ++ [0])) [1]
    -- Reinhard Zumkeller, Jul 11 2013
    
  • Magma
    /* As triangle: */ [[Binomial(n,k) mod 3: k in [0..n]]: n in [0.. 15]]; // Vincenzo Librandi, Feb 15 2016
    
  • Maple
    A083093 := proc(n,k)
        modp(binomial(n,k),3) ;
    end proc:
    seq(seq(A083093(n,k),k=0..n),n=0..10) ; # R. J. Mathar, Jul 26 2017
  • Mathematica
    Mod[ Flatten[ Table[ Binomial[n, k], {n, 0, 13}, {k, 0, n}]], 3] (* Robert G. Wilson v, Jan 19 2004 *)
  • Python
    from sympy import binomial
    def T(n, k):
        return binomial(n, k) % 3
    for n in range(21): print([T(n, k) for k in range(n + 1)]) # Indranil Ghosh, Jul 26 2017
    
  • Python
    from math import comb, isqrt
    def A083093(n):
        def f(m,k):
            if m<3 and k<3: return comb(m,k)%3
            c,a = divmod(m,3)
            d,b = divmod(k,3)
            return f(c,d)*f(a,b)%3
        return f(r:=(m:=isqrt(k:=n+1<<1))-(k<=m*(m+1)),n-comb(r+1,2)) # Chai Wah Wu, Apr 30 2025

Formula

T(i, j) = binomial(i, j) mod 3.
T(n+1,k) = (T(n,k) + T(n,k-1)) mod 3. - Reinhard Zumkeller, Jul 11 2013
T(n,k) = Product_{i>=0} binomial(n_i,k_i) mod 3, where n = Sum_{i>=0} n_i*3^i and k = Sum_{i>=0} k_i*3^i, 0<=n_i, k_i <=2 [Allouche et al.]. - R. J. Mathar, Jul 26 2017

A005704 Number of partitions of 3n into powers of 3.

Original entry on oeis.org

1, 2, 3, 5, 7, 9, 12, 15, 18, 23, 28, 33, 40, 47, 54, 63, 72, 81, 93, 105, 117, 132, 147, 162, 180, 198, 216, 239, 262, 285, 313, 341, 369, 402, 435, 468, 508, 548, 588, 635, 682, 729, 783, 837, 891, 954, 1017, 1080, 1152, 1224, 1296, 1377, 1458, 1539, 1632
Offset: 0

Views

Author

Keywords

Comments

Infinite convolution product of [1,2,3,3,3,3,3,3,3,3] aerated A000244 - 1 times, i.e., [1,2,3,3,3,3,3,3,3,3] * [1,0,0,2,0,0,3,0,0,3] * [1,0,0,0,0,0,0,0,0,2] * ... [Mats Granvik, Gary W. Adamson, Aug 07 2009]

References

  • R. K. Guy, personal communication.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    Fold[Append[#1, Total[Take[Flatten[Transpose[{#1, #1, #1}]], #2]]] &, {1}, Range[2, 55]] (* Birkas Gyorgy, Apr 18 2011 *)
    a[n_] := a[n] = If[n <= 2, n + 1, a[n - 1] + a[Floor[n/3]]]; Array[a, 101, 0] (* T. D. Noe, Apr 18 2011 *)
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A005704(n): return A005704(n-1)+A005704(n//3) if n else 1 # Chai Wah Wu, Sep 21 2022

Formula

a(n) = a(n-1)+a(floor(n/3)).
Coefficient of x^(3*n) in prod(k>=0, 1/(1-x^(3^k))). Also, coefficient of x^n in prod(k>=0, 1/(1-x^(3^k)))/(1-x). - Benoit Cloitre, Nov 28 2002
a(n) mod 3 = binomial(2n, n) mod 3. - Benoit Cloitre, Jan 04 2004
Let T(x) be the g.f., then T(x)=(1-x^3)/(1-x)^2*T(x^3). [Joerg Arndt, May 12 2010]

Extensions

Formula and more terms from Henry Bottomley, Apr 30 2001

A039969 An example of a d-perfect sequence: a(n) = Catalan(n) mod 3.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

This is A006996 with all its terms repeated three times, except the initial term only twice. A006996 is a fixed point of the morphism 0 -> 000, 1 -> 120, 2 -> 210. [The original comment edited by Antti Karttunen, Aug 14 2017]
Equals Catalan(n) mod 3. (Cf. A000108.) - Paul D. Hanna, Jun 20 2003 [confirmed by Christian G. Bower, Jun 12 2005]
Catalan numbers: C(n) = binomial(2n,n)/(n+1) = (2n)!/(n!(n+1)!).

Crossrefs

Cf. A006996 (trisection).

Programs

  • Magma
    [Catalan(n) mod 3: n in [1..80]]; // Vincenzo Librandi, Jul 14 2015
    
  • Maple
    seq(binomial(2*n, n)/(n+1) mod 3, n = 0 .. 100); # Robert Israel, Sep 20 2015
  • Mathematica
    Take[ Flatten[ Nest[ Flatten[ # /. {1 -> {1, 2, 0}, 2 -> {2, 1, 0}, 0 -> {0, 0, 0}}] &, {1}, 4] /. {1 -> {1, 1, 1}, 2 -> {2, 2, 2}, 0 -> {0, 0, 0}}], {2, 106}] (* or *)
    Table[ Mod[ Binomial[ 2n, n]/(n + 1), 3], {n, 0, 104}] (* Robert G. Wilson v, Sep 09 2005 *)
    Mod[CatalanNumber[Range[0,110]],3] (* Harvey P. Dale, Oct 23 2017 *)
  • PARI
    A039969(n) = ((binomial(2*n, n)/(n+1))%3); \\ Antti Karttunen, Aug 13 2017

Formula

a(n) = ((-1)^(n+1)*A001006(n-1)) mod 3, for n>0. - Christian G. Bower, Jun 12 2005
a(n) = a(n-1) if n == 0 or 1 (mod 3). a(n) = 0 if n == 5,6, or 7 (mod 9). - Robert Israel, Sep 20 2015
a(3n) = A006996(n). - Antti Karttunen, Aug 14 2017
Asymptotic mean: lim_{n->oo} (1/n) Sum_{k=1..n} a(k) = 0 (Burns, 2016). - Amiram Eldar, Jan 26 2021

Extensions

More terms from Christian G. Bower, Jun 12 2005
Offset corrected from 1 to 0 by Antti Karttunen, Aug 13 2017

A074939 Even numbers such that base 3 representation contains no 2.

Original entry on oeis.org

0, 4, 10, 12, 28, 30, 36, 40, 82, 84, 90, 94, 108, 112, 118, 120, 244, 246, 252, 256, 270, 274, 280, 282, 324, 328, 334, 336, 352, 354, 360, 364, 730, 732, 738, 742, 756, 760, 766, 768, 810, 814, 820, 822, 838, 840, 846, 850, 972, 976, 982, 984, 1000, 1002
Offset: 0

Views

Author

Benoit Cloitre, Oct 04 2002; Nov 15 2003

Keywords

Comments

Even numbers in A005836; n such that binomial(2n,n) == 1 (mod 3).
Sum of an even number of distinct powers of 3. - Emeric Deutsch, Dec 03 2003

Crossrefs

Intersection of A005843 and A005836.

Programs

  • Mathematica
    Select[2*Range[0,600],DigitCount[#,3,2]==0&] (* Harvey P. Dale, Dec 10 2016 *)
  • Python
    def A074939(n): return int(bin((n.bit_count()&1)+(n<<1))[2:],3) # Chai Wah Wu, Jun 26 2025

Formula

a(n) = A083094(n)/2; a(n) mod 3 = A010060(n); n such that coefficient of x^n equals 1 in Product_{k>=0} (1 - x^(3^k)).
a(n) + A074938(n) = A055246(n+1). - Philippe Deléham, Jul 10 2005

A081601 Numbers m such that 3 does not divide Sum_{k=0..m} binomial(2k,k) = A006134(m).

Original entry on oeis.org

0, 3, 9, 12, 27, 30, 36, 39, 81, 84, 90, 93, 108, 111, 117, 120, 243, 246, 252, 255, 270, 273, 279, 282, 324, 327, 333, 336, 351, 354, 360, 363, 729, 732, 738, 741, 756, 759, 765, 768, 810, 813, 819, 822, 837, 840, 846, 849, 972, 975, 981, 984, 999, 1002, 1008, 1011
Offset: 1

Views

Author

Benoit Cloitre, Apr 22 2003

Keywords

Comments

Apparently a(n)/3 mod 2 = A010060(n-1), the Thue-Morse sequence.
a(n+1) is the smallest number with exactly n+1 partitions into distinct powers of 2 or of 3: A131996(a(n+1)) = n+1 and A131996(m) < n+1 for m < a(n+1). - Reinhard Zumkeller, Aug 06 2007

Examples

			For n=0, A006134(0) = 1, hence 0 is a term.
		

Crossrefs

Equals A089118(n-2) + 1, n > 1.

Programs

  • Mathematica
    Select[Range[0, 1020], Mod[Sum[Binomial[2 k, k], {k, 0, #}], 3] != 0 &] (* Michael De Vlieger, Nov 28 2015 *)
  • PARI
    for(n=0, 1e3, if(sum(k=0, n, binomial(2*k, k)) % 3 > 0, print1(n,", "))) \\ Altug Alkan, Nov 26 2015

Formula

Apparently a(n) = 3*A005836(n).
G.f.: (x/(1 - x))*Sum_{k>=0} 3^(k+1)*x^(2^k)/(1 + x^(2^k)) (conjecture). - Ilya Gutkovskiy, Jul 23 2017

Extensions

Zero prepended to the sequence and formulas modified accordingly by L. Edson Jeffery, Nov 25 2015

A074938 Odd numbers such that base 3 representation contains no 2.

Original entry on oeis.org

1, 3, 9, 13, 27, 31, 37, 39, 81, 85, 91, 93, 109, 111, 117, 121, 243, 247, 253, 255, 271, 273, 279, 283, 325, 327, 333, 337, 351, 355, 361, 363, 729, 733, 739, 741, 757, 759, 765, 769, 811, 813, 819, 823, 837, 841, 847, 849, 973, 975, 981, 985, 999, 1003, 1009
Offset: 0

Views

Author

Benoit Cloitre, Oct 04 2002; Nov 15 2003

Keywords

Comments

Odd numbers in A005836.
Numbers m such that coefficient of x^m equals -1 in Product_{k>=0} 1-x^(3^k).
Numbers k such that binomial(2k, k) == 2 (mod 3).
Sum of an odd number of distinct powers of 3. - Emeric Deutsch, Dec 03 2003

Crossrefs

Intersection of A005408 and A005836.

Programs

  • Mathematica
    Select[Range[1,1111,2],Count[IntegerDigits[#,3],2]==0&] (* Harvey P. Dale, Dec 19 2010 *)
  • Python
    def A074938(n): return int(bin((n<<1)+(n.bit_count()&1^1))[2:],3) # Chai Wah Wu, Jun 26 2025

Formula

a(n) (mod 3) = A010059(n).
((a(n)-1)/2) (mod 3) = A010060(n) = (1/2)*{binomial(2*a(n)+1, a(n)) (mod 3)}.

A039972 An example of a d-perfect sequence: a(n) = A007317(n) mod 3.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Odd bisection seems to be A006996. See also A039969. - Antti Karttunen, Aug 15 2017

Crossrefs

Programs

  • PARI
    write_to_bfile(start_offset,vec,bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); }
    A039972_as_a_vector(size)= { my(A=vector(size)); for(j=1, size, A[j]=1+sum(k=1, j-1, A[k]*A[j-k])); apply(n->(n%3),A); }; \\ After Michael Somos' May 23 2005 code for A007317 and Christian G. Bower's formula for A039972.
    write_to_bfile(1,A039972_as_a_vector(6561),"b039972_upto6561.txt"); \\ Antti Karttunen, Aug 15 2017

Formula

a(n) = A007317(n) mod 3. - Christian G. Bower, Jun 12 2005

Extensions

More terms from Christian G. Bower, Jun 12 2005
Formula added to the name by Antti Karttunen, Aug 15 2017

A088564 a(n)=sum(i=0,n,binomial(2*i,i) (mod 3)).

Original entry on oeis.org

1, 3, 3, 5, 6, 6, 6, 6, 6, 8, 9, 9, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 14, 15, 15, 16, 18, 18, 18, 18, 18, 19, 21, 21, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24
Offset: 0

Views

Author

Benoit Cloitre, Nov 19 2003

Keywords

Comments

Distinct values (i.e. 1,3,5,6,8,9,...) are given by the partial sums of the Thue-Morse sequence on alphabet (1,2) A026430. Sequence of least k such that a(k)>a(k-1) is given by A005836. For any k>=0, card{ n : a(3*A005836(k)) =a(n)}=1.
Only 79 of the first 1001 terms are odd numbers. -- From Harvey P. Dale, Aug 08 2012

Crossrefs

Programs

  • Mathematica
    Table[Sum[Mod[Binomial[2*i,i],3],{i,0,n}],{n,0,80}] (* Harvey P. Dale, Aug 08 2012 *)
Showing 1-9 of 9 results.