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.

A137824 Index at which A137823(n) occurs first in A137822 (gaps in numbers m such that 3 | sum( Catalan(k), k=1..2m)).

Original entry on oeis.org

1, 3, 2, 4, 12, 8, 16, 48, 32, 64, 192, 128, 256, 768, 512, 1024, 3072, 2048, 4096, 12288, 8192, 16384, 49152, 32768, 65536, 196608, 131072, 262144, 786432, 524288, 1048576, 3145728, 2097152, 4194304, 12582912, 8388608, 16777216, 50331648
Offset: 1

Views

Author

M. F. Hasler, May 15 2008

Keywords

Comments

Other characterization of the sequence: concatenate pattern (1,3,2) multiplying it by 4 after each concatenation step. Or: Start with 1,3,2, then iteratively append the whole sequence obtained so far multiplied by 4^(length of the sequence divided by 3)
See A137822 and A137823 for more comments and formulas.

Crossrefs

Programs

  • PARI
    A137824(n) = if( n%3==2,3,1)<<(2*(n-1)\3)
    
  • PARI
    A137824(n) = for( i=1,#A137822, A137822[i]==A137823[n] & return(i))
    
  • PARI
    a=[1,3,2]; for( i=1,5, a=concat( a, 4^(#a/3)*a )); a

Formula

If n==2 (mod 3) then a(n) = 3*2^[2*(n-1)/3]; else a(n) = 2^[2*(n-1)/3].
a(n) = 4*a(n-3) for n>3. G.f.: x*(1+x)*(1+2*x)/(1-4*x^3). - Colin Barker, Aug 19 2012

A137823 Numbers occurring in A137822 : first differences of numbers n such that 3 | sum( Catalan(k), k=1..2n).

Original entry on oeis.org

1, 2, 3, 7, 8, 21, 61, 62, 183, 547, 548, 1641, 4921, 4922, 14763, 44287, 44288, 132861, 398581, 398582, 1195743, 3587227, 3587228, 10761681, 32285041, 32285042, 96855123, 290565367, 290565368, 871696101, 2615088301, 2615088302
Offset: 1

Views

Author

M. F. Hasler, May 15 2008

Keywords

Comments

This sequence consists of A122983 (which are record values of A137822, i.e. record gaps of A137821), plus the successor of every other term thereof (i.e. A122983(2k+1)+1). See A137822 for more details & formulas.
The (very simple) sequence A137824 gives the index of A137822 at which A137823(n) occurs for the first time.

Crossrefs

Programs

  • PARI
    A137823(n) = (n%3==2)+3^((n-1)*2\3+1)\4+1

A122983 a(n) = (2 + (-1)^n + 3^n)/4.

Original entry on oeis.org

1, 1, 3, 7, 21, 61, 183, 547, 1641, 4921, 14763, 44287, 132861, 398581, 1195743, 3587227, 10761681, 32285041, 96855123, 290565367, 871696101, 2615088301, 7845264903, 23535794707, 70607384121, 211822152361, 635466457083
Offset: 0

Views

Author

Paul Barry, Sep 22 2006

Keywords

Comments

Old definition was: "Binomial transform of aeration of A081294".
Binomial transform is A063376.
A122983 = (1,1,3,7,1,1,3,7,...) mod 10. - M. F. Hasler, Feb 25 2008
Equals row sums of triangle A158301. - Gary W. Adamson, Mar 15 2009
a(n) = the number of ternary sequences of length n where the numbers of (0's, 1's) are both even. A015518 covers the (odd, even) and (even, odd) cases, and A081251 covers (odd, odd). - Toby Gottfried, Apr 18 2010
This sequence also describes the number of moves of the k-th disk solving (non-optimally) the [RED ; NEUTRAL ; BLUE] pre-colored Magnetic Tower of Hanoi (MToH) puzzle. The sequence A183119 is the partial sums of the sequence in question (obviously describing the total number of moves associated with the specific solution algorithm). For other MToH-related sequences, Cf. A183111 - A183125.
Let B=[1,sqrt(2),0; sqrt(2),1,sqrt(2); 0,sqrt(2),1] be a 3 X 3 matrix. Then a(n)=[B^n](1,1), n=0,1,2,.... - _L. Edson Jeffery, Dec 21 2011
Also the domination number of the n-Hanoi graph. - Eric W. Weisstein, Jun 16 2017
Also the matching number of the n-Sierpinski gasket graph. - Eric W. Weisstein, Jun 17 2017
Let M = [1,1,1,0; 1,1,0,1; 1,0,1,1; 0,1,1,1], a 4 X 4 matrix. Then a(n) is the upper left entry in M^n. - Philippe Deléham, Aug 23 2020
Also the lower matching number (=independent domination number) of the n-Hanoi graph. - Eric W. Weisstein, Aug 01 2023

Crossrefs

Cf. a(j+1) = A137822(2^j) and these are the record values of A137822.
Cf. A054879 (bisection), A066443 (bisection). Row sums of A158303.

Programs

Formula

From Paul Barry, Jun 14 2007: (Start)
G.f.: (1-2*x-x^2)/((1-x)*(1+x)*(1-3*x));
a(n) = 3^n/4+(-1)^n/4+1/2;
E.g.f.: cosh(x)^2*exp(x). (End)
a(n) = 3*a(n-1) + a(n-2) - 3*a(n-3); a(0)=1, a(1)=1, a(2)=3. - Harvey P. Dale, Sep 03 2013
E.g.f.: Q(0)/2, where Q(k) = 1 + 3^k/( 2 - 2*(-1)^k/( 3^k + (-1)^k - 2*x*3^k/( 2*x + (k+1)*(-1)^k/Q(k+1) ))); (continued fraction). - Sergei N. Gladkovskii, Dec 22 2013
a(2*n) = 3*a(2*n-1); a(2*n+1) = 3*a(2*n) - 2. - Philippe Deléham, Aug 23 2020

Extensions

Extended and corrected (existing Maple code) by M. F. Hasler, Feb 25 2008
Description changed to formula by Eric W. Weisstein, Jun 16 2017

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

Original entry on oeis.org

2, 8, 12, 26, 30, 36, 38, 80, 84, 90, 92, 108, 110, 116, 120, 242, 246, 252, 254, 270, 272, 278, 282, 324, 326, 332, 336, 350, 354, 360, 362, 728, 732, 738, 740, 756, 758, 764, 768, 810, 812, 818, 822, 836, 840, 846, 848, 972, 974, 980, 984, 998, 1002, 1008, 1010
Offset: 1

Views

Author

N. J. A. Sloane, Jun 11 2005

Keywords

Crossrefs

Programs

  • Maple
    A107755 := proc(n) option remember ; local a; if n = 1 then 2; else for a from A107755(n-1)+1 do if add(A000108(k),k=1..a) mod 3 = 0 then RETURN(a) ; fi ; od: fi ; end: # R. J. Mathar, Feb 25 2008
    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]=0 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}]; s0 (* Robert G. Wilson v, Jun 14 2005 *)
    Flatten[Position[Accumulate[CatalanNumber[Range[1100]]],?(Divisible[ #,3]&)]] (* _Harvey P. Dale, Feb 07 2016 *)
  • PARI
    n=0; s=Mod(0,3); A107755=vector(100,i, if( bitand(i,i-1), while(n++ && s+=binomial(2*n,n)/(n+1),), s=Mod(0,3);n=2*n+2+(log(i+.5)\log(2)%2)*2 ); /*print1(n",");*/ n) \\ M. F. Hasler, Feb 25 2008
    
  • PARI
    A107755(n)=sum( i=1,n, A137822(i) )*2 /* allows computation of a(10^4) in one second */ \\ M. F. Hasler, Mar 16 2008

Formula

a(2^j) = 2*a(2^j-1) + 2 (resp. + 4) if j is even (resp. odd). - M. F. Hasler, Feb 25 2008
a(n) = 2*Sum_{i=1..n} A137822(i). - M. F. Hasler, Mar 16 2008
{n: A137993(n-1) = 0}. - R. J. Mathar, Jul 07 2009

Extensions

More terms from Emeric Deutsch, Jun 12 2005
Corrected & extended by M. F. Hasler and R. J. Mathar, Feb 25 2008

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

Original entry on oeis.org

1, 4, 6, 13, 15, 18, 19, 40, 42, 45, 46, 54, 55, 58, 60, 121, 123, 126, 127, 135, 136, 139, 141, 162, 163, 166, 168, 175, 177, 180, 181, 364, 366, 369, 370, 378, 379, 382, 384, 405, 406, 409, 411, 418, 420, 423, 424, 486, 487, 490, 492, 499, 501, 504, 505
Offset: 1

Views

Author

M. F. Hasler, Feb 25 2008

Keywords

Comments

It would be natural to prepend an initial term a(1)=0 (for which the sum is to be considered empty, thus zero), but we omit it to avoid confusion w.r.t. indices of A107755.

Crossrefs

Cf. A107755 (twice this), A137822-A137824.

Programs

  • Mathematica
    Flatten[Position[Accumulate[CatalanNumber[Range[1100]]],?(Mod[#,3]==0&)]]/2 (* _Harvey P. Dale, Jun 19 2025 *)
  • PARI
    n=0; A137821=vector(499,i,{ if( bitand(i,i-1), while(n++ & s+=binomial(4*n-2,2*n-1)/(2*n)*(10*n-1)/(2*n+1),),s=Mod(0,3); n=2*n+1+log(i+.5)\log(2)%2 ); n})

Formula

a(n) = A107755(n)/2 = Sum_{k=0..n} A137822(k).
a(2^j) = 2 a(2^j-1) + 1 (resp. +2) for j even (resp. odd).
Sum_{k=1..2n} Catalan(k) = Sum_{k=1..n} Catalan(2k-1) * (10k-1)/(2k+1), thus:
{ a(m) } = { n>0 | Sum_{k=1..n} Catalan(2k-1) * (10k-1)/(2k+1) == 0 (mod 3) }.

A137993 A014138 (= partial sums of Catalan numbers starting with 1,2,5) mod 3.

Original entry on oeis.org

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

Views

Author

M. F. Hasler, Mar 16 2008

Keywords

Comments

As usual, "mod 3" means to choose the unique representative in { 0,1,2 } of the equivalence class modulo 3Z.
Here the conventions of A014138 are used, but it seems somehow unnatural to start with offset 0 corresponding to the Catalan number A000108(1).
For m>1, the length of the m-th block of nonzero elements (and thus the approximate length of the m-th string of consecutive 1's) is given by 2 A137822(m)-1.

Crossrefs

Cf. A014138, A000108, A137821-A137824, A107755, A137992, A014137(n+1) = a(n)+1 (mod 3).

Programs

  • PARI
    A137993(n) = lift( sum( k=1,n+1, binomial( 2*k,k )/(k+1), Mod(0,3) ))

Formula

a(n) = sum( k=1..n+1, C(k) ) (mod 3), where C(k) = binomial(2k,k)/(k+1) = A000108(k).
a(n) = 0 <=> n+1 = 2 A137821(m) for some m.

A142723 Decimal expansion of the continued fraction whose terms are half the gaps of the odd nonprimes A014076.

Original entry on oeis.org

4, 3, 0, 3, 2, 3, 9, 3, 0, 1, 9, 8, 3, 1, 2, 2, 5, 4, 7, 5, 0, 7, 2, 5, 6, 5, 3, 7, 1, 2, 9, 4, 6, 1, 0, 1, 1, 0, 0, 5, 8, 7, 4, 9, 8, 2, 5, 6, 1, 5, 9, 3, 3, 2, 7, 6, 9, 9, 6, 6, 3, 7, 1, 8, 1, 0, 8, 6, 7, 0, 5, 5, 2, 1, 6, 2, 6, 3, 9, 5, 7, 8, 9, 0, 1, 9, 6, 0, 0, 2, 4, 3, 7, 4, 8, 7, 1, 5, 5, 8, 7, 3, 6, 9, 2
Offset: 1

Views

Author

Roger L. Bagula and Gary W. Adamson, Sep 27 2008

Keywords

Comments

Take half of the first difference of odd nonprimes A014076 and treat it as a continued fraction. This sequence gives the decimal expansion of that number. - Charles R Greathouse IV, Feb 03 2011

Examples

			4.30323930198312254750725653712946101100587498256159332769966371810867...
		

Programs

  • Mathematica
    a = Flatten[Table[If[PrimeQ[2*n + 1], {}, 2*n - 1], {n, 0, 200}]]; b = Table[(a[[n + 1]] - a[[n]])/2, {n, 1, Length[a] - 1}]; FromContinuedFraction[b]; c = N[%, 200]; Table[Floor[Mod[c*10^n, 10]], {n, 0, 201}] (* Bagula and Adamson *)
    RealDigits[FromContinuedFraction[Differences[Select[Range[-1, 399, 2], !PrimeQ[# + 2]&]]/2], 10, 201][[1]] (* Charles R Greathouse IV, Feb 03 2011 *)
  • PARI
    a=contfracpnqn(D(select(vector(99,n,2*n-1),x->!isprime(x)))/2); a[1,1]/a[2,1]*1.  /* OK for 35 digits. For D(.) see A137822 */ \\ M. F. Hasler, Sep 29 2011
Showing 1-7 of 7 results.