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

A099254 Self-convolution of A010892. The g.f. is 1/(Alexander polynomial of granny knot).

Original entry on oeis.org

1, 2, 1, -2, -4, -2, 3, 6, 3, -4, -8, -4, 5, 10, 5, -6, -12, -6, 7, 14, 7, -8, -16, -8, 9, 18, 9, -10, -20, -10, 11, 22, 11, -12, -24, -12, 13, 26, 13, -14, -28, -14, 15, 30, 15, -16, -32, -16, 17, 34, 17, -18, -36, -18, 19, 38, 19, -20, -40, -20, 21, 42, 21
Offset: 0

Views

Author

Paul Barry, Oct 08 2004

Keywords

Comments

A granny knot sequence.
INVERTi transform of A077855: (1, 3, 6, 11, 20, 36, 64, 133, ...). - Gary W. Adamson, Jan 13 2017

Crossrefs

Row sums of array A128502.
Cf. A077855, A076118 (first differences).

Programs

  • Maple
    A099254 := proc(n)
        option remember ;
        if n <= 3 then
            op(n+1,[1,2,1,-2]) ;
        else
            2*procname(n-1)-3*procname(n-2)+2*procname(n-3)-procname(n-4) ;
        end if;
    end proc:
    seq(A099254(n),n=0..80) ; # R. J. Mathar, Jul 08 2022
  • Mathematica
    LinearRecurrence[{2, -3, 2, -1}, {1, 2, 1, -2}, 100] (* Jean-François Alcover, Sep 21 2022 *)
  • Python
    a0,a1,a2,a3,n = -2,1,2,1,3
    print(0,a3)
    print(1,a2)
    print(2,a1)
    print(3,a0)
    while n < 20000:
        a0,a1,a2,a3,n = 2*a0-3*a1+2*a2-a3,a0,a1,a2,n+1
        print(n,a0) # A.H.M. Smeets, Sep 13 2018
    
  • Python
    def A099254(n):
        a, b = divmod(n,3)
        return (1+(b&1))*(-a-1 if a&1 else a+1) # Chai Wah Wu, Jan 31 2023

Formula

G.f.: 1/(1 - 2*x + 3*x^2 - 2*x^3 + x^4) = 1/(1 - x + x^2)^2.
a(n) = 4*sqrt(3)*sin(Pi*n/3 + Pi/3)/9 + 2*(n + 1)*sin(Pi*n/3 + Pi/6)/3.
a(n) = Sum_{k=0..floor(n/2)} binomial(n-k,k)*(n-k+1)*(-1)^k. - Paul Barry, Nov 12 2004
a(n) = 2*cos(2*Pi*(n + 2)/3)*(floor(n/3) + 1)*(-1)^(n+1). - Tani Akinari, Jul 01 2013
a(n) = (1/54)*(18*(n + 2)*(-1)^floor(n/3) + (3*n + 11)*(-1)^floor((n + 1)/3) - 9*(n + 1)*(-1)^floor((n + 2)/3) - 2*(3*n + 8)*(-1)^floor((n + 4)/3)). - John M. Campbell, Dec 23 2016
From A.H.M. Smeets, Sep 13 2018: (Start)
a(n) = 2*a(n-1) - 3*a(n-2) + 2*a(n-3) - a(n-4) for n >= 4.
a(3*k) = a(3*k+2) = (-1)^k*(k + 1) for k >= 0.
a(3*k+1) = -(-1)^k*2*(k + 1) for k >= 0. (End)
Sum_{n>=0} 1/a(n) = 5*log(2)/2. - Amiram Eldar, May 10 2025

A355394 Number of integer partitions of n such that, for all parts x, x - 1 or x + 1 is also a part.

Original entry on oeis.org

1, 0, 0, 1, 1, 3, 3, 6, 6, 10, 11, 16, 18, 25, 30, 38, 47, 59, 74, 90, 112, 136, 171, 203, 253, 299, 372, 438, 536, 631, 767, 900, 1085, 1271, 1521, 1774, 2112, 2463, 2910, 3389, 3977, 4627, 5408, 6276, 7304, 8459, 9808, 11338, 13099, 15112, 17404, 20044, 23018, 26450, 30299, 34746, 39711, 45452, 51832
Offset: 0

