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-10 of 19 results. Next

A005993 Expansion of (1+x^2)/((1-x)^2*(1-x^2)^2).

Original entry on oeis.org

1, 2, 6, 10, 19, 28, 44, 60, 85, 110, 146, 182, 231, 280, 344, 408, 489, 570, 670, 770, 891, 1012, 1156, 1300, 1469, 1638, 1834, 2030, 2255, 2480, 2736, 2992, 3281, 3570, 3894, 4218, 4579, 4940, 5340, 5740, 6181, 6622, 7106, 7590, 8119, 8648, 9224, 9800
Offset: 0

Views

Author

N. J. A. Sloane, Winston C. Yang (yang(AT)math.wisc.edu)

Keywords

Comments

Alkane (or paraffin) numbers l(6,n).
Dimension of the space of homogeneous degree n polynomials in (x1, y1, x2, y2) invariant under permutation of variables x1<->y1, x2<->y2.
Also multidigraphs with loops on 2 nodes with n arcs (see A138107). - Vladeta Jovovic, Dec 27 1999
Euler transform of finite sequence [2,3,0,-1]. - Michael Somos, Mar 17 2004
a(n-2) is the number of plane partitions with trace 2. - Michael Somos, Mar 17 2004
With offset 4, a(n) is the number of bracelets with n beads, 3 of which are red, 1 of which is blue. For odd n, a(n) = C(n-1,3)/2. For even n, a(n) = C(n-1,3)/2 +(n-2)/4. For n >= 6, with K = (n-1)(n-2)/((n-5)(n-4)), for odd n, a(n) = K*a(n-2). For even n, a(n) = K*a(n-2) -(n-2)/(n-5). - Washington Bomfim, Aug 05 2008
Equals (1,2,3,4,...) convolved with (1,0,3,0,5,...). - Gary W. Adamson, Feb 16 2009
Equals row sums of triangle A177878.
Equals (1/2)*((1, 4, 10, 20, 35, 56, ...) + (1, 0, 2 0, 3, 0, 4, ...)).
From Ctibor O. Zizka, Nov 21 2014: (Start)
With offset 4, a(n) is the number of different patterns of the 2-color 4-partition of n.
P(n)_(k;t) gives the number of different patterns of the t-color, k-partition of n.
P(n;i;j) = Sum(r=1..m) c_(i,j)*v_r*F_r(X_1,...,X_i).
m partition number of i.
c_(i,j) number of different coloring patterns on the r-th form (X_1,...,X_i) of i-partition with j-colors.
v_r number of i-partitions of n of the r-th form (X_1,...,X_i).
F_r(X_1,...,X_i) number of different patterns of the r-th form i-partition of n.
Some simple results:
P(1)(k;t)=1, P(2)(k;t)=2, P(3)(k;t)=4, P(4)(k;t)=11, etc.
P(n;1;1) = P(n;n;n) = 1 for all n;
P(n;2;2) = floor(n/2) (A004526);
P(n;3;2) = (n*n - 2*n + n mod 2)/4 (A002620).
This sequence is a(n) = P(n;4;2).
2-coloring of 4-partition is (A,B,A,B) or (B,A,B,A).
Each 4-partition of n has one of the form (X_1,X_1,X_1,X_1),(X_1,X_1,X_1,X_2), (X_1,X_1,X_2,X_2),(X_1,X_1,X_2,X_3),(X_1,X_2,X_3,X_4).
The number of forms is m=5 which is the partition number of k=4.
Partition form (X_1,X_1,X_1,X_1) gives 1 pattern ((X_1A,X_1B,X_1A,X_1B), (X_1,X_1,X_1,X_2) gives 2 patterns, (X_1,X_1,X_2,X_2) gives 4 patterns, (X_1,X_1,X_2,X_3) gives 6 patterns and (X_1,X_2,X_3,X_4) gives 12 patterns.
Thus a(n) = P(n;4;2) = 1*1*v_1 + 1*2*v_2 + 1*4*v_3 + 1*6*v_4 + 1*12*v_5 where v_r is the number of different 4-partitions of the r-th form (X_1,X_2,X_3,X_4) for a given n.
Example:
The 4-partitions of 8 are (2,2,2,2), (1,1,1,5), (1,1,3,3), (1,1,2,4), and (1,2,2,3):
(2,2,2,2) 1 pattern
(1,1,1,5), (1,1,5,1) 2 patterns
(1,1,3,3), (1,3,3,1), (3,1,1,3), (1,3,1,3) 4 patterns
(1,1,2,4), (1,1,4,2), (1,2,1,4), (1,2,4,1), (1,4,1,2), (2,1,1,4) 6 patterns
(2,2,1,3), (2,2,3,1), (2,1,2,3), (2,1,3,2), (2,3,2,1), (1,2,2,3) 6 patterns
Thus a(8) = P(8,4,2) = 1 + 2 + 4 + 6 + 6 = 19. (End)
a(n) = length of run n+2 of consecutive 1's in A254338. - Reinhard Zumkeller, Feb 27 2015
Take a chessboard of (n+2) X (n+2) unit squares in which the a1 square is black. a(n) is the number of composite squares having black unit squares on their vertices. - Ivan N. Ianakiev, Jul 19 2018
a(n) is the number of 1423-avoiding odd Grassmannian permutations of size n+2. Avoiding any of the patterns 2314 or 3412 gives the same sequence. - Juan B. Gil, Mar 09 2023

Examples

			a(2) = 6, since ( x1*y1, x2*y2, x1*x1+y1*y1, x2*x2+y2*y2, x1*x2+y1*y2, x1*y2+x2*y1 ) are a basis for homogeneous quadratic invariant polynomials.
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • L. Smith, Polynomial Invariants of Finite Groups, A K Peters, 1995, p. 96.

Crossrefs

Cf. A177878.
Partial sums of A008794 (without 0). - Bruno Berselli, Aug 30 2013

Programs

  • Haskell
    Following Gary W. Adamson.
    import Data.List (inits, intersperse)
    a005993 n = a005994_list !! n
    a005993_list = map (sum . zipWith (*) (intersperse 0 [1, 3 ..]) . reverse) $
                       tail $ inits [1..]
    -- Reinhard Zumkeller, Feb 27 2015
    
  • Magma
    I:=[1,2,6,10,19,28]; [n le 6 select I[n] else 2*Self(n-1)+Self(n-2)-4*Self(n-3)+Self(n-4)+2*Self(n-5)-Self(n-6): n in [1..60]]; // Vincenzo Librandi, Jul 19 2015
    
  • Maple
    g := proc(n) local i; add(floor(i/2)^2,i=1..n+1) end: # Joseph S. Riel (joer(AT)k-online.com), Mar 22 2002
    a:= n-> (Matrix([[1, 0$3, -1, -2]]).Matrix(6, (i,j)-> if (i=j-1) then 1 elif j=1 then [2, 1, -4, 1, 2, -1][i] else 0 fi)^n)[1,1]; seq (a(n), n=0..44); # Alois P. Heinz, Jul 31 2008
  • Mathematica
    CoefficientList[Series[(1+x^2)/((1-x)^2*(1-x^2)^2),{x,0,44}],x]  (* Jean-François Alcover, Apr 08 2011 *)
    LinearRecurrence[{2,1,-4,1,2,-1},{1,2,6,10,19,28},50] (* Harvey P. Dale, Feb 20 2012 *)
  • PARI
    a(n)=polcoeff((1+x^2)/(1-x)^2/(1-x^2)^2+x*O(x^n),n)
    
  • PARI
    a(n) = (binomial(n+3, n) + (1-n%2)*binomial((n+2)/2, n>>1))/2 \\ Washington Bomfim, Aug 05 2008
    
  • PARI
    a = vector(50); a[1]=1; a[2]=2;
    for(n=3, 50, a[n] = ((n+2)*a[n-2]+2*a[n-1]-n)/(n-2)); a \\ Gerry Martens, Jun 03 2018
    
  • Sage
    def A005993():
        a, b, to_be = 0, 0, True
        while True:
            yield (a*(a*(2*a+9)+13)+b*(b+1)*(2*b+1)+6)//6
            if to_be: b += 1
            else: a += 1
            to_be = not to_be
    a = A005993()
    [next(a) for  in range(48)] # _Peter Luschny, May 04 2016

Formula

l(c, r) = 1/2 C(c+r-3, r) + 1/2 d(c, r), where d(c, r) is C((c + r - 3)/2, r/2) if c is odd and r is even, 0 if c is even and r is odd, C((c + r - 4)/2, r/2) if c is even and r is even, C((c + r - 4)/2, (r - 1)/2) if c is odd and r is odd.
G.f.: (1+x^2)/((1-x)^2*(1-x^2)^2) = (1+x^2)/((1+x)^2*(x-1)^4) = (1/(1-x)^4 +1/(1-x^2)^2)/2.
a(2n) = (n+1)(2n^2+4n+3)/3, a(2n+1) = (n+1)(n+2)(2n+3)/3. a(-4-n) = -a(n).
From Yosu Yurramendi, Sep 12 2008: (Start)
a(n+1) = a(n) + A008794(n+3) with a(1)=1.
a(n) = A027656(n) + 2*A006918(n).
a(n+2) = a(n) + A000982(n+2) with a(1)=1, a(2)=2. (End)
a(n) = 2*a(n-1) + a(n-2) - 4*a(n-3) + a(n-4) + 2*a(n-5) - a(n-6). - Jaume Oliver Lafont, Dec 05 2008
a(n) = (n^3 + 6*n^2 + 11*n + 6)/12 + ((n+2)/4)[n even] (the bracket means that the second term is added if and only if n is even). - Benoit Jubin, Mar 31 2012
a(n) = (1/12)*n*(n+1)*(n+2) + (1/4)*(n+1)*(1/2)*(1-(-1)^n), with offset 1. - Yosu Yurramendi, Jun 20 2013
a(n) = Sum_{i=0..n+1} ceiling(i/2) * round(i/2) = Sum_{i=0..n+2} floor(i/2)^2. - Bruno Berselli, Aug 30 2013
a(n) = (n + 2)*(3*(-1)^n + 2*n^2 + 8*n + 9)/24. - Ilya Gutkovskiy, May 04 2016
Recurrence formula: a(n) = ((n+2)*a(n-2)+2*a(n-1)-n)/(n-2), a(1)=1, a(2)=2. - Gerry Martens, Jun 10 2018
E.g.f.: exp(-x)*(6 - 3*x + exp(2*x)*(18 + 39*x + 18*x^2 + 2*x^3))/24. - Stefano Spezia, Feb 23 2020
a(n) = Sum_{j=0..n/2} binomial(c+2*j-1,2*j)*binomial(c+n-2*j-1,n-2*j) where c=2. For other values of c we have: A008619 (c=1), A005995 (c=3), A018211 (c=4), A018213 (c=5), A062136 (c=6). - Miquel A. Fiol, Sep 24 2024

A005994 Alkane (or paraffin) numbers l(7,n).

Original entry on oeis.org

1, 3, 9, 19, 38, 66, 110, 170, 255, 365, 511, 693, 924, 1204, 1548, 1956, 2445, 3015, 3685, 4455, 5346, 6358, 7514, 8814, 10283, 11921, 13755, 15785, 18040, 20520, 23256, 26248, 29529, 33099, 36993, 41211, 45790, 50730, 56070, 61810, 67991
Offset: 0

Views

Author

N. J. A. Sloane, Winston C. Yang (yang(AT)math.wisc.edu)

Keywords

Comments

Equals A000217 (1, 3, 6, 10, 15, ...) convolved with A193356 (1, 0, 3, 0, 5, ...). - Gary W. Adamson, Feb 16 2009
F(1,4,n) is the number of bracelets with 1 blue, 4 red and n black beads. If F(1,4,1)=3 and F(1,4,2)=9 taken as a base;
F(1,4,n) = n(n+1)(n+2)/6+F(1,2,n) + F(1,4,n-2). [F(1,2,n) is the number of bracelets with 1 blue, 2 red and n black beads. If F(1,2,1)=2 and F(1,2,2)=4 taken as a base F(1,2,n)=n+1+F(1,2,n-2)]. - Ata Aydin Uslu and Hamdi G. Ozmenekse, Jan 11 2012
a(A254338(n)) = 6 for n > 0. - Reinhard Zumkeller, Feb 27 2015

References

  • S. M. Losanitsch, Die Isomerie-Arten bei den Homologen der Paraffin-Reihe, Chem. Ber. 30 (1897), 1917-1926.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A006009, A005997, A005993 (first differences).

Programs

  • Haskell
    --  Following Gary W. Adamson.
    import Data.List (inits, intersperse)
    a005994 n = a005994_list !! n
    a005994_list = map (sum . zipWith (*) (intersperse 0 [1, 3 ..]) . reverse) $
                       tail $ inits $ tail a000217_list
    -- Reinhard Zumkeller, Feb 27 2015
  • Maple
    a:= n -> (Matrix([[1, 0$4, 1, 3]]). Matrix(7, (i,j)-> if (i=j-1) then 1 elif j=1 then [3, -1, -5, 5, 1, -3, 1][i] else 0 fi)^n)[1,1]: seq (a(n), n=0..40); # Alois P. Heinz, Jul 31 2008
  • Mathematica
    LinearRecurrence[{3,-1,-5,5,1,-3,1},{1,3,9,19,38,66,110},50] (* or *) CoefficientList[Series[(1+x^2)/((1-x)^3(1-x^2)^2),{x,0,50}],x] (* Harvey P. Dale, May 02 2011 *)
    nn=45;With[{a=Accumulate[Range[nn]],b=Riffle[Range[1,nn,2],0]}, Flatten[ Table[ListConvolve[Take[a,n],Take[b,n]],{n,nn}]]] (* Harvey P. Dale, Nov 11 2011 *)
  • PARI
    {a(n)=if(n<-4, n=-5-n); polcoeff( (1+x^2)/((1-x)^3*(1-x^2)^2)+x*O(x^n), n)} /* Michael Somos, Mar 08 2007 */
    

Formula

G.f.: (1+x^2)/((1-x)^3*(1-x^2)^2) = (1+x^2)/((1-x)^5*(1+x)^2).
l(c, r) = 1/2 C(c+r-3, r) + 1/2 d(c, r), where d(c, r) is C((c + r - 3)/2, r/2) if c is odd and r is even, 0 if c is even and r is odd, C((c + r - 4)/2, r/2) if c is even and r is even, C((c + r - 4)/2, (r - 1)/2) if c is odd and r is odd.
a(-5-n)=a(n). - Michael Somos, Mar 08 2007
Euler transform of length 4 sequence [3, 3, 0, -1]. - Michael Somos, Mar 08 2007
a(n) = 3a(n-1) - a(n-2) - 5a(n-3) + 5a(n-4) + a(n-5) - 3a(n-6) + a(n-7), with a(0)=1, a(1)=3, a(2)=9, a(4)=19, a(5)=38, a(6)=66, a(7)=110. - Harvey P. Dale, May 02 2011
a(n) = A006009(n)/2 - A000332(n+4) = ((1/2)*Sum_{i=1..n+1} (i+1)*floor((i+1)^2/2)) - binomial(n+4,4). - Enrique Pérez Herrero, May 11 2012
a(n) = (1/48)*(n+1)*(n+3)*((n+2)*(n+4)+3)+1/32*(2*n+5)*(1+(-1)^n). - Yosu Yurramendi, Jun 20 2013
Conjecture: a(n)+a(n+1) = A203286(n+1). - R. J. Mathar, Mar 08 2025

A119358 Number of n-element subsets of [2n] having an even sum.

Original entry on oeis.org

1, 1, 2, 10, 38, 126, 452, 1716, 6470, 24310, 92252, 352716, 1352540, 5200300, 20056584, 77558760, 300546630, 1166803110, 4537543340, 17672631900, 68923356788, 269128937220, 1052049129144, 4116715363800, 16123803193628, 63205303218876, 247959261273752
Offset: 0

Views

Author

Paul Barry, May 16 2006

Keywords

Comments

Old name was: Central coefficients of number triangle A119326.

Examples

			a(3) = 10: {1,2,3}, {1,2,5}, {1,3,4}, {1,3,6}, {1,4,5}, {1,5,6}, {2,3,5}, {2,4,6}, {3,4,5}, {3,5,6}. - _Alois P. Heinz_, Feb 04 2017
		

Crossrefs

Column k=2 of A318557.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<3, 1+n*(n-1)/2,
         ((4*n-10)*(5*n^2-10*n+4)*(a(n-1)+4*(n-2)*a(n-3)
          /(n-1))/(5*n^2-20*n+19)-4*(n-1)*a(n-2))/n)
        end:
    seq(a(n), n=0..30);  # Alois P. Heinz, Aug 26 2018
  • Mathematica
    Table[HypergeometricPFQ[{1/2 - n/2, 1/2 - n/2, -n/2, -n/2}, {1/2, 1/2, 1}, 1], {n, 0, 20}] (* Vladimir Reshetnikov, Oct 04 2016 *)

