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-3 of 3 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

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

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