Views

Author

Gus Wiseman, Aug 26 2022

Keywords

Comments

These are partitions without a neighborless part, where a part x is neighborless if neither x - 1 nor x + 1 are parts. The first counted partition that does not cover an interval is (5,4,2,1).

Examples

			The a(0) = 1 through a(9) = 11 partitions:
  ()  .  .  (21)  (211)  (32)    (321)    (43)      (332)      (54)
                         (221)   (2211)   (322)     (3221)     (432)
                         (2111)  (21111)  (2221)    (22211)    (3222)
                                          (3211)    (32111)    (3321)
                                          (22111)   (221111)   (22221)
                                          (211111)  (2111111)  (32211)
                                                               (222111)
                                                               (321111)
                                                               (2211111)
                                                               (21111111)
		

Crossrefs

The singleton case is A355393, complement A356235.
The complement is counted by A356236, ranked by A356734.
The strict case is A356606, complement A356607.
These partitions are ranked by A356736.
A000041 counts integer partitions, strict A000009.
A000837 counts relatively prime partitions, ranked by A289509.
A007690 counts partitions with no singletons, complement A183558.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],Function[ptn,!Or@@Table[!MemberQ[ptn,x-1]&&!MemberQ[ptn,x+1],{x,Union[ptn]}]]]],{n,0,30}]

Formula

a(n) = A000041(n) - A356236(n).

Extensions

a(31)-a(59) from Lucas A. Brown, Sep 04 2022

A023434 Dying rabbits: a(n) = a(n-1) + a(n-2) - a(n-4).

Original entry on oeis.org

0, 1, 1, 2, 3, 4, 6, 8, 11, 15, 20, 27, 36, 48, 64, 85, 113, 150, 199, 264, 350, 464, 615, 815, 1080, 1431, 1896, 2512, 3328, 4409, 5841, 7738, 10251, 13580, 17990, 23832, 31571, 41823, 55404, 73395, 97228, 128800, 170624, 226029, 299425, 396654, 525455
Offset: 0

Views

Author

Keywords

Comments

Limit_{n->infinity} a(n)/a(n-1) = positive root of 1+x-x^3 (smallest Pisot-Vijayaraghavan number, A060006). - Gerald McGarvey, Sep 19 2004
a(n) is the number of distinct even run-types taken over nonempty subsets of [n+1]. The run-type of a set of positive integers is the sequence of lengths when the set is decomposed into maximal runs of consecutive integers and it is even if all its entries are even. For example, the set {2,3,5,6,9,10,11} has run-type (2,2,3) and a(6)=6 counts (2),(4),(6),(2,2),(2,4),(4,2). - David Callan, Jul 14 2006
Partial sums of the sequence obtained by deleting the first 2 terms of A000931. Example: 0+1+0+1+1 = 3 = a(4). - David Callan, Jul 14 2006
One less than the sequence obtained by deleting the first 7 terms of A000931. - Ira M. Gessel, May 02 2007
This sequence counts ordered partitions of (n-1) into parts less than or equal to 3, in which the order of 1's are unimportant. Alternately, the order of 2's and 3's are important (see example). - David Neil McGrath, Apr 26 2015
Interleaving of A289692 and A077855. - Bruce J. Nicholson, Apr 09 2018

Examples

			G.f. = x + x^2 + 2*x^3 + 3*x^4 + 4*x^5 + 6*x^6 + 8*x^7 + 11*x^8 + ...
a(7)=8, with (n-1)=6. The partially ordered partitions of 6 are (33),(321,312,132=one),(231,213,123=one),(3111,1311,1131,1113=one),(222),(2211,1122,1221,2112,1212,2121=one),(21111,12111,11211,11121,11112=one),(111111). - _David Neil McGrath_, Apr 26 2015
		

Crossrefs