Formula

G.f.: (1/sqrt(1-4x)+1/sqrt(1+4x^2))/2.
a(n) = Sum_{k=0..floor(n/2)} C(n,2k)^2.
a(n) = C(2n,n)/2+sin(Pi*(n+1)/2)*C(n,n/2)/2.
a(n) = A119326(2n,n).
a(n) = A071688(n) + A119359(n) for n>=1.
D-finite with recurrence n*(n-1)*(10*n-29)*a(n) +2*(n-1)*(5*n^2-74*n+164)*a(n-1) +4*(-40*n^3+310*n^2 -744*n+559)*a(n-2) +8*(n-2)*(5*n^2-74*n+164)*a(n-3) -16*(25*n-42)*(n-3)*(2*n-7)*a(n-4)=0. - R. J. Mathar, Nov 05 2012
a(n) = hypergeom([(1-n)/2, (1-n)/2, -n/2, -n/2], [1/2, 1/2, 1], 1). - Vladimir Reshetnikov, Oct 04 2016
a(n) = A282011(2n,n). - Alois P. Heinz, Feb 04 2017

Extensions

New name from Alois P. Heinz, Feb 04 2017

A159916 Triangle T(m,n) = number of subsets of {1,...,m} with n elements having an odd sum, 1 <= n <= m.

