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-3 of 3 results.

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

A181314 a(n) = ADPE(n) is the total number of aperiodic k-double-palindromes of n up to cyclic equivalence, where 1 <= k <= n.

Original entry on oeis.org

0, 0, 1, 2, 5, 6, 13, 17, 27, 38, 61, 80, 125, 174, 245, 359, 509, 727, 1021, 1484, 2029, 3006, 4093, 6029, 8183, 12158, 16351, 24380, 32765, 48848, 65533, 97919, 131005, 196094, 262121, 392363, 524285, 785406, 1048445, 1571309, 2097149, 3143496, 4194301, 6288380, 8388323
Offset: 1

Views

Author

John P. McSorley, Oct 12 2010

Keywords

Comments

a(n) = ADPE(n) is the total number of aperiodic k-double-palindromes of n up to cyclic equivalence. See sequence A181169 for the definitions of an aperiodic k-double-palindrome of n and of cyclic equivalence.
Sequence A181169 is the 'ADPE(n,k)' triangle read by rows where ADPE(n,k) is the number of aperiodic k-double-palindromes of n up to cyclic equivalence.
For example, we have a(6) = ADPE(6) = ADPE(6,1) + ADPE(6,2) + ADPE(6,3) + ADPE(6,4) + ADPE(6,5) + ADPE(6,6) = 0 + 2 + 1 + 2 + 1 + 0 = 6. The 6 aperiodic double-palindromes of 6 up to cyclic equivalence are: 15, 24, 114, 1113, 1122, 11112. They are the representatives of the cyclic equivalence classes: {15,51}, {24,42}, {114,411,141},{1113,3111,1311,1131}, {1122,2112,2211,1221} and {11112,21111,12111,11211,11121}.
Hence a(n) = ADPE(n) is the total number of cyclic equivalence classes of compositions of n containing at least one aperiodic double-palindrome of n.

Crossrefs

Row sums of A181169.
If we remove the aperiodic requirement, we get sequence A027383, see the comment from McSorley there. Also see sequences A181111 and A181135.
Cf. A056493.

Programs

  • PARI
    a(n)={sumdiv(n, d, moebius(n/d)*((3 + d%2)*2^(d\2-1) - 1)) - 1} \\ Andrew Howroyd, Sep 28 2019

Formula

From Andrew Howroyd, Sep 28 2019: (Start)
a(n) = A056493(n) - 1 for n > 1.
G.f.: (x^2-2*x)/(1-x) + Sum_{k=1..n} mu(k)*x^k*(2 + 3*x^k)/(1 - 2*x^(2*k)).
(End)

Extensions

Terms a(11) and beyond from Andrew Howroyd, Sep 27 2019
Showing 1-3 of 3 results.