Programs

  • Magma
    [0,1] cat [ n le 4 select (n) else Self(n-1)+Self(n-2)-Self(n-4): n in [1..45] ]; // Vincenzo Librandi, Apr 27 2015
  • Maple
    f:= gfun:-rectoproc({a(n)=a(n-1)+a(n-2)-a(n-4),seq(a(i)=[0,1,1,2][i+1],i=0..3)},a(n),remember):
    seq(f(i),i=0..100); # Robert Israel, May 04 2015
  • Mathematica
    a[ n_] := If[ n < 0, SeriesCoefficient[ -x^3 / (1 - x^2 - x^3 + x^4), {x, 0, -n}], SeriesCoefficient[ x / (1 - x - x^2 + x^4), {x, 0, n}]]; (* Michael Somos, Nov 29 2013 *)
    LinearRecurrence[{1, 1, 0, -1}, {0, 1, 1, 2}, 50] (* Vincenzo Librandi, Apr 27 2015 *)
  • PARI
    {a(n) = polcoeff( if( n<0, -x^3 / (1 - x^2 - x^3 + x^4), x / (1 - x - x^2 + x^4)) + x * O(x^abs(n)), abs(n))}; /* Michael Somos, Nov 29 2013 */
    
  • PARI
    x='x+O('x^99); concat(0, Vec(x/((1-x)*(1-x^2-x^3)))) \\ Altug Alkan, Apr 09 2018
    

Formula

a(n) = A000931(n+7)-1.
a(0)=0, a(1)=1, a(2)=1 then for n>2 a(n)=ceiling(r*a(n-1)) where r is the positive root of x^3-x-1=0. - Benoit Cloitre, Jun 19 2004
G.f.: x/((1-x)*(1-x^2-x^3)). - Jon Perry, Jul 04 2004
For n>2 a(n) = floor(sqrt(a(n-3)*a(n-2) + a(n-2)*a(n-1) + a(n-1)*a(n-3))) + 1. - Gerald McGarvey, Sep 19 2004
a(n) = Sum_{k=1..floor((n+2)/3)} binomial(floor((n+2-k)/2),k). This formula counts even run-types by length. - David Callan, Jul 14 2006
a(n) = a(n-2) + a(n-3) + 1. - Mark Dols, Feb 01 2010
a(n) + a(n+1) = A054405(n). Partial sums is A054405. - Michael Somos, Dec 01 2013
a(-3-n) = -A077905(n) for all n in Z. - Michael Somos, Sep 25 2014

A289692 The number of partitions of [n] with exactly 2 blocks without peaks.

Original entry on oeis.org

0, 1, 2, 4, 8, 15, 27, 48, 85, 150, 264, 464, 815, 1431, 2512, 4409, 7738, 13580, 23832, 41823, 73395, 128800, 226029, 396654, 696080, 1221536, 2143647, 3761839, 6601568, 11584945
Offset: 1

Views

Author

R. J. Mathar, Jul 09 2017

Keywords

Crossrefs

Cf. A005251 (first differences), A289693 (3 blocks), A289694 (4 blocks).

Programs

  • GAP
    a:=[0, 1, 2, 4]; for n in [5..10^2] do a[n]:=3*a[n-1]-3*a[n-2]+2*a[n-3]-a[n-4]; od; a; # Muniru A Asiru, Jan 25 2018
    
  • Magma
    I:=[0, 1, 2, 4]; [n le 4 select I[n] else 3*Self(n-1)-3*Self(n-2)+2*Self(n-3)-Self(n-4): n in [1..40]]; // Vincenzo Librandi, Jan 26 2018
  • Maple
    a := proc(n) option remember: if n = 1 then 0 elif n = 2 then 1 elif n=3 then 2 elif n=4 then 4 elif  n >= 5 then 3*procname(n-1) -3*procname(n-2)+2*procname(n-3)-procname(n-4) fi; end:
    seq(a(n), n = 0..100); # Muniru A Asiru, Jan 25 2018
  • Mathematica
    LinearRecurrence[{3, -3, 2, -1}, {0, 1, 2, 4}, 40] (* Vincenzo Librandi, Jan 26 2018 *)

Formula