Original entry on oeis.org

1, 1, 1, 2, 2, 0, 2, 4, 2, 0, 3, 6, 4, 2, 1, 3, 9, 10, 6, 3, 1, 4, 12, 16, 16, 12, 4, 0, 4, 16, 28, 32, 28, 16, 4, 0, 5, 20, 40, 60, 66, 44, 16, 4, 1, 5, 25, 60, 100, 126, 110, 60, 20, 5, 1, 6, 30, 80, 160, 236, 236, 160, 80, 30, 6, 0, 6, 36, 110, 240, 396, 472, 396, 240, 110, 36, 6, 0
Offset: 1

Views

Author

M. F. Hasler, Apr 30 2009

Keywords

Comments

One could extend the triangle to include values for m=0 and/or n=0, but these correspond to empty sets and would always be 0. The first odd value for odd m and 1

Examples

			The triangle starts:
(m=1) 1,
(m=2) 1,1,
(m=3) 2,2,0,
(m=4) 2,4,2,0,
(m=5) 3,6,4,2,1,
...
T(5,3)=4, since the set {1,2,3,4,5} has four 3-element subsets having an odd sum of elements, namely {1,2,4}, {1,3,5}, {2,3,4} and {2,4,5}.
		

Crossrefs

T(2n,n) gives A110145.

