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.

A055246 At step number k >= 1 the 2^(k-1) open intervals that are erased from [0,1] in the Cantor middle-third set construction are I(k,n) = (a(n)/3^k, (1+a(n))/3^k), n=1..2^(k-1).

Original entry on oeis.org

1, 7, 19, 25, 55, 61, 73, 79, 163, 169, 181, 187, 217, 223, 235, 241, 487, 493, 505, 511, 541, 547, 559, 565, 649, 655, 667, 673, 703, 709, 721, 727, 1459, 1465, 1477, 1483, 1513, 1519, 1531, 1537, 1621, 1627, 1639, 1645, 1675, 1681, 1693, 1699
Offset: 1

Views

Author

Wolfdieter Lang, May 23 2000

Keywords

Comments

Related to A005836. Gives boundaries of open intervals that have to be erased in the Cantor middle-third set construction.
Let g(n) = Sum_{i=0..n} (i*binomial(n+i,i)^3*binomial(n,i)^2) = A112035(n). Let b = {m>0 : g(m) != 0 (mod 3)}. Then b(n) = a(n). - Mohammed Bouayoun (bouyao(AT)wanadoo.fr), Mar 08 2004
Conjecture: Similarly to A191107, this increasing sequence is generated by the rules: a(1) = 1, and if x is in the sequence, then 3*x-2 and 3*x+4 are also in the sequence. - L. Edson Jeffery, Nov 17 2015

Examples

			k=1: (1/3, 2/3);
k=2: (1/9, 2/9), (7/9, 8/9);
k=3: (1/27, 2/27), (7/27, 8/27), (19/27, 20/27), (25/27, 26/27); ...
		

Crossrefs

Programs

  • Mathematica
    (* (Conjectured) Choose rows large enough to guarantee that all terms < max are generated. *)
    rows = 1000; max = 10^4; a[1] = {1}; i = 1; Do[a[n_] = {}; Do[If[1 < 3*a[n - 1][[k]] - 2 < max, AppendTo[a[n], 3*a[n - 1][[k]] - 2], Break]; If[3*a[n - 1][[k]] + 4 < max, AppendTo[a[n], 3*a[n - 1][[k]] + 4], Break], {k, Length[a[n - 1]]}]; If[a[n] == {}, Break, i++], {n, 2, 1000}]; a055246 = Take[Flatten[Table[a[n], {n, i}]], 48] (* L. Edson Jeffery, Nov 17 2015 *)
    Join[{1}, 1 + 6 Accumulate[Table[(3^IntegerExponent[n, 2] + 1)/2, {n, 60}]]] (* Vincenzo Librandi, Nov 26 2015 *)
  • PARI
    g(n)=sum(i=0,n,i*binomial(n+i,i)^3*binomial(n,i)^2);
    for (i=1,2000,if(Mod(g(i),3)<>0,print1(i,",")))
    
  • PARI
    a(n) = fromdigits(binary(n-1),3)*6 + 1; \\ Kevin Ryde, Apr 23 2021
    
  • Python
    def A055246(n): return int(bin(n-1)[2:],3)*6|1 # Chai Wah Wu, Jun 26 2025

Formula

a(n) = 1+6*A005836(n), n >= 1.
a(n) = 1+3*A005823(n), n >= 1.
a(n+1) = A074938(n) + A074939(n); A074938: odd numbers in A005836, A074939: even numbers in A005836. - Philippe Deléham, Jul 10 2005
Conjecture: a(n) = 2*A191107(n) - 1 = 6*A003278(n) - 5 = (a((2*n-1)*2^(k-1))+2)/3^k, k>0. - L. Edson Jeffery, Nov 25 2015

Extensions

Edited by N. J. A. Sloane, Nov 20 2015: used first comment to give more precise definition, and edited a comment at the suggestion of L. Edson Jeffery.

A006996 a(n) = C(2n,n) mod 3.

Original entry on oeis.org

1, 2, 0, 2, 1, 0, 0, 0, 0, 2, 1, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 1, 2, 0, 0, 0, 0, 1, 2, 0, 2, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 1, 2, 0, 0, 0, 0, 1, 2, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Keywords

Comments

Removing 0's from the sequence gives Thue-Morse sequence A001285 : 1,2,0,2,1,0,0,0,0,2,1,0,1,2,..->1,2,2,1,2,1,1,2,... - Benoit Cloitre, Jan 04 2004
a(n) = 0 if n in A074940, a(n) = 1 if n in A074939, a(n) = 2 if n in A074938.
Central terms of the triangle in A083093. - Reinhard Zumkeller, Jul 11 2013

References

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

Crossrefs

