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.

A027383 a(2*n) = 3*2^n - 2; a(2*n+1) = 2^(n+2) - 2.

Original entry on oeis.org

1, 2, 4, 6, 10, 14, 22, 30, 46, 62, 94, 126, 190, 254, 382, 510, 766, 1022, 1534, 2046, 3070, 4094, 6142, 8190, 12286, 16382, 24574, 32766, 49150, 65534, 98302, 131070, 196606, 262142, 393214, 524286, 786430, 1048574, 1572862, 2097150, 3145726, 4194302, 6291454
Offset: 0

Views

Author

Keywords

Comments

Number of balanced strings of length n: let d(S) = #(1's) - #(0's), # == count in S, then S is balanced if every substring T of S has -2 <= d(T) <= 2.
Number of "fold lines" seen when a rectangular piece of paper is folded n+1 times along alternate orthogonal directions and then unfolded. - Quim Castellsaguer (qcastell(AT)pie.xtec.es), Dec 30 1999
Also the number of binary strings with the property that, when scanning from left to right, once the first 1 is seen in position j, there must be a 1 in positions j+2, j+4, ... until the end of the string. (Positions j+1, j+3, ... can be occupied by 0 or 1.) - Jeffrey Shallit, Sep 02 2002
a(n-1) is also the Moore lower bound on the order of a (3,n)-cage. - Eric W. Weisstein, May 20 2003 and Jason Kimberley, Oct 30 2011
Partial sums of A016116. - Hieronymus Fischer, Sep 15 2007
Equals row sums of triangle A152201. - Gary W. Adamson, Nov 29 2008
From John P. McSorley, Sep 28 2010: (Start)
a(n) = DPE(n+1) is the total number of k-double-palindromes of n up to cyclic equivalence. See sequence A180918 for the definitions of a k-double-palindrome of n and of cyclic equivalence. Sequence A180918 is the 'DPE(n,k)' triangle read by rows where DPE(n,k) is the number of k-double-palindromes of n up to cyclic equivalence. For example, we have a(4) = DPE(5) = DPE(5,1) + DPE(5,2) + DPE(5,3) + DPE(5,4) + DPE(5,5) = 0 + 2 + 2 + 1 + 1 = 6.
The 6 double-palindromes of 5 up to cyclic equivalence are 14, 23, 113, 122, 1112, 11111. They come from cyclic equivalence classes {14,41}, {23,32}, {113,311,131}, {122,212,221}, {1112,2111,1211,1121}, and {11111}. Hence a(n)=DPE(n+1) is the total number of cyclic equivalence classes of n containing at least one double-palindrome.
(End)
From Herbert Eberle, Oct 02 2015: (Start)
For n > 0, there is a red-black tree of height n with a(n-1) internal nodes and none with less.
In order a red-black tree of given height has minimal number of nodes, it has exactly 1 path with strictly alternating red and black nodes. All nodes outside this height defining path are black.
Consider:
mrbt5 R
/ \
/ \
/ \
/ B
/ / \
mrbt4 B / B
/ \ B E E
/ B E E
mrbt3 R E E
/ \
/ B
mrbt2 B E E
/ E
mrbt1 R
E E
(Red nodes shown as R, blacks as B, externals as E.)
Red-black trees mrbt1, mrbt2, mrbt3, mrbt4, mrbt5 of respective heights h = 1, 2, 3, 4, 5; all minimal in the number of internal nodes, namely 1, 2, 4, 6, 10.
Recursion (let n = h-1): a(-1) = 0, a(n) = a(n-1) + 2^floor(n/2), n >= 0.
(End)
Also the number of strings of length n with the digits 1 and 2 with the property that the sum of the digits of all substrings of uneven length is not divisible by 3. An example with length 8 is 21221121. - Herbert Kociemba, Apr 29 2017
a(n-2) is the number of achiral n-bead necklaces or bracelets using exactly two colors. For n=4, the four arrangements are AAAB, AABB, ABAB, and ABBB. - Robert A. Russell, Sep 26 2018
Partial sums of powers of 2 repeated 2 times, like A200672 where is 3 times. - Yuchun Ji, Nov 16 2018
Also the number of binary words of length n with cuts-resistance <= 2, where, for the operation of shortening all runs by one, cuts-resistance is the number of applications required to reach an empty word. Explicitly, these are words whose sequence of run-lengths, all of which are 1 or 2, has no odd-length run of 1's sandwiched between two 2's. - Gus Wiseman, Nov 28 2019
Also the number of up-down paths with n steps such that the height difference between the highest and lowest points is at most 2. - Jeremy Dover, Jun 17 2020
Also the number of non-singleton integer compositions of n + 2 with no odd part other than the first or last. Including singletons gives A052955. This is an unsorted (or ordered) version of A351003. The version without even (instead of odd) interior parts is A001911, complement A232580. Note that A000045(n-1) counts compositions without odd parts, with non-singleton case A077896, and A052952/A074331 count non-singleton compositions without even parts. Also the number of compositions y of n + 1 such that y_i = y_{i+1} for all even i. - Gus Wiseman, Feb 19 2022

