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-5 of 5 results.

A192682 Floor-Sqrt transform of numbers of A078678 (Grand Dyck paths with no zigzags).

Original entry on oeis.org

1, 1, 2, 2, 4, 6, 10, 15, 24, 38, 60, 95, 150, 238, 379, 602, 959, 1529, 2439, 3893, 6218, 9939, 15896, 25436, 40719, 65214, 104486, 167470, 268514, 430661, 690929, 1108799, 1779860, 2857757, 4589497, 7372235, 11844653, 19033982, 30592616, 49178930, 79070268, 127149739, 204494942
Offset: 0

Views

Author

Emanuele Munarini, Jul 07 2011

Keywords

Programs

  • Mathematica
    FSFromSeries[f_,x_,n_] := Map[Floor[Sqrt[#]]&,CoefficientList[Series[f,{x,0,n}],x]]
    FSFromSeries[(1+x+x^2)/Sqrt[1-2x-x^2-2x^3+x^4],x,100]

Formula

a(n) = floor(sqrt(A078678(n))).

A003440 Number of binary vectors with restricted repetitions.

Original entry on oeis.org

1, 1, 3, 7, 17, 42, 104, 259, 648, 1627, 4098, 10350, 26202, 66471, 168939, 430071, 1096451, 2799072, 7154189, 18305485, 46885179, 120195301, 308393558, 791882862, 2034836222, 5232250537, 13462265079, 34657740889, 89272680921, 230069128392
Offset: 0

Views

Author

Keywords

Comments

The sum of squared terms in row n of A104402 = 2*a(n) for n>0. - Paul D. Hanna, Mar 06 2005
From Jean-Pierre Levrel, Nov 26 2014: (Start)
The title "Binary Sequences with Restricted Repetitions," given the A003440 series, does not specify the type of restrictions used. After reading the article by K. A. Post, "Binary Sequences with Restricted Repetitions," it appears that the A003440 series corresponds to the following cases:
- Number of repetitions limited to two,
- Each sequence must begin with a zero.
It is important to consider these two hypotheses to interpret the series. I also think that the second constraint is not useful and could usefully be deleted. In this case, the series should be doubled from the second term and would become 1, 2, 6, 14, 34, 84, ..., i.e., A177790.
(End)

References

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

Crossrefs

Programs

  • Mathematica
    Flatten[{1,Table[Sum[(Binomial[k,n-k]+Binomial[k+1,n-k-1])^2/2,{k,0,n}],{n,1,20}]}] (* Vaclav Kotesovec, Feb 12 2014 *)
    a[r_, s_] /; r<0 || s<0 = 0; a[r_ /; 0 <= r <= 2, 0] = 1; a[r_ /; r>2, 0] = 0; a[0, s_ /; s >= 1] = 0; a[r_, s_] := a[r, s] = a[r-2, s-2] + a[r-2, s-1] + a[r-1, s-2] + a[r-1, s-1]; a[n_] := a[n, n]; Table[a[n], {n, 0, 29}] (* Jean-François Alcover, Jan 19 2015, after given recurrence *)
  • PARI
    {a(n)=polcoeff(((1-x)^2*sqrt((1+x+x^2)/(1-3*x+x^2))+x^2-1)/(2*x^2)+x*O(x^n),n)} \\ Paul D. Hanna, Mar 06 2005
    
  • PARI
    {a(n)=if(n==0,1,sum(k=0,n,(binomial(k,n-k)+binomial(k+1,n-k-1))^2)/2)} \\ Paul D. Hanna, Mar 06 2005

Formula

G.f.: {(1-x)^2 * sqrt[(1+x+x^2)/(1-3x+x^2)] + x^2 - 1}/(2x^2) (conjectured). - Ralf Stephan, Mar 28 2004
a(n) = Sum_{k=0..n} (C(k, n-k) + C(k+1, n-k-1))^2/2 for n>0, with a(0)=1. - Paul D. Hanna, Mar 06 2005
Conjecture: (n+2)*a(n) +3*(-n-1)*a(n-1) +(n-2)*a(n-2) +(-n+1)*a(n-3) +3*(n-4)*a(n-4) +(-n+5)*a(n-5)=0. - R. J. Mathar, Jun 07 2013
Recurrence: (n-2)*(n-1)*(n+2)*a(n) = 2*(n-2)*n*(n+1)*a(n-1) + (n-1)*(n^2 - 2*n - 4)*a(n-2) + 2*(n-3)*(n-2)*n*a(n-3) - (n-4)*(n-1)*n*a(n-4). - Vaclav Kotesovec, Feb 12 2014
a(n) ~ sqrt(6+14/sqrt(5)) * (3+sqrt(5))^n / (sqrt(Pi*n) * 2^(n+1)). - Vaclav Kotesovec, Feb 12 2014
Equivalently, a(n) ~ phi^(2*n + 2) / (5^(1/4) * sqrt(Pi*n)), where phi = A001622 is the golden ratio. - Vaclav Kotesovec, Dec 08 2021

Extensions

Typo in second formula corrected by Vaclav Kotesovec, Feb 12 2014
More terms from Vincenzo Librandi, Feb 13 2014

A078679 Number of Grand Motzkin paths of length n with no zigzags, that is with no factors UDU and DUD.

Original entry on oeis.org

1, 1, 3, 7, 17, 43, 111, 291, 771, 2059, 5533, 14943, 40523, 110271, 300949, 823417, 2257877, 6203239, 17071779, 47054475, 129872499, 358896927, 992907525, 2749737663, 7622185263, 21146597511, 58714466733, 163142652877, 453612137587, 1262048222181, 3513361583965
Offset: 0

Views

Author

Emanuele Munarini, Dec 17 2002

Keywords

Comments

Also number of words on the alphabet {0,1,h} with length n, with an equal number of 1's and 0's and avoiding zigzags that is avoiding the subwords 101 and 010.

Examples

			For n = 3 we have the words hhh, 01h, 0h1, h01, 10h, 1h0, h10.
		

Crossrefs

Cf. A078678.

Programs

  • Mathematica
    Table[SeriesCoefficient[Series[Sqrt[ ( 1 - x + x^2 ) / ( 1 - 3 x + x^3 + x^4 )], {x, 0, n}], n], {n, 0, 40}]
  • Maxima
    a(n):=coeff(taylor(sqrt((1-x+x^2)/(1-3*x+x^3+x^4)),x,0,n),x,n);
    makelist(a(n),n,0,12); /* Emanuele Munarini, Jul 07 2011 */

Formula

G.f.: sqrt( ( 1 - x + x^2 ) / ( 1 - 3*x + x^3 + x^4 ) ).
Recurrence: 0 = (n+6)*a(n+6) - (4*n+21)*a(n+5) + (4*n+15)*a(n+4) - (2*n+3)*a(n+3) + a(n+2) - a(n+1) + (n+1)*a(n).

A275046 Number of binary strings with n zeros and n ones avoiding the substrings 10101101 and 1110101.

Original entry on oeis.org

1, 2, 6, 20, 70, 245, 874, 3164, 11577, 42694, 158431, 590873, 2212797, 8315535, 31341163, 118423810, 448455754, 1701534151, 6467049185, 24617030774, 93834205107, 358116770601, 1368283768753, 5233261657558, 20034371696497, 76763164565117, 294357181436313, 1129575035419485
Offset: 0

Views

Author

Gheorghe Coserea, Jul 17 2016

Keywords

Comments

Numerical experiment gives a(n) ~ k * r^n/sqrt(n*Pi) * (1 + O(1/n)), where k=1.06869393488382855... and r=3.91019320429177568...(the largest positive real root of P(x) = 4*x^20 - 20*x^19 + 8*x^18 + 75*x^17 - 233*x^16 + 368*x^15 - 286*x^14 + 154*x^13 + 66*x^12 - 203*x^11 + x^10 - 56*x^9 - 182*x^8 - 11*x^7 - 43*x^6 + 26*x^5 + 62*x^4 + 63*x^3 + 23*x^2 - 8*x - 4). - Gheorghe Coserea, Jun 28 2018

Examples

			For n = 5 there are binomial(10,5) = 252 binary strings with 5 zeros and 5 ones; seven out of this 252 binary strings contain as substrings w1=10101101 or w2=1110101, i.e.
   0123456789
   ----------
1  0001110101 contains w2 at offset 3
2  0010101101 contains w1 at offset 2
3  0011101010 contains w2 at offset 2
4  0101011010 contains w1 at offset 1
5  0111010100 contains w2 at offset 1
6  1010110100 contains w1 at offset 0
7  1110101000 contains w2 at offset 0
Therefore a(5) = 252 - 7 = 245.
		

Crossrefs

Main diagonal of A273914.

Programs

  • Mathematica
    a[n_] := SeriesCoefficient[(1 + x^2 y^3 + x^2 y^4 + x^3 y^4 - x^3 y^6) / (1 - x - y + x^2 y^3 - x^3 y^3 - x^4 y^4 - x^3 y^6 + x^4 y^6), {x, 0, n}, {y, 0, n}]; Table[a[n], {n, 0, 27}] (* Jean-François Alcover, Aug 20 2018 *)
  • PARI
    r1 = (1+x^2*y^3+x^2*y^4+x^3*y^4-x^3*y^6);
    r2 = (1-x-y+x^2*y^3-x^3*y^3-x^4*y^4-x^3*y^6+x^4*y^6);
    diag(expr, N=22, var=variables(expr)) = {
      my(a = vector(N));
      for (k = 1, #var, expr = taylor(expr, var[#var - k + 1], N));
      for (n = 1, N, a[n] = expr;
        for (k = 1, #var, a[n] = polcoeff(a[n], n-1)));
      return(a);
    };
    diag(r1/r2, 28)
    F  = (x + 1)*(4*x^20 + 8*x^19 - 23*x^18 - 63*x^17 - 62*x^16 - 26*x^15 + 43*x^14 + 11*x^13 + 182*x^12 + 56*x^11 - x^10 + 203*x^9 - 66*x^8 - 154*x^7 + 286*x^6 - 368*x^5 + 233*x^4 - 75*x^3 - 8*x^2 + 20*x - 4)*(y^4 - y^3)  - (12*x^17 + 48*x^16 + 72*x^15 + 49*x^14 - 23*x^13 - 57*x^12 - 91*x^11 - 137*x^10 - 84*x^9 - 34*x^8 - 91*x^7 + 62*x^6 + 24*x^5 - 34*x^4 + 41*x^3 - 10*x^2 - 3*x - 3)*y^2 + (x^15 + 4*x^14 + 6*x^13 + 3*x^12 - 6*x^11 - 11*x^10 - 11*x^9 - 8*x^8 - 3*x^7 + 12*x^6 + 11*x^4 + 5*x^3 - 6*x^2 - 4)*y - x^4 + x + 1;
    \\ test: y = Ser(diag(r1/r2, 100)); 0 == subst(F, 'y, y)
    
  • PARI
    x='x; y='y; t='t;
    seq(N) = {
      my(Fx = substvec(F, [x, y], [t, x]), y0 = 1 + O('t^N), y1=0, n=1);
      while (n++,
        y1 = y0 - subst(Fx, 'x, y0)/subst(deriv(Fx, 'x), 'x, y0);
        if (y1 == y0, break()); y0 = y1); Vec(y0);
    };
    seq(28)
    \\ Gheorghe Coserea, Jul 18 2018

Formula

a(n) = [x^n y^n] (1+x^2*y^3+x^2*y^4+x^3*y^4-x^3*y^6) / (1-x-y+x^2*y^3 -x^3*y^3-x^4*y^4-x^3*y^6+x^4*y^6).
From Gheorghe Coserea, Jul 17 2018: (Start)
G.f. y=A(x) satisfies:
0 = (x + 1)*(4*x^20 + 8*x^19 - 23*x^18 - 63*x^17 - 62*x^16 - 26*x^15 + 43*x^14 + 11*x^13 + 182*x^12 + 56*x^11 - x^10 + 203*x^9 - 66*x^8 - 154*x^7 + 286*x^6 - 368*x^5 + 233*x^4 - 75*x^3 - 8*x^2 + 20*x - 4)*(y^4 - y^3) - (12*x^17 + 48*x^16 + 72*x^15 + 49*x^14 - 23*x^13 - 57*x^12 - 91*x^11 - 137*x^10 - 84*x^9 - 34*x^8 - 91*x^7 + 62*x^6 + 24*x^5 - 34*x^4 + 41*x^3 - 10*x^2 - 3*x - 3)*y^2 + (x^15 + 4*x^14 + 6*x^13 + 3*x^12 - 6*x^11 - 11*x^10 - 11*x^9 - 8*x^8 - 3*x^7 + 12*x^6 + 11*x^4 + 5*x^3 - 6*x^2 - 4)*y - x^4 + x + 1.
0 = x*(x + 1)*(4*x^20 + 8*x^19 - 23*x^18 - 63*x^17 - 62*x^16 - 26*x^15 + 43*x^14 + 11*x^13 + 182*x^12 + 56*x^11 - x^10 + 203*x^9 - 66*x^8 - 154*x^7 + 286*x^6 - 368*x^5 + 233*x^4 - 75*x^3 - 8*x^2 + 20*x - 4)*(118272*x^52 + 831744*x^51 + 1055904*x^50 - 7689296*x^49 - 38498448*x^48 - 80707744*x^47 - 72043786*x^46 + 66740441*x^45 + 346144275*x^44 + 625268594*x^43 + 589350508*x^42 + 17945175*x^41 - 884101205*x^40 - 1544594497*x^39 - 1347124444*x^38 - 211988089*x^37 + 1025901619*x^36 + 1241901364*x^35 + 616097420*x^34 - 78145486*x^33 - 99242286*x^32 + 531374412*x^31 + 906579073*x^30 + 469457541*x^29 - 557671181*x^28 - 782936093*x^27 - 717539334*x^26 - 40136982*x^25 + 457839043*x^24 - 311428424*x^23 + 3826606*x^22 - 491844856*x^21 - 133463183*x^20 - 60176593*x^19 + 144471284*x^18 - 190012265*x^17 + 85787300*x^16 - 80535081*x^15 + 8793691*x^14 + 10578217*x^13 - 9656310*x^12 + 18022318*x^11 - 26135422*x^10 + 12930260*x^9 - 3354132*x^8 + 541884*x^7 - 9616*x^6 - 57280*x^5 - 9208*x^4 + 9112*x^3 - 1040*x^2 - 280*x + 16)*y'''' + 4*(2838528*x^73 + 28067328*x^72 + 73561152*x^71 - 226808640*x^70 - 1991541264*x^69 - 5248168208*x^68 - 3107619252*x^67 + 20424566388*x^66 + 73353344501*x^65 + 120803944377*x^64 + 68101961985*x^63 - 186797665046*x^62 - 613175796828*x^61 - 923231475195*x^60 - 665765362797*x^59 + 399661471464*x^58 + 1879241350220*x^57 + 2725977199294*x^56 + 1953611739558*x^55 - 308344618572*x^54 - 2604282130026*x^53 - 3293902915065*x^52 - 2023915430978*x^51 - 99057127476*x^50 + 858463211952*x^49 + 317189348208*x^48 - 644601194734*x^47 - 507510602088*x^46 + 879140815897*x^45 + 2316302607265*x^44 + 2466044252703*x^43 + 1507845363339*x^42 - 37352834097*x^41 - 866197857474*x^40 - 550136559577*x^39 - 371957632883*x^38 + 280554188916*x^37 - 169839318847*x^36 - 548085762481*x^35 - 394885238292*x^34 - 961508690348*x^33 - 558871954052*x^32 - 268597349319*x^31 - 396264718574*x^30 - 54570409485*x^29 - 29474141703*x^28 + 54798043451*x^27 - 225168685420*x^26 + 219869326332*x^25 - 211388212265*x^24 + 121755651738*x^23 - 44532380475*x^22 + 41810572525*x^21 - 13020873945*x^20 - 34502727399*x^19 + 51399098138*x^18 - 37480914194*x^17 + 16266551868*x^16 + 4802405683*x^15 - 11015782402*x^14 + 6973213149*x^13 - 2867107486*x^12 + 1145934309*x^11 - 396485541*x^10 + 91079094*x^9 - 20790910*x^8 + 9018972*x^7 - 2729266*x^6 + 15970*x^5 + 152280*x^4 - 23540*x^3 - 4624*x^2 + 804*x - 40)*y''' + 12*(5913600*x^72 + 58552320*x^71 + 162198720*x^70 - 399479776*x^69 - 4024065824*x^68 - 11894928752*x^67 - 13359252044*x^66 + 19743062838*x^65 + 106170302098*x^64 + 196850199947*x^63 + 139990047211*x^62 - 242428556815*x^61 - 914440223127*x^60 - 1404267023705*x^59 - 981820207169*x^58 + 692860011210*x^57 + 2881981766799*x^56 + 3780666319153*x^55 + 1931509675560*x^54 - 1789113064830*x^53 - 4353254267040*x^52 - 3421680202122*x^51 + 86944304476*x^50 + 2529905700017*x^49 + 1255075892612*x^48 - 2347804140484*x^47 - 4006195397861*x^46 - 1459374421865*x^45 + 3708726044890*x^44 + 6578458317742*x^43 + 3981711739329*x^42 - 545975266760*x^41 - 3735058603101*x^40 - 2830413868772*x^39 + 496621169935*x^38 + 2215361366242*x^37 + 2664777396382*x^36 - 126126929968*x^35 - 1185628295801*x^34 - 1766130985147*x^33 - 1321402227308*x^32 - 554605775048*x^31 - 314472036802*x^30 - 124742883035*x^29 - 779639894108*x^28 - 187973020632*x^27 - 436320637251*x^26 - 110965040480*x^25 + 89434870246*x^24 - 59962248938*x^23 + 40664295470*x^22 - 159086840234*x^21 + 87274292183*x^20 - 64615348620*x^19 - 3906157152*x^18 + 42872210460*x^17 - 39037582211*x^16 + 17857634133*x^15 - 4859881314*x^14 + 1719235532*x^13 - 1220377579*x^12 + 826395920*x^11 - 452538461*x^10 + 276451285*x^9 - 77896966*x^8 - 7819744*x^7 + 11091416*x^6 - 2392952*x^5 + 84092*x^4 + 78168*x^3 - 13628*x^2 + 204*x - 40)*y'' + 24*(4730880*x^71 + 47278080*x^70 + 138487680*x^69 - 273327872*x^68 - 3224196672*x^67 - 10522840368*x^66 - 15683954824*x^65 + 2837440368*x^64 + 66783160692*x^63 + 157076042559*x^62 + 176460709731*x^61 - 20753120619*x^60 - 468777180135*x^59 - 901436210799*x^58 - 814713584628*x^57 + 118253282806*x^56 + 1519823466913*x^55 + 2171886524422*x^54 + 984539467703*x^53 - 1380275010648*x^52 - 2578554053427*x^51 - 1051193690751*x^50 + 1862189159015*x^49 + 2884190942011*x^48 + 178354766658*x^47 - 3671225244807*x^46 - 4179646483007*x^45 - 425026505279*x^44 + 4749349227024*x^43 + 5804031914804*x^42 + 1249983354384*x^41 - 3642913361190*x^40 - 5112487295002*x^39 - 1641304278133*x^38 + 2938886288909*x^37 + 4069038198838*x^36 + 1830779914789*x^35 - 1798238310417*x^34 - 1495907299753*x^33 - 1094364204315*x^32 + 807417393365*x^31 - 72154916922*x^30 - 8536980308*x^29 - 794452219816*x^28 - 509673251372*x^27 + 190937602442*x^26 - 234838593532*x^25 + 251283672141*x^24 - 379193047029*x^23 + 161017205569*x^22 - 113347214785*x^21 + 45981090690*x^20 - 22904707029*x^19 - 8687260383*x^18 - 31879707878*x^17 + 37099647203*x^16 - 21102826093*x^15 + 7822806180*x^14 - 6568577261*x^13 + 4330232930*x^12 - 2387982620*x^11 + 1109490464*x^10 - 512581326*x^9 + 162799386*x^8 - 23098368*x^7 - 6139110*x^6 + 3208022*x^5 - 413396*x^4 - 87740*x^3 + 17676*x^2 - 2732*x + 520)*y'.
(End)

A099172 Array T(m, n) read by antidiagonals: number of binary strings with m 1's and n 0's without zigzags.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 4, 2, 1, 1, 2, 5, 5, 2, 1, 1, 2, 6, 8, 6, 2, 1, 1, 2, 7, 11, 11, 7, 2, 1, 1, 2, 8, 14, 18, 14, 8, 2, 1, 1, 2, 9, 17, 26, 26, 17, 9, 2, 1, 1, 2, 10, 20, 35, 42, 35, 20, 10, 2, 1, 1, 2, 11, 23, 45, 62, 62, 45, 23, 11, 2, 1, 1, 2, 12, 26, 56, 86, 100, 86, 56, 26, 12, 2, 1
Offset: 0

Views

Author

Ralf Stephan, Oct 10 2004

Keywords

Examples

			Array begins:
1, 1, 1,  1,  1,  1,   1,   1,
1, 2, 2,  2,  2,  2,   2,   2,
1, 2, 4,  5,  6,  7,   8,   9,
1, 2, 5,  8, 11, 14,  17,  20,
1, 2, 6, 11, 18, 26,  35,  45,
1, 2, 7, 14, 26, 42,  62,  86,
1, 2, 8, 17, 35, 62, 100, 150,
1, 2, 9, 20, 45, 86, 150, 242,
		

Crossrefs

Main diagonal is A078678. Antidiagonal sums are A128588.

Programs

  • Maple
    gf:=(1 + x*y + x^2*y^2)/(1 - x - y + x*y - x^2*y^2);seq(seq(coeff(series(coeff(series(gf,y,m+1),y,m),x,d-m+1),x,d-m), m=0..d), d=0..9);
  • Mathematica
    T[m_, n_] := Sum[Binomial[m - k + 2 Floor[k/3], Floor[k/3]] Binomial[n - k + 2 Floor[k/3], Floor[k/3]], {k, 0, Min[m+Floor[m/2], n+Floor[n/2]]}];
    Table[T[m-n, n], {m, 0, 12}, {n, 0, m}] // Flatten (* Jean-François Alcover, Aug 17 2018 *)
  • PARI
    T(m,n)=sum(k=0,min(m+m\2,n+n\2),binomial(m-k+2*(k\3),k\3)*binomial(n-k+2*(k\3),k\3))
    
  • PARI
    T(n,k) = {x = xx + xx*O(xx^n); y = yy + yy*O(yy^k); polcoeff(polcoeff((1 + x*y + x^2*y^2)/(1 - x - y + x*y - x^2*y^2), n, xx), k, yy);} \\ Michel Marcus, Nov 25 2013
    
  • PARI
    {A(n, m) = if( n<0 || m<0, 0, polcoeff( polcoeff( (1 + x*y + x^2*y^2 ) / (1 - x - y + x*y - x^2*y^2) + x * O(x^n), n) + y * O(y^m), m))}; /* Michael Somos, Jun 06 2016 */

Formula

G.f.: (1 + x*y + x^2*y^2) / (1 - x - y + x*y - x^2*y^2).
T(m, n) = Sum{k=0..min(m+[m/2], n+[n/2]), C(m-k+2[k/3], [k/3])*C(n-k+2[k/3], [k/3]) }.
Showing 1-5 of 5 results.