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.

Previous Showing 11-20 of 31 results. Next

A357485 Heinz numbers of integer partitions with the same length as reverse-alternating sum.

Original entry on oeis.org

1, 2, 20, 42, 45, 105, 110, 125, 176, 182, 231, 245, 312, 374, 396, 429, 494, 605, 663, 680, 702, 780, 782, 845, 891, 969, 1064, 1088, 1100, 1102, 1311, 1426, 1428, 1445, 1530, 1755, 1805, 1820, 1824, 1950, 2001, 2024, 2146, 2156, 2394, 2448, 2475, 2508, 2542
Offset: 1

Views

Author

Gus Wiseman, Oct 01 2022

Keywords

Comments

The Heinz number of a partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k). This gives a bijective correspondence between positive integers and integer partitions.
The reverse-alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^i y_i.

Examples

			The terms together with their prime indices begin:
     1: {}
     2: {1}
    20: {1,1,3}
    42: {1,2,4}
    45: {2,2,3}
   105: {2,3,4}
   110: {1,3,5}
   125: {3,3,3}
   176: {1,1,1,1,5}
   182: {1,4,6}
   231: {2,4,5}
   245: {3,4,4}
   312: {1,1,1,2,6}
   374: {1,5,7}
   396: {1,1,2,2,5}
		

Crossrefs

