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.

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

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

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