Examples

			After 3 folds one sees 4 fold lines.
Example: a(3) = 6 because the strings 001, 010, 100, 011, 101, 110 have the property.
Binary: 1, 10, 100, 110, 1010, 1110, 10110, 11110, 101110, 111110, 1011110, 1111110, 10111110, 11111110, 101111110, 111111110, 1011111110, 1111111110, 10111111110, ... - _Jason Kimberley_, Nov 02 2011
Example: Partial sums of powers of 2 repeated 2 times:
a(3) = 1+1+2 = 4;
a(4) = 1+1+2+2 = 6;
a(5) = 1+1+2+2+4 = 10.
_Yuchun Ji_, Nov 16 2018
		

References

  • John P. McSorley: Counting k-compositions of n with palindromic and related structures. Preprint, 2010. [John P. McSorley, Sep 28 2010]

Crossrefs

Moore lower bound on the order of a (k,g) cage: A198300 (square); rows: A000027 (k=2), this sequence (k=3), A062318 (k=4), A061547 (k=5), A198306 (k=6), A198307 (k=7), A198308 (k=8), A198309 (k=9), A198310 (k=10), A094626 (k=11); columns: A020725 (g=3), A005843 (g=4), A002522 (g=5), A051890 (g=6), A188377 (g=7). - Jason Kimberley, Oct 30 2011
Cf. A000066 (actual order of a (3,g)-cage).
Bisections are A033484 (even) and A000918 (odd).
a(n) = A305540(n+2,2), the second column of the triangle.
Numbers whose binary expansion is a balanced word are A330029.
Binary words counted by cuts-resistance are A319421 or A329860.
The complementary compositions are counted by A274230(n-1) + 1, with bisections A060867 (even) and A134057 (odd).
Cf. A000346, A000984, A001405, A001700, A011782 (compositions).
The following sequences are all essentially the same, in the sense that they are simple transformations of each other, with A029744 = {s(n), n>=1}, the numbers 2^k and 3*2^k, as the parent: A029744 (s(n)); A052955 (s(n)-1), A027383 (s(n)-2), A354788 (s(n)-3), A347789 (s(n)-4), A209721 (s(n)+1), A209722 (s(n)+2), A343177 (s(n)+3), A209723 (s(n)+4); A060482, A136252 (minor differences from A354788 at the start); A354785 (3*s(n)), A354789 (3*s(n)-7). The first differences of A029744 are 1,1,1,2,2,4,4,8,8,... which essentially matches eight sequences: A016116, A060546, A117575, A131572, A152166, A158780, A163403, A320770. The bisections of A029744 are A000079 and A007283. - N. J. A. Sloane, Jul 14 2022

