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.

A108784 Difference between A107757 and A107755.

Original entry on oeis.org

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

Views

Author

Robert G. Wilson v, Jun 14 2005

Keywords

Comments

Of the 255 terms less than 10^4, 128 are positive.

Crossrefs

Programs

  • Maple
    Maple code from R. J. Mathar, Feb 25 2008:
    A000108 := proc(n) option remember ; binomial(2*n,n)/(n+1) ; end:
    A107757 := proc(n) option remember ; local a; if n = 1 then 3; else for a from A107757(n-1)+1 do if add(A000108(k),k=1..a) mod 3 = 2 then RETURN(a) ; fi ; od: fi ; end:
    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:
    A108784 := proc(n) A107757(n)-A107755(n) ; end: seq(A108784(n),n=1..120) ;
  • 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, 10^4}]; s2 - s0

Formula

It appears that a(n) = A076826(2n)-1. - T. D. Noe, Jun 14 2007
a(n) = A107757(n) - A107755(n).

Extensions

Corrected by T. D. Noe, Jun 14 2007

A137822 First differences of A137821 (numbers such that sum( Catalan(k), k=1..2n) = 0 (mod 3)).

Original entry on oeis.org

1, 3, 2, 7, 2, 3, 1, 21, 2, 3, 1, 8, 1, 3, 2, 61, 2, 3, 1, 8, 1, 3, 2, 21, 1, 3, 2, 7, 2, 3, 1, 183, 2, 3, 1, 8, 1, 3, 2, 21, 1, 3, 2, 7, 2, 3, 1, 62, 1, 3, 2, 7, 2, 3, 1, 21, 2, 3, 1, 8, 1, 3, 2, 547, 2, 3, 1, 8, 1, 3, 2, 21, 1, 3, 2, 7, 2, 3, 1, 62, 1, 3, 2, 7, 2, 3, 1, 21, 2, 3, 1, 8, 1, 3, 2, 183, 1, 3, 2
Offset: 1

Views

Author

M. F. Hasler, Feb 25 2008, revised Mar 15 2008

Keywords

Comments

For the initial term, we use A137821(0)=0 (cf. formula).
Sequence A122983 lists record values of this one, which occur at index 2^j (cf. formula). The fact that these values roughly grow by a factor 3 is explained by the fact that these values are given as the sum of all preceding terms (up to +1 or +2 according to the parity of j, cf. formula).
The only values occurring in this sequence are { 1, 2, 3, 7, 8, 21, 61, 62, 183, 547, 548, 1641,... } = A137823, consisting of the record values a(2^j) and, for every other one of these (i.e. for even j), its successor a(2^j)+1, occurring first as a(3*2^j).
The remarkably simple sequence A137824 (= 1,3,2, 4,12,8,...: pattern 1,3,2 multiplied by powers of 4) gives the index at which the value A137823(m) first occurs. - M. F. Hasler, Mar 15 2008
The PARI code given here (function A137822(n)) allows one to calculate hundreds of terms of A107755 in a few microseconds. - M. F. Hasler, Mar 15 2008

Examples

			Record values are a(1)=1, a(2)=3, a(4)=7, a(8)=21, a(16)=61, ...
Apart from these values, the only other values occurring in the sequence are:
2=a(1)+1=a(3*1), 8=a(4)+1=a(3*4), 62=a(16)+1=a(3*16), ...
		

Crossrefs

Cf. A122983 (record values of this).

Programs

  • Mathematica
    Join[{1},Differences[Flatten[Position[Accumulate[CatalanNumber[Range[3000]]],?(Mod[#,3]==0&)]]/2]] (* _Harvey P. Dale, Jun 19 2025 *)
  • PARI
    A137822 = D( A137821 ) /* where D(v)=vector(#v-1,i,v[i+1]-v[i]) or D(v)=vecextract(v, "^1")-vecextract(v,"^-1") */
    
  • PARI
    n=0; A137822=vector(499,i,{ o=n; 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-o})
    
  • PARI
    A137822(n)= local( L=log(n+.5)\log(2) ); while( n>0 || ((n+=2^L) && L=log(n+.5)\log(2)), (n-=2^L) || return( 3^(L+1)\4+1 ); (n-=2^(L-1)) || return( 3^L\4+1+L%2 );n<0 && n+=2<M. F. Hasler, Mar 15 2008

Formula

a(m) = A137821(m)-A137821(m-1), A137821(m)=sum( a(j), j=1..m).
a(2^j) = A122983(j-1) = A137821(2^j-1) + 1 (resp. +2) for j even (resp. odd).
a(3*2^j) = a(2^j) (resp. = a(2^j)+1) for j odd (resp. j even).

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

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

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

Original entry on oeis.org

1, 4, 5, 6, 7, 10, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 28, 31, 32, 33, 34, 37, 40, 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, 82, 85, 86, 87, 88, 91, 94, 95
Offset: 1

Views

Author

N. J. A. Sloane, Jun 11 2005

Keywords

Crossrefs

Equals A074940 - 1.

Programs

Formula

Equivalently, numbers k such that base-3 expansion of k+1 contains a 2.

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

A137992 A014137 (= partial sums of Catalan numbers A000108) mod 3.

Original entry on oeis.org

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

Crossrefs

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

Programs

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

Formula

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

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