A179519 'AP(n,k)' triangle read by rows. AP(n,k) is the number of aperiodic k-palindromes of n.
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
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.
Links
- Andrew Howroyd, Table of n, a(n) for n = 1..1275
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
Comments