Programs

  • Maple
    b:= proc(n, s) option remember; expand(
          `if`(n=0, s, b(n-1, s)+x*b(n-1, irem(s+n, 2))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=1..n))(b(n, 0)):
    seq(T(n), n=1..15);  # Alois P. Heinz, Feb 04 2017
  • Mathematica
    b[n_, s_] := b[n, s] = Expand[If[n==0, s, b[n-1, s] + x*b[n-1, Mod[s+n, 2]] ]];
    T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 1, n}]][b[n, 0]];
    Table[T[n], {n, 1, 15}] // Flatten (* Jean-François Alcover, Nov 17 2017, after Alois P. Heinz *)
  • PARI
    T(n,k)=sum( i=2^k-1,2^n-2^(n-k), norml2(binary(i))==k & sum(j=0,n\2, bittest(i,2*j))%2 )

Formula

T(m,m) = A133872(m-1), T(m,1) = A004526(m+1).
T(n,k) = A007318(n,k) - A282011(n,k). - Alois P. Heinz, Feb 06 2017

A032092 Number of reversible strings with n-1 beads of 2 colors. 5 beads are black. String is not palindromic.

Original entry on oeis.org

3, 9, 28, 60, 126, 226, 396, 636, 1001, 1491, 2184, 3080, 4284, 5796, 7752, 10152, 13167, 16797, 21252, 26532, 32890, 40326, 49140, 59332, 71253, 84903, 100688, 118608, 139128, 162248, 188496, 217872, 250971, 287793, 329004, 374604, 425334, 481194, 543004
Offset: 7