From Colin Barker, Nov 07 2017: (Start)
G.f.: x^2*(1 - x + x^2) / ((1 - x)*(1 - 2*x + x^2 - x^3)).
a(n) = 3*a(n-1) - 3*a(n-2) + 2*a(n-3) - a(n-4) for n>4. (End)
a(n) = A077855(n-2) - A005314(n-2) for n>1. - John Molokach, Jan 23 2018
a(n) - a(n-1) = A005251(n). - R. J. Mathar, Mar 11 2021

A018918 Define the generalized Pisot sequence T(a(0),a(1)) by: a(n+2) is the greatest integer such that a(n+2)/a(n+1) < a(n+1)/a(n). This is T(3,6).

Original entry on oeis.org

3, 6, 11, 20, 36, 64, 113, 199, 350, 615, 1080, 1896, 3328, 5841, 10251, 17990, 31571, 55404, 97228, 170624, 299425, 525455, 922110, 1618191, 2839728, 4983376, 8745216, 15346785, 26931731, 47261894, 82938843, 145547524, 255418100, 448227520, 786584465
Offset: 0

Views

Author

Keywords

Comments

Not to be confused with the Pisot T(3,6) sequence as defined in A008776 which is A007283. - R. J. Mathar, Feb 17 2016

Crossrefs

Seems to be A010901(n) - 1 and (see conjecture) A077855(n+1).

Programs

  • Magma
    Tiv:=[3,6]; [n le 2 select Tiv[n] else Ceiling(Self(n-1)^2/Self(n-2)-1): n in [1..40]]; // Bruno Berselli, Feb 17 2016
    
  • Mathematica
    RecurrenceTable[{a[1] == 3, a[2] == 6, a[n] == Ceiling[a[n-1]^2/a[n-2] - 1]}, a, {n, 40}] (* Vincenzo Librandi, Feb 17 2016 *)
  • PARI
    T(a0, a1, maxn) = a=vector(maxn); a[1]=a0; a[2]=a1; for(n=3, maxn, a[n]=ceil(a[n-1]^2/a[n-2])-1); a
    T(3, 6, 50) \\ Colin Barker, Jul 29 2016

Formula

Conjectures from Colin Barker, Dec 21 2012: (Start)
a(n) = 3*a(n-1)-3*a(n-2)+2*a(n-3)-a(n-4).
G.f.: -(x^3-2*x^2+3*x-3) / ((x-1)*(x^3-x^2+2*x-1)). (End)
a(n) = ceiling( a(n-1)^2/a(n-2)-1 ), by definition. - Bruno Berselli, Feb 16 2016

A209232 a(n) is 2^n times the expected value of the shortest run of 0's in a binary word of length n.

Original entry on oeis.org

0, 1, 4, 11, 25, 52, 103, 199, 380, 724, 1382, 2649, 5103, 9881, 19224, 37559, 73646, 144848, 285623, 564429, 1117396, 2215436, 4398054, 8740266, 17385207, 34607218, 68934319, 137386725, 273942683, 546450648, 1090419638
Offset: 0

Views

Author

Geoffrey Critzer, Jan 12 2013

Keywords

Comments

a(n) is also the sum of the number of binary words containing at least one 0 and having every consecutive run of 0's of length >= i for i >= 1. In other words, a(n) = A000225(n) + A077855(n) + A130578(n) + A209231(n) + ...

Examples

			a(3) = 11. To the length 3 binary words {0, 0, 0}, {0, 0, 1}, {0, 1, 0}, {0, 1, 1}, {1, 0, 0}, {1, 0, 1}, {1, 1, 0}, {1, 1, 1} we have respectively shortest zero runs of length 3 + 2 + 1 + 1 + 2 + 1 + 1 + 0 = 11.
		

References

  • R. Sedgewick and P. Flajolet, Analysis of Algorithms, Addison Wesley, 1996, Chapter 7.

Crossrefs

Cf. A119706.

Programs

  • Mathematica
    nn = 30; Apply[Plus, Table[a = x^n/(1 - x); CoefficientList[Series[(a + 1)/((1 - a x/(1 - x)))*1/(1 - x) - 1/(1 - x), {x, 0, nn}], x], {n, 1, nn}]]

Formula

O.g.f.: Sum_{k >= 1} (x^k/(1 - x) + 1) / ((1 - x^(k + 1)/(1 - x)^2)) * 1/(1 - x) - 1/(1 - x).