Programs

  • Haskell
    import Data.List (transpose)
    a027383 n = a027383_list !! n
    a027383_list = concat $ transpose [a033484_list, drop 2 a000918_list]
    -- Reinhard Zumkeller, Jun 17 2015
    
  • Magma
    [2^Floor((n+2)/2)+2^Floor((n+1)/2)-2: n in [0..50]]; // Vincenzo Librandi, Aug 16 2011
    
  • Maple
    a[0]:=0:a[1]:=1:for n from 2 to 100 do a[n]:=2*a[n-2]+2 od: seq(a[n], n=1..41); # Zerinvary Lajos, Mar 16 2008
  • Mathematica
    a[n_?EvenQ] := 3*2^(n/2)-2; a[n_?OddQ] := 2^(2+(n-1)/2)-2; Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Oct 21 2011, after Quim Castellsaguer *)
    LinearRecurrence[{1, 2, -2}, {1, 2, 4}, 41] (* Robert G. Wilson v, Oct 06 2014 *)
    Table[Length[Select[Tuples[{0,1},n],And[Max@@Length/@Split[#]<=2,!MatchQ[Length/@Split[#],{_,2,ins:1..,2,_}/;OddQ[Plus[ins]]]]&]],{n,0,15}] (* Gus Wiseman, Nov 28 2019 *)
  • PARI
    a(n)=2^(n\2+1)+2^((n+1)\2)-2 \\ Charles R Greathouse IV, Oct 21 2011
    
  • Python
    def a(n): return 2**((n+2)//2) + 2**((n+1)//2) - 2
    print([a(n) for n in range(43)]) # Michael S. Branicky, Feb 19 2022

Formula

a(0)=1, a(1)=2; thereafter a(n+2) = 2*a(n) + 2.
a(2n) = 3*2^n - 2 = A033484(n);
a(2n-1) = 2^(n+1) - 2 = A000918(n+1).
G.f.: (1 + x)/((1 - x)*(1 - 2*x^2)). - David Callan, Jul 22 2008
a(n) = Sum_{k=0..n} 2^min(k, n-k).
a(n) = 2^floor((n+2)/2) + 2^floor((n+1)/2) - 2. - Quim Castellsaguer (qcastell(AT)pie.xtec.es)
a(n) = 2^(n/2)*(3 + 2*sqrt(2) + (3-2*sqrt(2))*(-1)^n)/2 - 2. - Paul Barry, Apr 23 2004
a(n) = A132340(A052955(n)). - Reinhard Zumkeller, Aug 20 2007
a(n) = A052955(n+1) - 1. - Hieronymus Fischer, Sep 15 2007
a(n) = A132666(a(n+1)) - 1. - Hieronymus Fischer, Sep 15 2007
a(n) = A132666(a(n-1)+1) for n > 0. - Hieronymus Fischer, Sep 15 2007
A132666(a(n)) = a(n-1) + 1 for n > 0. - Hieronymus Fischer, Sep 15 2007
G.f.: (1 + x)/((1 - x)*(1 - 2*x^2)). - David Callan, Jul 22 2008
a(n) = 2*( (a(n-2)+1) mod (a(n-1)+1) ), n > 1. - Pierre Charland, Dec 12 2010
a(n) = A136252(n-1) + 1, for n > 0. - Jason Kimberley, Nov 01 2011
G.f.: (1+x*R(0))/(1-x), where R(k) = 1 + 2*x/( 1 - x/(x + 1/R(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Aug 16 2013
a(n) = 2^((2*n + 3*(1-(-1)^n))/4)*3^((1+(-1)^n)/2) - 2. - Luce ETIENNE, Sep 01 2014
a(n) = a(n-1) + 2^floor((n-1)/2) for n>0, a(0)=1. - Yuchun Ji, Nov 23 2018
E.g.f.: 3*cosh(sqrt(2)*x) - 2*cosh(x) + 2*sqrt(2)*sinh(sqrt(2)*x) - 2*sinh(x). - Stefano Spezia, Apr 06 2022

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Mar 24 2000
Replaced definition with a simpler one. - N. J. A. Sloane, Jul 09 2022

A273891 Triangle read by rows: T(n,k) is the number of n-bead bracelets with exactly k different colored beads.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 4, 6, 3, 1, 6, 18, 24, 12, 1, 11, 56, 136, 150, 60, 1, 16, 147, 612, 1200, 1080, 360, 1, 28, 411, 2619, 7905, 11970, 8820, 2520, 1, 44, 1084, 10480, 46400, 105840, 129360, 80640, 20160, 1, 76, 2979, 41388, 255636, 821952, 1481760, 1512000, 816480, 181440
Offset: 1

Views

Author

Marko Riedel, Jun 02 2016

Keywords

Comments

For bracelets, chiral pairs are counted as one.

Examples

			Triangle begins with T(1,1):
1;
1,  1;
1,  2,    1;
1,  4,    6,     3;
1,  6,   18,    24,     12;
1, 11,   56,   136,    150,     60;
1, 16,  147,   612,   1200,   1080,     360;
1, 28,  411,  2619,   7905,  11970,    8820,    2520;
1, 44, 1084, 10480,  46400, 105840,  129360,   80640,  20160;
1, 76, 2979, 41388, 255636, 821952, 1481760, 1512000, 816480, 181440;
For T(4,2)=4, the arrangements are AAAB, AABB, ABAB, and ABBB, all achiral.
For T(4,4)=3, the arrangements are ABCD, ABDC, and ACBD, whose chiral partners are ADCB, ACDB, and ADBC respectively. - _Robert A. Russell_, Sep 26 2018
		

Crossrefs

Row sums give A019537.
Cf. A087854 (oriented), A305540 (achiral), A305541 (chiral).

Programs

  • Mathematica
    (* t = A081720 *) t[n_, k_] := (For[t1 = 0; d = 1, d <= n, d++, If[Mod[n, d] == 0, t1 = t1 + EulerPhi[d]*k^(n/d)]]; If[EvenQ[n], (t1 + (n/2)*(1 + k)*k^(n/2))/(2*n), (t1 + n*k^((n+1)/2))/(2*n)]); T[n_, k_] := Sum[(-1)^i * Binomial[k, i]*t[n, k-i], {i, 0, k-1}]; Table[T[n, k], {n, 1, 10}, {k, 1, n}] // Flatten (* Jean-François Alcover, Oct 07 2017, after Andrew Howroyd *)
    Table[k! DivisorSum[n, EulerPhi[#] StirlingS2[n/#,k]&]/(2n) + k!(StirlingS2[Floor[(n+1)/2], k] + StirlingS2[Ceiling[(n+1)/2], k])/4, {n,1,10}, {k,1,n}] // Flatten (* Robert A. Russell, Sep 26 2018 *)

Formula

T(n,k) = Sum_{i=0..k-1} (-1)^i * binomial(k,i) * A081720(n,k-i). - Andrew Howroyd, Mar 25 2017
From Robert A. Russell, Sep 26 2018: (Start)
T(n,k) = (k!/4) * (S2(floor((n+1)/2),k) + S2(ceiling((n+1)/2),k)) + (k!/2n) * Sum_{d|n} phi(d) * S2(n/d,k), where S2 is the Stirling subset number A008277.
G.f. for column k>1: (k!/4) * x^(2k-2) * (1+x)^2 / Product_{i=1..k} (1-i x^2) - Sum_{d>0} (phi(d)/2d) * Sum_{j} (-1)^(k-j) * C(k,j) * log(1-j*x^d).
T(n,k) = (A087854(n,k) + A305540(n,k)) / 2 = A087854(n,k) - A305541(n,k) = A305541(n,k) + A305540(n,k).
(End)

A305541 Triangle read by rows: T(n,k) is the number of chiral pairs of color loops of length n with exactly k different colors.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 0, 3, 3, 0, 0, 12, 24, 12, 0, 1, 35, 124, 150, 60, 0, 2, 111, 588, 1200, 1080, 360, 0, 6, 318, 2487, 7845, 11970, 8820, 2520, 0, 14, 934, 10240, 46280, 105840, 129360, 80640, 20160, 0, 30, 2634, 40488, 254676, 821592, 1481760, 1512000, 816480, 181440, 0, 62, 7503, 158220, 1344900, 5873760, 14658840, 21772800, 19051200, 9072000, 1814400
Offset: 1

Views

Author

Robert A. Russell, Jun 04 2018

Keywords

Comments

In other words, the number of n-bead bracelets with beads of exactly k different colors that when turned over are different from themselves. - Andrew Howroyd, Sep 13 2019

Examples

			Triangle T(n,k) begins:
  0;
  0,  0;
  0,  0,    1;
  0,  0,    3,     3;
  0,  0,   12,    24,     12;
  0,  1,   35,   124,    150,     60;
  0,  2,  111,   588,   1200,   1080,     360;
  0,  6,  318,  2487,   7845,  11970,    8820,    2520;
  0, 14,  934, 10240,  46280, 105840,  129360,   80640,  20160;
  0, 30, 2634, 40488, 254676, 821592, 1481760, 1512000, 816480, 181440;
  ...
For T(4,3)=3, the chiral pairs are AABC-AACB, ABBC-ACBB, and ABCC-ACCB.
For T(4,4)=3, the chiral pairs are ABCD-ADCB, ABDC-ACDB, and ACBD-ADBC.
		

Crossrefs

Columns 2-6 are A059076, A305542, A305543, A305544, and A305545.
Row sums are A326895.

Programs

  • Mathematica
    Table[(k!/(2n)) DivisorSum[n, EulerPhi[#] StirlingS2[n/#, k] &] - (k!/4) (StirlingS2[Floor[(n+1)/2], k] + StirlingS2[Ceiling[(n+1)/2], k]), {n, 1, 15}, {k, 1, n}] // Flatten
  • PARI
    T(n,k) = {-k!*(stirling((n+1)\2,k,2) + stirling(n\2+1,k,2))/4 + k!*sumdiv(n,d, eulerphi(d)*stirling(n/d,k,2))/(2*n)} \\ Andrew Howroyd, Sep 13 2019

Formula

T(n,k) = -(k!/4)*(S2(floor((n+1)/2),k) + S2(ceiling((n+1)/2),k)) + (k!/(2 n))*Sum_{d|n} phi(d)*S2(n/d,k), where S2(n,k) is the Stirling subset number A008277.
T(n,k) = A087854(n,k) - A273891(n,k).
T(n,k) = (A087854(n,k) - A305540(n,k)) / 2.
T(n, k) = Sum_{i=0..k} (-1)^(k-i)*binomial(k,i)*A293496(n, i). - Andrew Howroyd, Sep 13 2019

A327878 Irregular triangle read by rows: T(n,k) is the number of primitive (period n) periodic palindromes using exactly k different symbols, 1 <= k <= 1 + floor(n/2).

Original entry on oeis.org

1, 0, 1, 0, 2, 0, 3, 3, 0, 6, 6, 0, 7, 21, 12, 0, 14, 36, 24, 0, 18, 90, 132, 60, 0, 28, 150, 240, 120, 0, 39, 339, 900, 960, 360, 0, 62, 540, 1560, 1800, 720, 0, 81, 1149, 4968, 9300, 7920, 2520, 0, 126, 1806, 8400, 16800, 15120, 5040, 0, 175, 3765, 24588, 71400, 103320, 73080, 20160
Offset: 1

Views

Author

Andrew Howroyd, Sep 28 2019

Keywords

Comments

Primitive periodic palindromes may also be called achiral Lyndon words.

Examples

			Triangle begins:
  1;
  0,   1;
  0,   2;
  0,   3,    3;
  0,   6,    6;
  0,   7,   21,    12;
  0,  14,   36,    24;
  0,  18,   90,   132,    60;
  0,  28,  150,   240,   120;
  0,  39,  339,   900,   960,    360;
  0,  62,  540,  1560,  1800,    720;
  0,  81, 1149,  4968,  9300,   7920,  2520;
  0, 126, 1806,  8400, 16800,  15120,  5040;
  0, 175, 3765, 24588, 71400, 103320, 73080, 20160;
  ...
		

Crossrefs

Columns k=2..6 are A056498, A056499, A056500, A056501, A056502.
Row sums are A327879.

Programs

  • PARI
    T(n,k) = {sumdiv(n, d, moebius(n/d) * k! * (stirling((d+1)\2,k,2) + stirling(d\2+1,k,2)))/2}

Formula

T(n,k) = Sum_{j=1..k} (-1)^(k-j)*binomial(k,j)*A284856(n,j).
Column k is the Moebius transform of column k of A305540.

A056489 Number of periodic palindromes using exactly three different symbols.

Original entry on oeis.org

0, 0, 0, 3, 6, 21, 36, 93, 150, 345, 540, 1173, 1806, 3801, 5796, 11973, 18150, 37065, 55980, 113493, 171006, 345081, 519156, 1044453, 1569750, 3151785, 4733820, 9492213, 14250606, 28550361, 42850116, 85798533, 128746950, 257690505, 386634060, 773661333
Offset: 1

Views

Author

Keywords

Comments

For example, aaabbb is not a (finite) palindrome but it is a periodic palindrome.

Examples

			For n=4, the three arrangements are ABAC, ABCB, and ACBC.
For n=5, the six arrangements are AABCB, AACBC, ABACC, ABBAC, ABCCB, and ACBBC.
		

References

  • M. R. Nester (1999). Mathematical investigations of some plant interaction designs. PhD Thesis. University of Queensland, Brisbane, Australia. [See A056391 for pdf file of Chap. 2]

Crossrefs

Cf. A056454.
Column 3 of A305540.

Programs

  • GAP
    a:=[0,0,0,3,6];; for n in [6..40] do a[n]:=a[n-1]+5*a[n-2]-5*a[n-3]-6*a[n-4]+6*a[n-5]; od; a; # Muniru A Asiru, Sep 28 2018
  • Maple
    seq(coeff(series(3*x^4*(1+x)/((1-x)*(1-2*x^2)*(1-3*x^2)),x,n+1), x, n), n = 1..40); # Muniru A Asiru, Sep 28 2018
  • Mathematica
    k = 3; Table[(k!/2) (StirlingS2[Floor[(n + 1)/2], k] +
    StirlingS2[Ceiling[(n + 1)/2], k]), {n, 1, 40}] (* Robert A. Russell, Jun 05 2018 *)
    LinearRecurrence[{1, 5, -5, -6, 6}, {0, 0, 0, 3, 6}, 80] (* Vincenzo Librandi, Sep 27 2018 *)
  • PARI
    a(n) = my(k=3); (k!/2)*(stirling(floor((n+1)/2), k, 2) + stirling(ceil((n+1)/2), k, 2)); \\ Michel Marcus, Jun 05 2018
    

Formula

a(n) = 2 * A056343(n) - A056283(n).
G.f.: 3*x^4*(1+x)/((1-x)*(1-2*x^2)*(1-3*x^2)). - Colin Barker, May 06 2012
a(n) = (k!/2)*(S2(floor((n+1)/2),k) + S2(ceiling((n+1)/2),k)), with k=3 different colors used and where S2(n,k) is the Stirling subset number A008277. - Robert A. Russell, Jun 05 2018

A056490 Number of periodic palindromes using exactly four different symbols.

Original entry on oeis.org

0, 0, 0, 0, 0, 12, 24, 132, 240, 900, 1560, 4980, 8400, 24612, 40824, 113652, 186480, 502500, 818520, 2158260, 3498000, 9087012, 14676024, 37728372, 60780720, 155091300, 249401880, 632972340, 1016542800, 2569858212, 4123173624, 10393634292, 16664094960
Offset: 1

Views

Author

Keywords

Examples

			For example, aaabbb is not a (finite) palindrome but it is a periodic palindrome.
For n=6, the 12 arrangements are ABACDC, ABADCD, ACABDB, ACADBD, ADABCB, ADACBC, ABCDCB, ABDCDB, ACBDBC, ACDBDC, ADBCBD, and ADCBCD.
		

References

  • M. R. Nester (1999). Mathematical investigations of some plant interaction designs. PhD Thesis. University of Queensland, Brisbane, Australia. [See A056391 for pdf file of Chap. 2]

Crossrefs

Column 4 of A305540.

Programs

  • GAP
    a:=[0,0,0,0,0,12,24];; for n in [8..35] do a[n]:=a[n-1]+9*a[n-2]-9*a[n-3]-26*a[n-4]+26*a[n-5]+24*a[n-6]-24*a[n-7]; od; a; # Muniru A Asiru, Sep 26 2018
    
  • Magma
    m:=50; R:=PowerSeriesRing(Integers(), m); [0, 0, 0, 0, 0] cat Coefficients(R!(12*x^6*(1+x)/((1-x)*(1-2*x)*(1+2*x)*(1-2*x^2)*(1-3*x^2)))); // G. C. Greubel, Oct 13 2018
  • Maple
    a:=n->(factorial(4)/2)*(Stirling2(floor((n+1)/2),4)+Stirling2(ceil((n+1)/2),4)): seq(a(n),n=1..35); # Muniru A Asiru, Sep 26 2018
  • Mathematica
    k = 4; Table[(k!/2) (StirlingS2[Floor[(n + 1)/2], k] +
    StirlingS2[Ceiling[(n + 1)/2], k]), {n, 1, 40}] (* Robert A. Russell, Jun 05 2018 *)
    LinearRecurrence[{1,9,-9,-26,26,24,-24}, {0,0,0,0,0,12,24}, 40] (* Robert A. Russell, Sep 29 2018 *)
  • PARI
    a(n) = my(k=4); (k!/2)*(stirling(floor((n+1)/2), k, 2) + stirling(ceil((n+1)/2), k, 2)); \\ Michel Marcus, Jun 05 2018
    

Formula

a(n) = 2*A056344(n) - A056284(n).
G.f.: 12*x^6*(1+x)/((1-x)*(1-2*x)*(1+2*x)*(1-2*x^2)*(1-3*x^2)). - Colin Barker, May 06 2012
a(n) = (k!/2)*(S2(floor((n+1)/2),k) + S2(ceiling((n+1)/2),k)), with k=4 different colors used and where S2(n,k) is the Stirling subset number A008277. - Robert A. Russell, Jun 05 2018

A056491 Number of periodic palindromes using exactly five different symbols.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 60, 120, 960, 1800, 9300, 16800, 71400, 126000, 480060, 834120, 2968560, 5103000, 17355300, 29607600, 97567800, 165528000, 533274060, 901020120, 2855012160, 4809004200, 15050517300, 25292030400, 78417448200, 131542866000, 404936532060
Offset: 1

Views

Author

Keywords

Examples

			For example, aaabbb is not a (finite) palindrome but it is a periodic palindrome.
There are 120 permutations of the five letters used in ABACDEDC.  These 120 arrangements can be paired up with a half turn (e.g., ABACDEDC-DEDCABAC) to arrive at the 60 arrangements for n=8. - _Robert A. Russell_, Sep 26 2018
		

References

  • M. R. Nester (1999). Mathematical investigations of some plant interaction designs. PhD Thesis. University of Queensland, Brisbane, Australia. [See A056391 for pdf file of Chap. 2]

Crossrefs

Cf. A056456.
Column 5 of A305540.

Programs

  • GAP
    a:=[0,0,0,0,0,0,0,60,120];; for n in [10..35] do a[n]:=a[n-1]+14*a[n-2]-14*a[n-3]-71*a[n-4]+71*a[n-5]+154*a[n-6]-154*a[n-7]-120*a[n-8]+120*a[n-9]; od; a; # Muniru A Asiru, Sep 26 2018
    
  • Magma
    m:=50; R:=PowerSeriesRing(Integers(), m); [0, 0, 0, 0, 0, 0, 0] cat Coefficients(R!(-60*x^8*(x+1)/((x-1)*(2*x-1)*(2*x+1)*(2*x^2-1)*(3*x^2-1)*(5*x^2-1)))); // G. C. Greubel, Oct 13 2018
  • Maple
    with(combinat):  a:=n->(factorial(5)/2)*(Stirling2(floor((n+1)/2),5)+Stirling2(ceil((n+1)/2),5)): seq(a(n),n=1..35); # Muniru A Asiru, Sep 26 2018
  • Mathematica
    k = 5; Table[(k!/2) (StirlingS2[Floor[(n + 1)/2], k] +
    StirlingS2[Ceiling[(n + 1)/2], k]), {n, 1, 40}] (* Robert A. Russell, Jun 05 2018 *)
    LinearRecurrence[{1, 14, -14, -71, 71, 154, -154, -120, 120}, {0, 0,
    0, 0, 0, 0, 0, 60, 120}, 40] (* Robert A. Russell, Sep 29 2018 *)
  • PARI
    a(n) = my(k=5); (k!/2)*(stirling(floor((n+1)/2), k, 2) + stirling(ceil((n+1)/2), k, 2)); \\ Michel Marcus, Jun 05 2018
    

Formula

a(n) = 2*A056345(n) - A056285(n).
G.f.: -60*x^8*(x+1)/((x-1)*(2*x-1)*(2*x+1)*(2*x^2-1)*(3*x^2-1)*(5*x^2-1)). - Colin Barker, Jul 08 2012
a(n) = (k!/2)*(S2(floor((n+1)/2),k) + S2(ceiling((n+1)/2),k)), with k=5 different colors used and where S2(n,k) is the Stirling subset number A008277. - Robert A. Russell, Jun 05 2018
a(n) = a(n-1) + 14*a(n-2) - 14*a(n-3) - 71*a(n-4) + 71*a(n-5) + 154*a(n-6) - 154*a(n-7) - 120*a(n-8) + 120*a(n-9). - Muniru A Asiru, Sep 26 2018

A056492 Number of periodic palindromes using exactly six different symbols.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 360, 720, 7920, 15120, 103320, 191520, 1048320, 1905120, 9170280, 16435440, 72833040, 129230640, 541130040, 953029440, 3832187040, 6711344640, 26192766600, 45674188560, 174286672560, 302899156560, 1136023139160, 1969147121760
Offset: 1

Views

Author

Keywords

Examples

			For example, aaabbb is not a (finite) palindrome but it is a periodic palindrome.
There are 720 permutations of the six letters used in ABACDEFEDC.  These 720 arrangements can be paired up with a half turn (e.g., ABACDEFEDC-EFEDCABACD) to arrive at the 360 arrangements for n=10.
		

References

  • M. R. Nester (1999). Mathematical investigations of some plant interaction designs. PhD Thesis. University of Queensland, Brisbane, Australia. [See A056391 for pdf file of Chap. 2]

Crossrefs

Column 6 of A305540.

Programs

  • GAP
    a:=[0,0,0,0,0,0,0,0,0,360,720];; for n in [12..35] do a[n]:=a[n-1] +20*a[n-2]-20*a[n-3]-155*a[n-4]+155*a[n-5]+580*a[n-6] -580*a[n-7] -1044*a[n-8]+1044*a[n-9]+720*a[n-10]-720*a[n-11]; od; a; # Muniru A Asiru, Sep 26 2018
    
  • Magma
    m:=50; R:=PowerSeriesRing(Integers(), m); [0, 0, 0, 0, 0, 0, 0, 0, 0] cat Coefficients(R!(360*x^10*(x+1)/((x-1)*(2*x-1)*(2*x+1)*(2*x^2-1)*(3*x^2-1)*(5*x^2-1)*(6*x^2-1)))); // G. C. Greubel, Oct 13 2018
  • Maple
    with(combinat):  a:=n->(factorial(6)/2)*(Stirling2(floor((n+1)/2),6)+Stirling2(ceil((n+1)/2),6)): seq(a(n),n=1..35); # Muniru A Asiru, Sep 26 2018
  • Mathematica
    k = 6; Table[(k!/2) (StirlingS2[Floor[(n + 1)/2], k] + StirlingS2[Ceiling[(n + 1)/2], k]), {n, 1, 40}] (* Robert A. Russell, Jun 05 2018 *)
    LinearRecurrence[{1,20,-20,-155,155,580,-580,-1044,1044,720,-720}, Join[Table[0,{9}],{360,720}],40] (* Robert A. Russell, Sep 29 2018 *)
  • PARI
    a(n) = my(k=6); (k!/2)*(stirling(floor((n+1)/2), k, 2) + stirling(ceil((n+1)/2), k, 2)); \\ Michel Marcus, Jun 05 2018
    

Formula

a(n) = 2*A056346(n) - A056286(n).
G.f.: 360*x^10*(x+1)/((x-1)*(2*x-1)*(2*x+1)*(2*x^2-1)*(3*x^2-1)*(5*x^2-1)*(6*x^2-1)). - Colin Barker, Jul 08 2012
a(n) = (k!/2)*(S2(floor((n+1)/2),k) + S2(ceiling((n+1)/2),k)), with k=6 different colors used and where S2(n,k) is the Stirling subset number A008277. - Robert A. Russell, Jun 05 2018
a(n) = a(n-1) + 20*a(n-2) - 20*a(n-3) - 155*a(n-4) + 155*a(n-5) + 580*a(n-6) - 580*a(n-7) - 1044*a(n-8) + 1044*a(n-9) + 720*a(n-10) - 720*a(n-11). - Muniru A Asiru, Sep 26 2018

A327868 Number of achiral loops (necklaces or bracelets) of length n with integer entries that cover an initial interval of positive integers.

Original entry on oeis.org

1, 1, 2, 3, 8, 13, 44, 75, 308, 541, 2612, 4683, 25988, 47293, 296564, 545835, 3816548, 7087261, 54667412, 102247563, 862440068, 1622632573, 14857100084, 28091567595, 277474957988, 526858348381, 5584100659412, 10641342970443, 120462266974148, 230283190977853
Offset: 0

Views

Author

Andrew Howroyd, Sep 28 2019

Keywords

Comments

Achiral loops may also be called periodic palindromes.

Examples

			The a(4) = 8 achiral loops are:
  1111,
  1122, 1112, 1212, 1222,
  1213, 1232, 1323.
G.f. = 1 + x + 2*x^2 + 3*x^3 + 8*x^4 + 13*x^5 + 44*x^6 + 75*x^7 + ... - _Michael Somos_, May 04 2022
		

Crossrefs

Row sums of A305540.

Programs

  • Mathematica
    a[ n_] := If[n < 0, 0, Sum[ k!*(StirlingS2[Quotient[n+1, 2], k] + StirlingS2[Quotient[n+2, 2], k]), {k, 0, n+1}]/2]; (* Michael Somos, May 04 2022 *)
    a[ n_] := If[n < 0, 0, With[{m = Quotient[n+1, 2]},
    m!*SeriesCoefficient[1/(2 - Exp@x)^Mod[n, 2, 1], {x, 0, m}]]]; (* Michael Somos, May 04 2022 *)
  • PARI
    a(n)={if(n<1, n==0, sum(k=0, n, k!*(stirling((n+1)\2, k, 2)+stirling(n\2+1, k, 2)))/2)}

Formula

a(n) = (1/2)*Sum_{k=0..n} k!*(Stirling2(floor((n+1)/2), k) + Stirling2(ceiling((n+1)/2), k)) for n > 0.
a(2n-1) = A000670(n), a(2n) = A005649(n). - Michael Somos, May 04 2022
Showing 1-9 of 9 results.