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.
%I A179317 #18 Sep 24 2019 03:15:25 %S A179317 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, %T A179317 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, %U A179317 0,4,2,10,4,10,4,4,2,1,0 %N A179317 'APE(n,k)' triangle read by rows. APE(n,k) is the number of aperiodic k-palindromes of n up to cyclic equivalence. %C A179317 A k-composition of n is an ordered collection of k positive integers (parts) which sum to n. %C A179317 Two k-compositions of n are cyclically equivalent if one can be obtained from the other by a cyclic permutation of its parts. %C A179317 A k-composition is aperiodic (primitive) if its period is k, or if it is not the concatenation of a smaller composition. %C A179317 A k-palindrome of n is a k-composition of n which is a palindrome. %C A179317 Let APE(n,k) denote the number of aperiodic k-palindromes of n up to cyclic equivalence. %C A179317 This sequence is the 'APE(n,k)' triangle read by rows. %C A179317 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 %D A179317 John P. McSorley: Counting k-compositions of n with palindromic and related structures. Preprint, 2010. %H A179317 Andrew Howroyd, <a href="/A179317/b179317.txt">Table of n, a(n) for n = 1..1275</a> (Rows n=1..50 of triangle, flattened) %F A179317 APE(n,k) = (3-(-1)^k)/4 * A179519(n,k). - _Andrew Howroyd_, Oct 07 2017 %e A179317 The triangle begins %e A179317 1 %e A179317 1,0 %e A179317 1,0,0 %e A179317 1,0,1,0 %e A179317 1,0,2,0,0 %e A179317 1,0,1,1,1,0 %e A179317 1,0,3,0,3,0,0 %e A179317 1,0,3,1,3,1,1,0 %e A179317 1,0,3,0,6,0,4,0,0 %e A179317 1,0,4,2,5,2,4,2,1,0 %e A179317 For example, row 8 is 1,0,3,1,3,1,1,0. %e A179317 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. %e A179317 We have APE(8,4)=1 because there are 2 aperiodic 4-palindromes of 8, namely: 3113 and 1331, but they are cyclically equivalent. %t A179317 T[n_, k_] := (3-(-1)^k)/4*Sum[MoebiusMu[d]*QBinomial[n/d - 1, k/d - 1, -1], {d, Divisors[GCD[n, k]]}]; %t A179317 Table[T[n, k], {n, 1, 12}, {k, 1, n}] // Flatten (* _Jean-François Alcover_, Sep 24 2019 *) %o A179317 (PARI) \\ here p(n, k)=A051159(n-1, k-1) is number of k-palindromes of n. %o A179317 p(n, k) = if(n%2==1&&k%2==0, 0, binomial((n-1)\2, (k-1)\2)); %o A179317 T(n, k) = if(k%2,1,1/2) * sumdiv(gcd(n,k), d, moebius(d) * p(n/d, k/d)); %o A179317 for(n=1, 10, for(k=1, n, print1(T(n,k), ", ")); print) \\ _Andrew Howroyd_, Oct 07 2017 %Y A179317 The row sums of the 'APE(n, k)' triangle give sequence A056513. %Y A179317 If cyclic equivalence is ignored, we get sequence A179519. - _John P. McSorley_, Jul 26 2010 %K A179317 nonn,tabl %O A179317 1,13 %A A179317 _John P. McSorley_, Jul 10 2010 %E A179317 Terms a(56) and beyond from _Andrew Howroyd_, Oct 07 2017