A179317 'APE(n,k)' triangle read by rows. APE(n,k) is the number of aperiodic k-palindromes of n up to cyclic equivalence.
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
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.
Links
- Andrew Howroyd, Table of n, a(n) for n = 1..1275 (Rows n=1..50 of triangle, flattened)
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
Comments