Keywords

Comments

If the offset is changed to 3, this is the 2nd Witt transform of A000217 [Moree]. - R. J. Mathar, Nov 08 2008
From Petros Hadjicostas, May 19 2018: (Start)
Let k be an integer >= 2. The g.f. of the BHK[k] transform of the sequence (c(n): n >= 1), with g.f. C(x) = Sum_{n>=1} c(n)*x^n, is A_k(x) = (C(x)^k - C(x^2)^(k/2))/2 if k is even, and A_k(x) = (C(x)/2)*(C(x)^{k-1} - C(x^2)^{(k-1)/2}) if k is odd. This follows easily from the formulae in C. G. Bower's web link below about transforms.
When k is even and c(n) = 1 for all n >= 1, we get C(x) = x/(1-x) and A_k(x) = (1/2)*((x/(1-x))^k - (x^2/(1-x^2))^{k/2}). If (a_k(n): n >= 1) is the output sequence (with g.f. A_k(x)), then it can be proved (using Taylor expansions) that a_k(n) = (1/2)*(binomial(n-1, n-k) - binomial((n/2)-1, (n-k)/2)) for even n >= k+1 and a_k(n) = (1/2)*binomial(n-1, n-k) for odd n >= k+1. (Clearly, a_k(1) = ... = a_k(k) = 0.)
In this sequence, k = 6, and (according to C. G. Bower) a(n) = a_{k=6}(n) is the number of reversible non-palindromic compositions of n with 6 positive parts. If n = b_1 + b_2 + b_3 + b_4 + b_5 + b_6 is such a composition of n (with b_i >= 1), then it is equivalent to the composition n = b_6 + b_5 + b_4 + b_3 + b_2 + b_1, and each equivalent class has two elements because here linear palindromes are not allowed as compositions of n.
The fact that we are finding the BHK[6] transform of 1, 1, 1, ... means that each part of each composition of n can have exactly one color (see Bower's link below about transforms).
In each such composition replace each b_i with one black (B) ball followed by b_i - 1 white (W) balls. Then drop the first black (B) ball. We then get a reversible non-palindromic string of length n-1 that has 5 black balls and n-6 white balls. This process, applied to the equivalent compositions n = b_1 + b_2 + b_3 + b_4 + b_5 + b_6 = b_6 + b_5 + b_4 + b_3 + b_2 + b_1, gives two strings of length n-1 with 5 black balls and n-6 white balls that are mirror images of each other.
Hence, for n >= 2, a(n) = a_{k=6}(n) is also the number of reversible non-palindromic strings of length n-1 that have k-1 = 5 black balls and n-k = n-6 white balls. (Clearly, a(n) = a_{k=6}(n) > 0 only for n >= 7.)
(End)

Examples

			From _Petros Hadjicostas_, May 19 2018: (Start)
For n=7, we have the following 3 reversible non-palindromic compositions with 6 parts of n: 1+1+1+1+1+2 (= 2+1+1+1+1+1), 1+1+1+1+2+1 (= 1+2+1+1+1+1), and 1+1+1+2+1+1 (= 1+1+2+1+1+1). Using the process described in the comments, we get the following reversible non-palindromic strings with 5 black balls and n-6 = 1 white balls: BBBBBW (= WBBBBB), BBBBWB (= BWBBBB), and BBBWBB (= BBWBBB).
For n=8, we get the following 9 compositions and 9 corresponding strings:
1+1+1+1+1+3 <-> BBBBBWW
1+1+1+1+3+1 <-> BBBBWWB
1+1+1+3+1+1 <-> BBBWWBB
1+1+1+1+2+2 <-> BBBBWBW
1+1+1+2+1+2 <-> BBBWBBW
1+1+2+1+1+2 <-> BBWBBBW
1+2+1+1+1+2 <-> BWBBBBW
1+1+1+2+2+1 <-> BBBWBWB
1+1+2+1+2+1 <-> BBWBBWB
(End)
		

Programs

  • Mathematica
    LinearRecurrence[{3,0,-8,6,6,-8,0,3,-1},{3,9,28,60,126,226,396,636,1001},50] (* Harvey P. Dale, Mar 19 2017 *)
    f[n_] := Binomial[n - 1, n - 6]/2 - If[ OddQ@ n, 0, Binomial[(n/2) - 1, (n - 6)/2]/2]; Array[a, 40, 7] (* or *)
    CoefficientList[ Series[(x^7 (x^2 + 3))/((x - 1)^6 (x + 1)^3), {x, 0, 46}], x] (* Robert G. Wilson v, May 20 2018 *)
  • PARI
    Vec(x^7*(3+x^2)/((1-x)^6*(1+x)^3) + O(x^100)) \\ Colin Barker, Mar 07 2015

Formula

"BHK[ 6 ]" (reversible, identity, unlabeled, 6 parts) transform of 1, 1, 1, 1, ...
G.f.: x^7*(3+x^2)/((1-x)^6*(1+x)^3). - R. J. Mathar, Nov 08 2008
From Colin Barker, Mar 07 2015: (Start)
a(n) = (2*n^5-30*n^4+170*n^3-480*n^2+728*n-480)/480 if n is even.
a(n) = (2*n^5-30*n^4+170*n^3-450*n^2+548*n-240)/480 if n is odd.
(End)
From Petros Hadjicostas, May 19 2018: (Start)
a(n) = (1/2)*(binomial(n-1, n-6) - binomial((n/2)-1, (n-6)/2)) if n is even.
a(n) = (1/2)*binomial(n-1, n-6) if n is odd.
G.f.: (1/2)*((x/(1-x))^6 - (x^2/(1-x^2))^3).
These formulae agree with the above formulae by R. J. Mathar and C. Barker.
(End)

A018211 Alkane (or paraffin) numbers l(10,n).

Original entry on oeis.org

1, 4, 20, 60, 170, 396, 868, 1716, 3235, 5720, 9752, 15912, 25236, 38760, 58200, 85272, 122661, 173052, 240460, 328900, 444158, 592020, 780572, 1017900, 1315015, 1682928, 2136304, 2689808, 3362600, 4173840, 5148144, 6310128
Offset: 0

Author

N. J. A. Sloane, Winston C. Yang (yang(AT)math.wisc.edu)

Keywords

Comments

Equals (1/2) * ((1, 8, 36, 120, 330, 792,...) + (1, 0, 4, 0, 10, 0, 20,...)); where (1, 8, 36,..) = A000580 = C(n,7), and (1, 4, 10,...) = the Tetrahedral numbers.

References

  • S. M. Losanitsch, Die Isomerie-Arten bei den Homologen der Paraffin-Reihe, Chem. Ber. 30 (1897), 1917-1926.
  • Winston C. Yang (paper in preparation).

Crossrefs

Cf. A282011.

Programs

  • Maple
    a:= n-> (Matrix([[1, 0$7, -1, -4, -20, -60]]). Matrix(12, (i,j)-> `if`(i=j-1, 1, `if`(j=1, [4, -2, -12, 17, 8, -28, 8, 17, -12, -2, 4, -1][i], 0)))^n)[1,1]: seq(a(n), n=0..31); # Alois P. Heinz, Jul 31 2008
  • Mathematica
    LinearRecurrence[{4, -2, -12, 17, 8, -28, 8, 17, -12, -2, 4, -1},{1, 4, 20, 60, 170, 396, 868, 1716, 3235, 5720, 9752, 15912},32] (* Ray Chandler, Sep 23 2015 *)

Formula

G.f.: (1+6*x^2+x^4)/((1-x)^4*(1-x^2)^4). [ N. J. A. Sloane ]
l(c, r) = 1/2 binomial(c+r-3, r) + 1/2 d(c, r), where d(c, r) is binomial((c + r - 3)/2, r/2) if c is odd and r is even, 0 if c is even and r is odd, binomial((c + r - 4)/2, r/2) if c is even and r is even, binomial((c + r - 4)/2, (r - 1)/2) if c is odd and r is odd.
a(n) = (1/(2*7!))*(n+1)*(n+2)*(n+3)*(n+4)*(n+5)*(n+6)*(n+7) + (1/3)*(1/2^5)*(n+2)*(n+4)*(n+6)*(1/2)*(1+(-1)^n) [Yosu Yurramendi Jun 23 2013]

A032093 Number of reversible strings with n-1 beads of 2 colors. 6 beads are black. Strings are not palindromic.

Original entry on oeis.org

3, 12, 40, 100, 226, 452, 848, 1484, 2485, 3976, 6160, 9240, 13524, 19320, 27072, 37224, 50391, 67188, 88440, 114972, 147862, 188188, 237328, 296660, 367913, 452816, 553504, 672112, 811240, 973488, 1161984, 1379856
Offset: 8

Keywords

Comments

From Petros Hadjicostas, May 19 2018: (Start)
Let k be an integer >= 2. The g.f. of the BHK[k] transform of the sequence (c(n): n>=1), with g.f. C(x) = Sum_{n>=1} c(n)*x^n, is A_k(x) = (C(x)^k - C(x^2)^(k/2))/2 if k is even, and A_k(x) = (C(x)/2)*(C(x)^{k-1} - C(x^2)^{(k-1)/2}) if k is odd. This follows easily from the formulae in C. G. Bower's web link below about transforms.
When k is odd and c(n) = 1 for all n>=1, we get C(x) = x/(1-x) and A_k(x) = (1/2)*(x/(1-x))*((x/(1-x))^{k-1} - (x^2/(1-x^2))^{(k-1)/2}). If (a_k(n): n>=1) is the output sequence (with g.f. A_k(x)), then it can be proved (using Taylor expansions) that a_k(n) = (1/2)*(binomial(n-1, n-k) - binomial(floor((n-1)/2), floor((n-k)/2))) for n >= k+1. (Clearly, a_k(1) = ... = a_k(k) = 0.)
In this sequence, k = 7, and (according to C. G. Bower) a(n) = a_{k=7}(n) is the number of reversible non-palindromic compositions of n with 7 positive parts. If n = b_1 + b_2 + b_3 + b_4 + b_5 + b_6 + b_7 is such a composition of n (with b_i >=1), then it is equivalent to the composition n = b_7 + b_6 + b_5 + b_4 + b_3 + b_2 + b_1, and each equivalent class has two elements because here linear palindromes are not allowed as compositions of n.
The fact that we are finding the BHK[7] transform of 1, 1, 1, ... means that each part of each composition of n can have exactly one color (see Bower's link below about transforms).
In each such composition replace each b_i with one black (B) ball followed by b_i - 1 white (W) balls. Then drop the first black (B) ball. We then get a reversible non-palindromic string of length n-1 that has 6 black balls and n-7 white balls. This process, applied to the equivalent compositions n = b_1 + b_2 + b_3 + b_4 + b_5 + b_6 + b_7 = b_7 + b_6 + b_5 + b_4 + b_3 + b_2 + b_1, gives two strings of length n-1 with 6 black balls and n-7 white balls that are mirror images of each other.
Hence, for n>=2, a(n) = a_{k=7}(n) is also the number of reversible non-palindromic strings of length n-1 that have k-1 = 6 black balls and n-k = n-7 white balls. (Clearly, a(n) = a_{k=7}(n) > 0 only for n >= 8. For n=7, the composition 1+1+1+1+1+1+1, which corresponds to string BBBBBB, is discarded because it is palindromic.)
(End)

Examples

			From _Petros Hadjicostas_, May 19 2018: (Start)
For n=8, we have the following 3 reversible non-palindromic compositions with 7 parts of n: 1+1+1+1+1+1+2 (= 2+1+1+1+1+1+1), 1+1+1+1+1+2+1 (= 1+2+1+1+1+1+1), and 1+1+1+1+2+1+1 (= 1+1+2+1+1+1+1). Using the process described in the comments, we get the following reversible non-palindromic strings with 6 black balls and n-7=1 white balls: BBBBBBW (= WBBBBBB), BBBBBWB (= BWBBBBB), and BBBBWBB (= BBWBBBB).
For n=9, we get the following 12 compositions and 12 corresponding strings:
1+1+1+1+1+1+3 <-> BBBBBBWW
1+1+1+1+1+3+1 <-> BBBBBWWB
1+1+1+1+3+1+1 <-> BBBBWWBB
1+1+1+1+1+2+2 <-> BBBBBWBW
1+1+1+1+2+1+2 <-> BBBBWBBW
1+1+1+2+1+1+2 <-> BBBWBBBW
1+1+2+1+1+1+2 <-> BBWBBBBW
1+2+1+1+1+1+2 <-> BWBBBBBW
1+1+1+1+2+2+1 <-> BBBBWBWB
1+1+1+2+1+2+1 <-> BBBWBBWB
1+1+2+1+1+2+1 <-> BBWBBBWB
1+1+1+2+2+1+1 <-> BBBWBWBB
(End)
		

Formula

"BHK[ 7 ]" (reversible, identity, unlabeled, 7 parts) transform of 1, 1, 1, 1, ...
Empirical G.f.: -x^8*(x^2+3)/((x-1)^7*(x+1)^3). - Colin Barker, Nov 24 2012
From Petros Hadjicostas, May 19 2018: (Start)
a(n) = (1/2)*(binomial(n-1, n-7) - binomial(floor((n-1)/2), floor((n-7)/2))) for n >= 8.
G.f.: (1/2)*(x/(1-x))*((x/(1-x))^6 - (x^2/(1-x^2))^3), which is the same as the g.f. given by Colin Barker above.
(End)

Extensions

Definition changed slightly by Harvey P. Dale, Oct 02 2017

A228705 Expansion of (1-2*x+4*x^2-2*x^3+x^4)/((1-x)^4*(1+x^2)^2).

Original entry on oeis.org

1, 2, 4, 10, 19, 28, 40, 60, 85, 110, 140, 182, 231, 280, 336, 408, 489, 570, 660, 770, 891, 1012, 1144, 1300, 1469, 1638, 1820, 2030, 2255, 2480, 2720, 2992, 3281, 3570, 3876, 4218, 4579, 4940, 5320, 5740, 6181, 6622, 7084, 7590, 8119, 8648, 9200, 9800, 10425
Offset: 0

Author

N. J. A. Sloane, Sep 06 2013

Keywords

Comments

Number of n-element subsets of [n+3] having an even sum. a(3) = 10: {1,2,3}, {1,2,5}, {1,3,4}, {1,3,6}, {1,4,5}, {1,5,6}, {2,3,5}, {2,4,6}, {3,4,5}, {3,5,6}. - Alois P. Heinz, Feb 04 2017
A159914, which is half the number of (n-3)-element subsets of {1..n} having an odd sum, satisfies the same recurrence relation. However, a simple relation between a(n) and A159914(n) is not obvious. - M. F. Hasler, Jun 22 2018

Crossrefs

Third lower diagonal of A282011.

Programs

  • Magma
    m:=50; R:=PowerSeriesRing(Integers(), m); Coefficients(R!(1-2*x+4*x^2-2*x^3+x^4)/((1-x)^4*(1+x^2)^2)); // Vincenzo Librandi, Sep 07 2013
  • Mathematica
    CoefficientList[Series[(1 - 2 x + 4 x^2 - 2 x^3 + x^4) / ((1 - x)^4 (1 + x^2)^2), {x, 0, 50}], x] (* Vincenzo Librandi, Sep 07 2013 *)
    LinearRecurrence[{4,-8,12,-14,12,-8,4,-1},{1,2,4,10,19,28,40,60},50] (* Harvey P. Dale, Apr 10 2014 *)

Formula

a(n) = (n+2)*(2*(n+1)*(n+3)+3*(1+(-1)^n)*i^(n*(n+1)))/24, where i=sqrt(-1). [Bruno Berselli, Sep 07 2013]
a(0)=1, a(1)=2, a(2)=4, a(3)=10, a(4)=19, a(5)=28, a(6)=40, a(7)=60, a(n)=4*a(n-1)-8*a(n-2)+12*a(n-3)-14*a(n-4)+12*a(n-5)-8*a(n-6)+ 4*a(n-7)- a(n-8). - Harvey P. Dale, Apr 10 2014

A018212 Alkane (or paraffin) numbers l(11,n).

Original entry on oeis.org

1, 5, 25, 85, 255, 651, 1519, 3235, 6470, 12190, 21942, 37854, 63090, 101850, 160050, 245322, 367983, 541035, 781495, 1110395, 1554553, 2146573, 2927145, 3945045, 5260060, 6942988, 9079292, 11769100, 15131700, 19305540
Offset: 0

Author

N. J. A. Sloane, Winston C. Yang (yang(AT)math.wisc.edu)

Keywords

References

  • S. M. Losanitsch, Die Isomerie-Arten bei den Homologen der Paraffin-Reihe, Chem. Ber. 30 (1897), 1917-1926.
  • Winston C. Yang (paper in preparation).

Crossrefs

Cf. A282011.

Programs

  • Mathematica
    LinearRecurrence[{5, -6, -10, 29, -9, -36, 36, 9, -29, 10, 6, -5, 1},{1, 5, 25, 85, 255, 651, 1519, 3235, 6470, 12190, 21942, 37854, 63090},30] (* Ray Chandler, Sep 23 2015 *)

Formula

G.f.: (1+6*x^2+x^4)/((1-x)^5*(1-x^2)^4). [ N. J. A. Sloane ]
l(c, r) = 1/2 binomial(c+r-3, r) + 1/2 d(c, r), where d(c, r) is binomial((c + r - 3)/2, r/2) if c is odd and r is even, 0 if c is even and r is odd, binomial((c + r - 4)/2, r/2) if c is even and r is even, binomial((c + r - 4)/2, (r - 1)/2) if c is odd and r is odd.
a(n) = (1/(2*8!))*(n+2)*(n+4)*(n+6)*(n+8)*((n+1)*(n+3)*(n+5)*(n+7) + 1*3*5*7) - (1/3)*(1/2^6)*(n^3+(27/2)*n^2+56*n+(279/4))*(1/2)*(1-(-1)^n) [Yosu Yurramendi Jun 23 2013]

A282077 Number of 9-element subsets of [n+9] having an even sum.

Original entry on oeis.org

0, 5, 25, 110, 350, 1001, 2485, 5720, 12120, 24310, 46126, 83980, 146860, 248710, 408430, 653752, 1021240, 1562275, 2343055, 3453450, 5007002, 7153575, 10079355, 14024400, 19282640, 26225628, 35302540, 47071640, 62200280, 81505820, 105955628, 136719440
Offset: 0

Author

Alois P. Heinz, Feb 05 2017

Keywords

Examples

			a(1) = 5: {1,2,3,4,5,6,7,8,10}, {1,2,3,4,5,6,8,9,10}, {1,2,3,4,6,7,8,9,10}, {1,2,4,5,6,7,8,9,10}, {2,3,4,5,6,7,8,9,10}.
		

Crossrefs

Column k=9 of A282011.

Programs

  • Mathematica
    LinearRecurrence[{5,-5,-15,35,1,-65,45,45,-65,1,35,-15,-5,5,-1},{0,5,25,110,350,1001,2485,5720,12120,24310,46126,83980,146860,248710,408430},40] (* Harvey P. Dale, Jun 10 2018 *)
  • PARI
    concat(0, Vec(x*(x^4+10*x^2+5)/((1+x)^5*(x-1)^10) + O(x^30))) \\ Colin Barker, Feb 06 2017

Formula

G.f.: x*(x^4+10*x^2+5)/((1+x)^5*(x-1)^10).
a(n) = ((384 + 400*n + 140*n^2 + 20*n^3 + n^4)*(-945*(-1+(-1)^n) + 3378*n + 1900*n^2 + 460*n^3 + 50*n^4 + 2*n^5)) / 1451520. - Colin Barker, Feb 06 2017
Showing 1-10 of 19 results. Next