The version for compositions is A357184, counted by A357182.
These partitions are counted by A357189.
For absolute value we have A357486, counted by A357487.
A000041 counts partitions, strict A000009.
A000712 up to 0's counts partitions w sum = twice alt sum, ranked A349159.
A001055 counts partitions with product equal to sum, ranked by A301987.
A006330 up to 0's counts partitions w sum = twice rev-alt sum, rank A349160.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
    Select[Range[100],PrimeOmega[#]==ats[primeMS[#]]&]

A357487 Number of integer partitions of n with the same length as reverse-alternating sum.

Original entry on oeis.org

1, 1, 0, 0, 0, 1, 0, 2, 0, 4, 0, 5, 0, 9, 0, 13, 0, 23, 0, 34, 0, 54, 0, 78, 0, 120, 0, 170, 0, 252, 0, 358, 0, 517, 0, 725, 0, 1030, 0, 1427, 0, 1992, 0, 2733, 0, 3759, 0, 5106, 0, 6946, 0, 9345, 0, 12577, 0, 16788, 0, 22384, 0, 29641, 0
Offset: 0

Views

Author

Gus Wiseman, Oct 01 2022

Keywords

Comments

A partition of n is a weakly decreasing sequence of positive integers summing to n.
The reverse-alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^i y_i.

Examples

			The a(1) = 1 through a(13) = 9 partitions:
  1   .  .  .  311   .  322   .  333     .  443     .  553
                        421      432        542        652
                                 531        641        751
                                 51111      52211      52222
                                            62111      53311
                                                       62221
                                                       63211
                                                       73111
                                                       7111111
		

Crossrefs

For product equal to sum we have A001055, compositions A335405.
The version for compositions is A357182, reverse ranked by A357184.
The reverse version is A357189, ranked by A357486.
These partitions are ranked by A357485.
Removing zeros gives A357488.
A000041 counts partitions, strict A000009.
A025047 counts alternating compositions.
A103919 counts partitions by alternating sum, full triangle A344651.
A357136 counts compositions by alternating sum, full triangle A097805.

Programs

  • Mathematica
    ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
    Table[Length[Select[IntegerPartitions[n],Length[#]==ats[Reverse[#]]&]],{n,0,30}]

A357486 Heinz numbers of integer partitions with the same length as alternating sum.

Original entry on oeis.org

1, 2, 10, 20, 21, 42, 45, 55, 88, 91, 105, 110, 125, 156, 176, 182, 187, 198, 231, 245, 247, 312, 340, 351, 374, 390, 391, 396, 429, 494, 532, 544, 550, 551, 605, 663, 680, 702, 713, 714, 765, 780, 782, 845, 891, 910, 912, 969, 975, 1012, 1064, 1073, 1078
Offset: 1

Views

Author

Gus Wiseman, Oct 01 2022

Keywords

Comments

The Heinz number of a partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k). This gives a bijective correspondence between positive integers and integer partitions.
The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i.

Examples

			The terms together with their prime indices begin:
     1: {}
     2: {1}
    10: {1,3}
    20: {1,1,3}
    21: {2,4}
    42: {1,2,4}
    45: {2,2,3}
    55: {3,5}
    88: {1,1,1,5}
    91: {4,6}
   105: {2,3,4}
   110: {1,3,5}
   125: {3,3,3}
   156: {1,1,2,6}
   176: {1,1,1,1,5}
		

Crossrefs

For product instead of length we have new, counted by A004526.
The version for compositions is A357184, counted by A357182.
For absolute value we have A357486, counted by A357487.
These partitions are counted by A357189.
A000041 counts partitions, strict A000009.
A000712 up to 0's counts partitions, sum = twice alt sum, rank A349159.
A001055 counts partitions with product equal to sum, ranked by A301987.
A006330 up to 0's counts partitions, sum = twice rev-alt sum, rank A349160.
A025047 counts alternating compositions.
A357136 counts compositions by alternating sum.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
    Select[Range[100],PrimeOmega[#]==ats[Reverse[primeMS[#]]]&]

A051160 Coefficients in expansion of (1-x)^floor(n/2)(1+x)^ceiling(n/2).

Original entry on oeis.org

1, 1, 1, 1, 0, -1, 1, 1, -1, -1, 1, 0, -2, 0, 1, 1, 1, -2, -2, 1, 1, 1, 0, -3, 0, 3, 0, -1, 1, 1, -3, -3, 3, 3, -1, -1, 1, 0, -4, 0, 6, 0, -4, 0, 1, 1, 1, -4, -4, 6, 6, -4, -4, 1, 1, 1, 0, -5, 0, 10, 0, -10, 0, 5, 0, -1, 1, 1, -5, -5, 10, 10, -10, -10, 5, 5, -1, -1, 1, 0, -6, 0, 15, 0, -20
Offset: 0

Views

Author

Michael Somos, Oct 14 1999

Keywords

Comments

Triangle T(n,k), 0<=k<=n, read by rows given by: [1,0,-1,0,0,0,0,0,...]DELTA[1,-2,1,0,0,0,0,0,...] where DELTA is the operator defined in A084938. - Philippe Deléham, Sep 22 2008
The production matrix for this array has bivariate e.g.f. equal to exp(-t*x)*(1-t). - Paul Barry, Nov 22 2008
The elements of the matrix inverse are apparently T^(-1)(n,k) = (-1)^(n+k)*T(n,k). - R. J. Mathar, Apr 08 2013
Row sums give A130706. - Philippe Deléham, Oct 21 2013

Examples

			Triangle begins:
  1;
  1,  1;
  1,  0, -1;
  1,  1, -1, -1;
  1,  0, -2,  0,  1;
  1,  1, -2, -2,  1,  1;
  ...
		

Crossrefs

Cf. A007318, A051159(n, k) = (-1)^[ k/2 ]*T(n, k).

Programs

  • Maple
    A051160 := proc(n,k)
        (1-x)^floor(n/2)*(1+x)^ceil(n/2) ;
        coeftayl(%,x=0,k) ;
    end proc: # R. J. Mathar, Apr 08 2013
  • Mathematica
    t[n_, k_] := Coefficient[(1-x)^Floor[n/2]*(1+x)^Ceiling[n/2], x, k]; Table[t[n, k], {n, 0, 12}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jan 09 2014 *)
  • PARI
    {T(n, k) = polcoeff( (1 - x)^(n\2) * (1 + x)^ceil(n/2), k)}

Formula

T(n, k) = -T(n-2, k-2) + T(n-2, k). T(0, 0) = T(1, 0) = T(1, 1) = 1.
T(n,k) = T(n-1,k) + (-1)^(n-1)*T(n-1,k-1), T(0,0)=1. - Jose Ramon Real, Nov 10 2007
G.f.: (1+x+x*y)/(1-x^2+x^2*y^2). - Philippe Deléham, Oct 21 2013

A093968 Inverse binomial transform of n*Pell(n).

Original entry on oeis.org

0, 1, 2, 6, 8, 20, 24, 56, 64, 144, 160, 352, 384, 832, 896, 1920, 2048, 4352, 4608, 9728, 10240, 21504, 22528, 47104, 49152, 102400, 106496, 221184, 229376, 475136, 491520, 1015808, 1048576, 2162688, 2228224, 4587520, 4718592, 9699328, 9961472, 20447232, 20971520
Offset: 0

Views

Author

Paul Barry, Apr 21 2004

Keywords

Comments

Binomial transform is A093967.
Binomial transform of (-1)^(n+1)(n*Pell(n-2)) (see A093969).
S-D transform of A001477 (cf. A051159). - Philippe Deléham, Aug 01 2006
a(n) is also the number of projective permutations of vertices of regular n-gons. A permutation of n vertices (AFB...CD) is considered 'projective' if there exists a line so that all the vertices can be projected onto it and the resulted points can be read in the same order: A'F'B'...C'D'. - Anton Zakharov, Jul 25 2016

Examples

			a(3) = 6, as there are only 6 projective permutations of vertices in a triangle ABC: ABC,CBA,ACB,BCA,CAB,BAC and it is equal to the number of simple permutations of three elements.
a(4) = 8, as there are only 8 permutations of vertices in a square, satisfying the projective criterion: ADBC,DACB,DCAB,CDBA,CBDA,BCAD,BACD,ABDC. ADCB is not allowed, cause there is no way to draw a line so that the projections A'B'C'D' of the original points form a line segment B'C' lying inside A'D' on this line. - _Anton Zakharov_, Jul 25 2016
		

Crossrefs

Programs

  • Mathematica
    a[n_] := n*2^Floor[(n - 1)/2]; Array[a, 40, 0] (* Amiram Eldar, Feb 13 2023 *)

Formula

G.f.: x(1+2x+2x^2)/(1-2x^2)^2;
a(n) = 2^((n-4)/2)n((1+sqrt(2)) + (1-sqrt(2))(-1)^n).
a(2n) = A036289(n). a(2n+1) = A014480(n). - R. J. Mathar, Jun 02 2011
G.f.: x*G(0)/(1-x) where G(k) = 1 + x/(k+1 - 2*x*(k+1)*(k+2)/(2*x*(k+2) + 1/G(k+1) )); (recursively defined continued fraction). - Sergei N. Gladkovskii, Feb 01 2013
a(n) = n*2^floor((n-1)/2). - Anton Zakharov, Jul 25 2016
E.g.f.: x*(sqrt(2)*sinh(sqrt(2)*x) + 2*cosh(sqrt(2)*x))/2. - Ilya Gutkovskiy, Jul 25 2016
Sum_{n>=1} 1/a(n) = log(2) + sqrt(2)*log(1+sqrt(2)). - Amiram Eldar, Feb 13 2023

A179519 'AP(n,k)' triangle read by rows. AP(n,k) is the number of aperiodic k-palindromes of n.

Original entry on oeis.org

1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 2, 0, 0, 1, 0, 1, 2, 1, 0, 1, 0, 3, 0, 3, 0, 0, 1, 0, 3, 2, 3, 2, 1, 0, 1, 0, 3, 0, 6, 0, 4, 0, 0, 1, 0, 4, 4, 5, 4, 4, 4, 1, 0, 1, 0, 5, 0, 10, 0, 10, 0, 5, 0, 0, 1, 0, 4, 4, 10, 8, 10, 8, 4, 4, 1, 0
Offset: 1

Views

Author

John P. McSorley, Jul 17 2010

Keywords

Comments

A k-composition of n is an ordered collection of k positive integers (parts) which sum to n.
A k-composition is aperiodic (primitive) if its period is k, or if it is not the concatenation of a smaller composition.
A k-palindrome of n is a k-composition of n which is a palindrome.
Let AP(n,k) denote the number of aperiodic k-palindromes of n.
This sequence is the 'AP(n,k)' triangle read by rows.
The g.f. of this triangular array follows easily from A. Howroyd's formula for this sequence and P. Deleham's g.f. for sequence A051159. If T(n,k) = A051159(n,k), then g.f. = Sum_{n,k>=1} AP(n,k)*x^n*y^k = Sum_{n,k>=1} Sum_{d|gcd(n,k)} mu(d)*T(n/d-1,k/d-1)*x^n*y^k. Letting m = n/d and s = k/d, we get g.f. = Sum_{d>=1} mu(d)*Sum_{m,s>=1} T(m-1,s-1)*(x^d)^m*(y^d)^s. But P. Deleham's formula for sequence A051159 implies Sum_{m,s>=1} T(m-1,s-1)*x^m*y^s = x*y*(1+x+x*y)/(1-x^2-x^2*y^2). Thus, Sum_{n,k>=1} AP(n,k)*x^n*y^k = Sum_{d>=1} mu(d)*f(x^d,y^d), where f(x,y) = x*y*(1+x+x*y)/(1-x^2-x^2*y^2). - Petros Hadjicostas, Nov 04 2017

Examples

			The triangle begins
  1
  1,0
  1,0,0
  1,0,1,0
  1,0,2,0,0
  1,0,1,2,1,0
  1,0,3,0,3,0,0
  1,0,3,2,3,2,1,0
  1,0,3,0,6,0,4,0,0
  1,0,4,4,5,4,4,4,1,0
For example, row 8 is 1,0,3,2,3,2,1,0.
We have AP(8,3)=3 because there are 3 aperiodic 3-palindromes of 8, namely: 161, 242, and 323.
We have AP(8,4)=2 because there are 2 aperiodic 4-palindromes of 8, namely: 3113 and 1331.
		

References

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

Crossrefs

If we count the aperiodic k-palindromes of n up to cyclic equivalence, APE(n, k), we get sequence A179317.
The row sums of this triangle give sequence A179781. - John P. McSorley, Jul 26 2010

Programs

  • Mathematica
    T[n_, k_] := Sum[MoebiusMu[d]*QBinomial[n/d-1, k/d-1, -1], {d, Divisors[ GCD[n, k]]}]; Table[T[n, k], {n, 1, 12}, {k, 1, n}] // Flatten (* Jean-François Alcover, Oct 30 2017, after Andrew Howroyd *)
  • PARI
    \\ here p(n,k)=A051159(n-1,k-1) is number of k-palindromes of n.
    p(n, k) = if(n%2==1&&k%2==0, 0, binomial((n-1)\2, (k-1)\2));
    T(n, k) = sumdiv(gcd(n,k), d, moebius(d) * p(n/d, k/d));
    for(n=1, 10, for(k=1, n, print1(T(n,k), ", ")); print) \\ Andrew Howroyd, Oct 07 2017

Formula

T(n,k) = Sum_{d|gcd(n,k)} mu(d) * A051159(n/d-1, k/d-1). - Andrew Howroyd, Oct 07 2017
G.f.: Sum_{n>=1} mu(n)*f(x^n,y^n), where f(x,y) = x*y*(1+x+x*y)/(1-x^2-x^2*y^2). - Petros Hadjicostas, Nov 04 2017

Extensions

Terms a(56) and beyond from Andrew Howroyd, Oct 07 2017

A180653 'DP(n,k)' triangle read by rows. DP(n,k) is the number of k-double-palindromes of n.

Original entry on oeis.org

0, 0, 1, 0, 2, 1, 0, 3, 2, 1, 0, 4, 4, 4, 1, 0, 5, 3, 8, 4, 1, 0, 6, 6, 12, 12, 6, 1, 0, 7, 6, 17, 12, 19, 6, 1, 0, 8, 7, 24, 24, 20, 24, 8, 1, 0, 9, 8, 32, 21, 50, 24, 32, 8, 1, 0, 10, 10, 40, 40, 60, 60, 40, 40, 10, 1, 0, 11, 9, 49, 40, 100, 60, 98, 35, 51, 10, 1
Offset: 1

Views

Author

John P. McSorley, Sep 14 2010

Keywords

Comments

A k-composition of n is an ordered collection of k positive integers (parts) which sum to n. A palindrome is a word which is the same when written backwards.
A k-double-palindrome of n is a k-composition of n which is the concatenation of two palindromes, PP'=P|P', where both |P|, |P'|>=1.
For example 1123532=11|23532 is a 7-double-palindrome of 17 since both 11 and 23532 are palindromes.
Let DP(n,k) denote the number of k-double-palindromes of n.
This sequence is the 'DP(n,k)' triangle read by rows.

Examples

			The triangle begins
  0
  0 1
  0 2 1
  0 3 2  1
  0 4 4  4  1
  0 5 3  8  4  1
  0 6 6 12 12  6  1
  0 7 6 17 12 19  6  1
  0 8 7 24 24 20 24  8 1
  0 9 8 32 21 50 24 32 8 1
  ...
For example, row 8 is: 0 7 6 17 12 19 6 1.
We have DP(8,3)=6 because there are 6 3-double-palindromes of 8: 116, 611, 224, 422, 233, and 332.
We have DP(8,4)=17 because there are 17 4-double-palindromes of 8: 1115, 5111, 1511, 1151, 1214, 4121, 1412, 2141, 1133, 3311, 1313, 3131, 1232, 2123, 3212, 2321, and 2222.
		

References

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

Crossrefs

Row sums are A180750.
See sequence A051159 for the triangle whose (n, k) term gives the number of k-palindromes (single-palindromes) of n.

Programs

  • PARI
    \\ p(n,k) is k*A119963(n,k); q(n,k) is A051159(n-1, k-1).
    p(n, k) = {k*binomial((n-k%2)\2, k\2)}
    q(n, k) = {if(n%2==1&&k%2==0, 0, binomial((n-1)\2, (k-1)\2))}
    invphi(n) = {sumdiv(n, d, d*moebius(d))}
    T(n, k) = sumdiv(gcd(n, k), d, invphi(d) * p(n/d, k/d) - moebius(d) * q(n/d, k/d)); \\ Andrew Howroyd, Sep 27 2019

Formula

T(n,k) = A180279(n,k) - A179519(n,k). - Andrew Howroyd, Sep 27 2019

Extensions

Terms a(56) and beyond from Andrew Howroyd, Sep 27 2019

A181111 'ADP(n,k)' triangle read by rows. ADP(n,k) is the number of aperiodic k-double-palindromes of n.

Original entry on oeis.org

0, 0, 0, 0, 2, 0, 0, 2, 2, 0, 0, 4, 4, 4, 0, 0, 4, 2, 6, 4, 0, 0, 6, 6, 12, 12, 6, 0, 0, 6, 6, 14, 12, 16, 6, 0, 0, 8, 6, 24, 24, 18, 24, 8, 0, 0, 8, 8, 28, 20, 44, 24, 28, 8, 0, 0, 10, 10, 40, 40, 60, 60, 40, 40, 10, 0, 0, 10, 8, 44, 40, 94, 60, 88, 32, 46, 10, 0
Offset: 1

Views

Author

John P. McSorley, Oct 03 2010

Keywords

Comments

A k-composition of n is an ordered collection of k positive integers (parts) which sum to n. A k-composition is aperiodic (primitive) if its period is k, i.e., if it is not the concatenation of at least two smaller compositions.
A palindrome is a word which is the same when written backwards.
A k-double-palindrome of n is a k-composition of n which is the concatenation of two palindromes, PP'=P|P', where both |P|, |P'|>=1.
For example 1123532=11|23532 is a 7-double-palindrome of 17 since both 11 and 23532 are palindromes. It is also aperiodic, and so it is an aperiodic 7-double-palindrome of 17. The 4-double-palindrome of 8 1313=131|3 is not aperiodic, so it is not an aperiodic 4-double-palindrome of 8.
Let ADP(n,k) denote the number of aperiodic k-double-palindromes of n.
This sequence is the 'ADP(n,k)' triangle read by rows.

Examples

			The triangle begins:
  0
  0 0
  0 2 0
  0 2 2  0
  0 4 4  4  0
  0 4 2  6  4  0
  0 6 6 12 12  6  0
  0 6 6 14 12 16  6  0
  0 8 6 24 24 18 24  8 0
  0 8 8 28 20 44 24 28 8 0
  ...
For example, row 8 is: 0 6 6 14 12 16 6 0.
We have ADP(8,3)=6 because there are 6 aperiodic 3-double-palindromes of 8: 116, 611, 224, 422, 233, and 332.
We have ADP(8,4)=14 because there are 14 4-double-palindromes of 8: 1115, 5111, 1511, 1151, 1214, 4121, 1412, 2141, 1133, 3311, 1232, 2123, 3212, and 2321.
		

References

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

Crossrefs

Row sums are A181135.
See sequence A180653 for the triangle whose (n, k) term gives the number of k-double-palindromes of n.
See sequence A179519 for the triangle whose (n, k) term gives the number of aperiodic k-palindromes (single-palindromes) of n.

Programs

  • PARI
    \\ here p(n,k) is A119963(n,k), q(n,k) is A051159(n-1, k-1).
    p(n, k) = { binomial((n-k%2)\2, k\2) }
    q(n, k) = { if(n%2==1&&k%2==0, 0, binomial((n-1)\2, (k-1)\2)) }
    T(n, k) = sumdiv(gcd(n, k), d, moebius(d) * (k*p(n/d, k/d) - q(n/d, k/d))); \\ Andrew Howroyd, Sep 27 2019

Formula

T(n,k) = A180279(n,k) - A179519(n,k). - Andrew Howroyd, Sep 27 2019

Extensions

a(37) corrected and terms a(56) and beyond from Andrew Howroyd, Sep 27 2019

A171142 Triangle T(n,k) of the coefficients [x^k] of the polynomial p_n(x), where p_n(x)=(1+x)*p_{n-1}(x) if n even, p_n(x) = (x^2+4x+1)^((n-1)/2) if n odd.

Original entry on oeis.org

1, 1, 1, 1, 4, 1, 1, 5, 5, 1, 1, 8, 18, 8, 1, 1, 9, 26, 26, 9, 1, 1, 12, 51, 88, 51, 12, 1, 1, 13, 63, 139, 139, 63, 13, 1, 1, 16, 100, 304, 454, 304, 100, 16, 1, 1, 17, 116, 404, 758, 758, 404, 116, 17, 1, 1, 20, 165, 720, 1770, 2424, 1770, 720, 165, 20, 1, 1, 21, 185, 885
Offset: 1

Views

Author

Roger L. Bagula and Gary W. Adamson, Dec 04 2009

Keywords

Comments

Row sums are apparently in A026549.

Examples

			The triangle starts in row n=1 with column 0<=k<n as:
1;
1, 1;
1, 4, 1;
1, 5, 5, 1;
1, 8, 18, 8, 1;
1, 9, 26, 26, 9, 1;
1, 12, 51, 88, 51, 12, 1;
1, 13, 63, 139, 139, 63, 13, 1;
1, 16, 100, 304, 454, 304, 100, 16, 1;
1, 17, 116, 404, 758, 758, 404, 116, 17, 1;
1, 20, 165, 720, 1770, 2424, 1770, 720, 165, 20, 1;
1, 21, 185, 885, 2490, 4194, 4194, 2490, 885, 185, 21, 1;
		

Crossrefs

Programs

  • Maple
    A171142P := proc(n) option remember; if type(n,'even') then (x+1)*procname(n-1) ; else (x^2+4*x+1)^((n-1)/2) ; end if; expand(%) ;end proc:
    A171142 := proc(n,k) coeff(A171142P(n,x),x,k) ; end proc:
  • Mathematica
    Clear[p, n, x, a]
    w = 4;
    p[x, 1] := 1;
    p[x_, n_] := p[x, n] = If[Mod[n, 2] == 0, (x + 1)*p[x, n - 1], (x^2 + w*x + 1)^Floor[n/2]];
    a = Table[CoefficientList[p[x, n], x], {n, 1, 12}];
    Flatten[a]

A179317 'APE(n,k)' triangle read by rows. APE(n,k) is the number of aperiodic k-palindromes of n up to cyclic equivalence.

Original entry on oeis.org

1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 2, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 3, 0, 3, 0, 0, 1, 0, 3, 1, 3, 1, 1, 0, 1, 0, 3, 0, 6, 0, 4, 0, 0, 1, 0, 4, 2, 5, 2, 4, 2, 1, 0, 1, 0, 5, 0, 10, 0, 10, 0, 5, 0, 0, 1, 0, 4, 2, 10, 4, 10, 4, 4, 2, 1, 0
Offset: 1

Views

Author

John P. McSorley, Jul 10 2010

Keywords

Comments

A k-composition of n is an ordered collection of k positive integers (parts) which sum to n.
Two k-compositions of n are cyclically equivalent if one can be obtained from the other by a cyclic permutation of its parts.
A k-composition is aperiodic (primitive) if its period is k, or if it is not the concatenation of a smaller composition.
A k-palindrome of n is a k-composition of n which is a palindrome.
Let APE(n,k) denote the number of aperiodic k-palindromes of n up to cyclic equivalence.
This sequence is the 'APE(n,k)' triangle read by rows.
The only possibility for two distinct aperiodic palindromes to be cyclically equivalent is with an even number of terms and with a rotation by half the number of terms. For example, 123321 is cyclically equivalent to 321123. - Andrew Howroyd, Oct 07 2017

Examples

			The triangle begins
1
1,0
1,0,0
1,0,1,0
1,0,2,0,0
1,0,1,1,1,0
1,0,3,0,3,0,0
1,0,3,1,3,1,1,0
1,0,3,0,6,0,4,0,0
1,0,4,2,5,2,4,2,1,0
For example, row 8 is 1,0,3,1,3,1,1,0.
We have APE(8,3)=3 because there are 3 aperiodic 3-palindromes of 8, namely: 161, 242, and 323, and none are cyclically equivalent to the others.
We have APE(8,4)=1 because there are 2 aperiodic 4-palindromes of 8, namely: 3113 and 1331, but they are cyclically equivalent.
		

References

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

Crossrefs

The row sums of the 'APE(n, k)' triangle give sequence A056513.
If cyclic equivalence is ignored, we get sequence A179519. - John P. McSorley, Jul 26 2010

Programs

  • Mathematica
    T[n_, k_] := (3-(-1)^k)/4*Sum[MoebiusMu[d]*QBinomial[n/d - 1, k/d - 1, -1], {d, Divisors[GCD[n, k]]}];
    Table[T[n, k], {n, 1, 12}, {k, 1, n}] // Flatten (* Jean-François Alcover, Sep 24 2019 *)
  • PARI
    \\ here p(n, k)=A051159(n-1, k-1) is number of k-palindromes of n.
    p(n, k) = if(n%2==1&&k%2==0, 0, binomial((n-1)\2, (k-1)\2));
    T(n, k) = if(k%2,1,1/2) * sumdiv(gcd(n,k), d, moebius(d) * p(n/d, k/d));
    for(n=1, 10, for(k=1, n, print1(T(n,k), ", ")); print) \\ Andrew Howroyd, Oct 07 2017

Formula

APE(n,k) = (3-(-1)^k)/4 * A179519(n,k). - Andrew Howroyd, Oct 07 2017

Extensions

Terms a(56) and beyond from Andrew Howroyd, Oct 07 2017
Previous Showing 11-20 of 31 results. Next