A098076 Triangle read by rows: T(n,k) is the number of peakless Motzkin paths of length n and height k (can be easily expressed using RNA secondary structure terminology).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 3, 1, 6, 1, 1, 11, 5, 1, 20, 15, 1, 1, 36, 38, 7, 1, 64, 91, 28, 1, 1, 113, 211, 89, 9, 1, 199, 477, 255, 45, 1, 1, 350, 1059, 690, 172, 11, 1, 615, 2321, 1797, 572, 66, 1, 1, 1080, 5037, 4555, 1754, 295, 13, 1, 1896, 10847, 11320, 5098, 1118, 91, 1, 1, 3328
Offset: 0

Views

Author

Emeric Deutsch, Sep 13 2004

Keywords

Comments

Row sums are the RNA secondary structure numbers (A004148). Column 1 without the zeros yields A077855.

Examples

			Triangle starts:
1;
1;
1;
1,   1;
1,   3;
1,   6,   1;
1,  11,   5;
1,  20,  15,   1;
1,  36,  38,   7;
1,  64,  91,  28,  1;
1, 113, 211,  89,  9;
1, 199, 477, 255, 45,  1;
Row n >0 has ceil(n/2) terms.
T(6,2) = 5 because the peakless Motzkin paths of length 6 and height 2 are HUUHDD, UHUHDD, UUHHDD, UUHDDH, UUHDHD, where U=(1,1), H=(1,0) and D=(1,-1).
		

Crossrefs

Programs

  • Maple
    P[0]:=1: P[1]:=sort(1-z): for j from 2 to 30 do P[j]:=sort(expand((1-z+z^2)*P[j-1]-z^2*P[j-2])) od: G:=1+sum(t^i*z^(2*i+1)/P[i]/P[i+1],i=0..25): Gser:=simplify(series(G,z=0,21)): Q[0]:=1: for m from 1 to 18 do Q[m]:=sort(coeff(Gser,z^m)) od: 1,seq(seq(coeff(t*Q[n],t^k),k=1..ceil(n/2)),n=1..16);
  • Mathematica
    max = 16; p[0] = 1; p[1] := 1 - z; p[j_] := p[j] = (1 - z + z^2)*p[j - 1] - z^2*p[j - 2]; gf = 1 + Sum[t^j*z^(2*j + 1)/(p[j]*p[j + 1]), {j, 0, max}]; se = Series[gf, {t, 0, max}, {z, 0, max}]; CoefficientList[se, {z, t}] // DeleteCases[#, 0, 2] & // Flatten (* Jean-François Alcover, Jun 25 2013 *)

Formula

G.f.: 1+sum(t^j*z^(2j+1)/[P(j)*P(j+1)], j=0..infinity), where P(j) are polynomials in z defined by P(0)=1, P(1)=1-z, P(j)=(1-z+z^2)P(j-1) -z^2*P(j-2), j=2, 3, ... .

A209231 Number of binary words of length n such that there is at least one 0 and every run of consecutive 0's is of length >= 4.

Original entry on oeis.org

0, 0, 0, 0, 1, 3, 6, 10, 15, 22, 33, 51, 80, 125, 193, 295, 449, 684, 1045, 1600, 2451, 3752, 5738, 8770, 13403, 20488, 31326, 47903, 73251, 112003, 171244, 261812, 400284, 612008, 935736, 1430709, 2187495, 3344566, 5113646, 7818463, 11953990
Offset: 0

Views

Author

Geoffrey Critzer, Jan 12 2013

Keywords

Examples

			a(5) = 3 because we have: {0,0,0,0,0}, {0,0,0,0,1}, {1,0,0,0,0}.
		

Crossrefs

Programs

  • Mathematica
    nn=40; a=x^4/(1-x); CoefficientList[Series[(a+1)/((1-a x/(1-x)))*1/(1-x)-1/(1-x), {x,0,nn}], x]

Formula

O.g.f.: x^4/((1-x)*(1-2*x+x^2-x^5)), see Mathematica code for unsimplified form.
Showing 1-8 of 8 results.