Programs

  • Haskell
    a006996 n = a083093 (2 * n) n  -- Reinhard Zumkeller, Jul 11 2013
    
  • Mathematica
    Table[ Mod[ Binomial[2n, n], 3], {n, 0, 104}] (* Or *)
    Nest[ Function[ l, {Flatten[(l /. {0 -> {0, 0, 0}, 1 -> {1, 2, 0}, 2 -> {2, 1, 0}})]}], {1}, 7] (* Robert G. Wilson v, Mar 28 2005 *)
  • PARI
    a(n)=if(n==0, return(1)); if(vecmax(Set(digits(n,3)))>1, 0, 1 + n%2) \\ Charles R Greathouse IV, May 09 2016
    
  • Python
    from gmpy2 import digits
    def A006996(n): return 0 if '2' in digits(n,3) else 1+(n&1) # Chai Wah Wu, Jun 26 2025

Formula

a(n) = A000984(n) mod 3.
a(n) = A005704(n) mod 3. - Benoit Cloitre, Jan 04 2004
A fixed point of the morphism : 1 -> 120, 2 -> 210, 0 -> 000. - Philippe Deléham, Jan 08 2004

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)}.

A083095 a(n) = A083094(n)/4.

Original entry on oeis.org

0, 2, 5, 6, 14, 15, 18, 20, 41, 42, 45, 47, 54, 56, 59, 60, 122, 123, 126, 128, 135, 137, 140, 141, 162, 164, 167, 168, 176, 177, 180, 182, 365, 366, 369, 371, 378, 380, 383, 384, 405, 407, 410, 411, 419, 420, 423, 425, 486, 488, 491, 492, 500
Offset: 1

Views

Author

Benoit Cloitre, Apr 22 2003

Keywords

Comments

Is this the same as A083097? - Andrew S. Plewe, May 30 2007

Crossrefs

Programs

  • Mathematica
    Select[Range[0,2000], OddQ[Sum[Mod[Binomial[#,j],3],{j,0,#}]]&]/4 (* Paul F. Marrero Romero, Dec 28 2024 *)
  • Python
    def A083095(n): return int(bin(((m:=n-1).bit_count()&1)+(m<<1))[2:],3)>>1 # Chai Wah Wu, Jun 26 2025

Formula

Apparently (2*a(n)) mod 3 = A010060(n-1), the Thue-Morse sequence.
Numbers k such that C(4*k, 2*k) == 1 (mod 3). - Benoit Cloitre, Jul 30 2003
Numbers k such that the base-3 digits of 2k contains no 2's, i.e. a(n) = A074939(n-1)/2. - Chai Wah Wu, Jun 26 2025

Extensions

More terms from Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Apr 29 2003

A083094 Numbers k such that Sum_{j=0..k} (binomial(k,j) mod 3) is odd.

Original entry on oeis.org

0, 8, 20, 24, 56, 60, 72, 80, 164, 168, 180, 188, 216, 224, 236, 240, 488, 492, 504, 512, 540, 548, 560, 564, 648, 656, 668, 672, 704, 708, 720, 728, 1460, 1464, 1476, 1484, 1512, 1520, 1532, 1536, 1620, 1628, 1640, 1644, 1676, 1680, 1692, 1700, 1944, 1952
Offset: 1

Views

Author

Benoit Cloitre, Apr 22 2003

Keywords

Comments

Apparently a(n)/2 (mod 3) = A010060(n), the Thue-Morse sequence.

Crossrefs

Cf. A010060, A051638, A074939, A083093, A083095 (gives a b-file of 16384 terms).

Programs

  • Mathematica
    Select[Range[0, 2000],OddQ[Sum[Mod[Binomial[#, j], 3], {j, 0, #}]] &] (* Paul F. Marrero Romero, Dec 28 2024 *)
  • PARI
    isok(n) = sum(k=0, n, binomial(n,k) % 3) % 2; \\ Michel Marcus, Dec 05 2013
    
  • Python
    def A083094(n): return int(bin(((m:=n-1).bit_count()&1)+(m<<1))[2:],3)<<1 # Chai Wah Wu, Jun 26 2025

Formula

a(n) = 4*A083095(n). - Hugo Pfoertner, Jan 12 2025
Numbers that are multiples of 4 and such that base-3 digits contain no 1's, or equivalently, numbers such that base-3 digits contains an even number of 2's and no 1's, i.e. a(n) = 2*A074939(n-1). This characterization can be derived from the formula in A051638. - Chai Wah Wu, Jun 26 2025

Extensions

More terms from Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Apr 29 2003

A246510 G.f.: Sum_{n>=0} x^n / (1-4*x)^(2*n+1) * [Sum_{k=0..n} C(n,k)^2 * 3^k * x^k] * [Sum_{k=0..n} C(n,k)^2 * 4^k * x^k].

Original entry on oeis.org

1, 5, 36, 305, 2821, 27690, 282699, 2967285, 31785786, 345815975, 3808549531, 42360017130, 474990254821, 5362633500755, 60897115958286, 695012481567465, 7966829676299139, 91674042449673960, 1058486539560201051, 12258669983923625475, 142359286920427682046, 1657287004720545992505
Offset: 0

Views

Author

Paul D. Hanna, Aug 27 2014

Keywords

Comments

a(n) == 1 (mod 3) iff n = A074939(k) for k>=0, where A074939 gives even numbers such that base 3 representation contains no 2.
a(n) == 2 (mod 3) iff n = A074938(k) for k>=0, where A074938 gives odd numbers such that base 3 representation contains no 2.

Examples

			G.f.: A(x) = 1 + 5*x + 36*x^2 + 305*x^3 + 2821*x^4 + 27690*x^5 +...
		

Crossrefs

Programs

  • Mathematica
    Table[Sum[3^k * Sum[Binomial[n-k, k+j]^2 * Binomial[k+j, j]^2 * 4^j,{j,0,n-2*k}],{k,0,Floor[n/2]}],{n,0,20}] (* Vaclav Kotesovec, Oct 04 2014 *)
  • PARI
    /* By definition: */
    {a(n)=local(A=1); A=sum(m=0, n, x^m/(1-4*x)^(2*m+1) * sum(k=0, m, binomial(m, k)^2 * 3^k * x^k) * sum(k=0, m, binomial(m, k)^2 * 4^k * x^k) +x*O(x^n)); polcoeff(A, n)}
    for(n=0, 25, print1(a(n), ", "))
    
  • PARI
    /* By a binomial identity: */
    {a(n)=local(A=1); A=sum(m=0, n, x^m/(1-x)^(2*m+1) * sum(k=0, m, binomial(m, k)^2 * 4^(m-k) * 3^k * x^k) * sum(k=0, m, binomial(m, k)^2 * x^k) +x*O(x^n)); polcoeff(A, n)}
    for(n=0, 25, print1(a(n), ", "))
    
  • PARI
    /* By a binomial identity: */
    {a(n)=polcoeff(sum(m=0, n, x^m*sum(k=0, m, binomial(m, k)^2 * sum(j=0, k, binomial(k, j)^2 * 4^(k-j) * 3^j * x^j)+x*O(x^n))), n)}
    for(n=0, 25, print1(a(n), ", "))
    
  • PARI
    /* By a binomial identity: */
    {a(n)=polcoeff(sum(m=0, n, x^m*sum(k=0, m, binomial(m, k)^2 * 4^(m-k) * sum(j=0, k, binomial(k, j)^2 * 3^j * x^j)+x*O(x^n))), n)}
    for(n=0, 25, print1(a(n), ", "))
    
  • PARI
    /* Formula for a(n): */
    {a(n)=sum(k=0, n\2, sum(j=0, n-2*k, 3^k * binomial(n-k, k+j)^2 * binomial(k+j, j)^2 * 4^j))}
    for(n=0, 25, print1(a(n), ", "))

Formula

G.f.: Sum_{n>=0} x^n / (1-x)^(2*n+1) * [Sum_{k=0..n} C(n,k)^2 * x^k] * [Sum_{k=0..n} C(n,k)^2 * 4^(n-k) * 3^k * x^k].
G.f.: Sum_{n>=0} x^n * Sum_{k=0..n} C(n,k)^2 * Sum_{j=0..k} C(k,j)^2 * 4^(k-j) * 3^j * x^j.
G.f.: Sum_{n>=0} x^n * Sum_{k=0..n} C(n,k)^2 * 4^(n-k) * Sum_{j=0..k} C(k,j)^2 * 3^j * x^j.
a(n) = Sum_{k=0..[n/2]} 3^k * Sum_{j=0..n-2*k} C(n-k, k+j)^2 * C(k+j, j)^2 * 4^j.
a(n) ~ sqrt(36 + 29*sqrt(3) + 3*sqrt(423 + 232*sqrt(3))) * (9/2 + sqrt(3) + 3/2*sqrt(9 + 4*sqrt(3)))^n / (8*Pi*n). - Vaclav Kotesovec, Oct 04 2014

A107757 Numbers k such that Sum_{j=1..k} Catalan(j) == 2 (mod 3).

Original entry on oeis.org

3, 9, 11, 27, 29, 35, 39, 81, 83, 89, 93, 107, 111, 117, 119, 243, 245, 251, 255, 269, 273, 279, 281, 323, 327, 333, 335, 351, 353, 359, 363, 729, 731, 737, 741, 755, 759, 765, 767, 809, 813, 819, 821, 837, 839, 845, 849, 971, 975, 981, 983, 999, 1001, 1007, 1011
Offset: 1

Views

Author

N. J. A. Sloane, Jun 11 2005

Keywords

Crossrefs

Equals A074939 - 1.

Programs

  • Maple
    c:=n->binomial(2*n,n)/(n+1): s:=0: for n from 1 to 1500 do s:=s+c(n): a[n]:=s mod 3: od: A:=[seq(a[n],n=1..1500)]: p:=proc(n) if A[n]=2 then n else fi end: seq(p(n),n=1..1500); # Emeric Deutsch, Jun 12 2005
  • Mathematica
    s0 = s2 = {}; s = 0; Do[s = Mod[s + (2 n)!/n!/(n + 1)!, 3]; Switch[ Mod[s, 3], 0, AppendTo[s0, n], 2, AppendTo[s2, n]], {n, 1055}]; s2 (* Robert G. Wilson v, Jun 14 2005 *)

Extensions

More terms from Emeric Deutsch, Jun 12 2005
Showing 1-7 of 7 results.