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.

A180279 Triangle read by rows: AR(n,k) is the number of aperiodic k-reverses of n (n >= 1, 1 <= k <= n).

Original entry on oeis.org

1, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 4, 6, 4, 0, 1, 4, 3, 8, 5, 0, 1, 6, 9, 12, 15, 6, 0, 1, 6, 9, 16, 15, 18, 7, 0, 1, 8, 9, 24, 30, 18, 28, 8, 0, 1, 8, 12, 32, 25, 48, 28, 32, 9, 0, 1, 10, 15, 40, 50, 60, 70, 40, 45, 10, 0, 1, 10, 12, 48, 50, 102, 70, 96, 36, 50, 11, 0
Offset: 1

Views

Author

John P. McSorley, Aug 23 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 at least two smaller [identical] compositions.
Two k-compositions are cyclically equivalent if one can be obtained from the other by a cyclic permutation of its parts.
The reverse of a k-composition is the k-composition obtained by writing its parts in reverse. For example the reverse of 123 is 321.
A k-reverse of n is a k-composition of n which is cyclically equivalent to its reverse. And an aperiodic k-reverse of n is a k-reverse of n which is aperiodic.
For example, 114 is an aperiodic 3-reverse of 6 since it is aperiodic and its set of cyclic equivalents {114, 411, 141} contains its reverse 411.
But 123 is not an aperiodic 3-reverse of 6 since, even though it is aperiodic, its set of cyclic equivalents {123, 312, 231} does not contain its reverse 321.
Let AR(n,k) denote the number of aperiodic k-reverses of n.
This sequence is the 'AR(n,k)' triangle read by rows.

Examples

			Triangle AR(n,k) (with n >= 1 and 1 <= k <= n) begins as follows:
  1
  1 0
  1 2  0
  1 2  3  0
  1 4  6  4  0
  1 4  3  8  5  0
  1 6  9 12 15  6  0
  1 6  9 16 15 18  7  0
  1 8  9 24 30 18 28  8 0
  1 8 12 32 25 48 28 32 9 0
  ...
For example, row 8 is 1 6 9 16 15 18 7 0.
We have AR(8,3) = 9 because there are 9 aperiodic 3-reverses of 8.
These are in the classes {116, 611, 161}, {224, 422, 242}, and {233, 323, 332}.
We have AR(8,6) = 18 because all, except 3, of the 21 6-compositions of 8 are aperiodic 6-reverses of 8. The missing 3 form one class, {112112, 211211, 121121}, and they are each 6-reverses of 8, but they are each periodic of period 3; so, they are not aperiodic. [Edited by _Petros Hadjicostas_, Apr 27 2020]
		

References

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

Crossrefs

If we ignore the aperiodic requirement, we get the sequence A180171.
Row sums are A180322.
Cf. A119963.

Programs

  • Mathematica
    Table[k DivisorSum[GCD[n, k], MoebiusMu[#] Apply[Binomial[Floor[(#1 - Boole[OddQ@ #2])/2], Floor[#2/2]] &, {n/#, k/#}] &], {n, 12}, {k, n}] // Flatten (* Michael De Vlieger, Oct 11 2017 *)
  • PARI
    \\ here p(n,k) is A119963.
    p(n,k) = binomial((n-k%2)\2, k\2);
    T(n, k) = 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 08 2017

Formula

AR(n, k) = k * Sum_{d|gcd(n,k)} mu(d) * A119963(n/d, k/d). - Andrew Howroyd, Oct 08 2017 (Corrected by Petros Hadjicostas, Oct 11 2017.)

Extensions

Terms a(56) and beyond from Andrew Howroyd, Oct 08 2017
Name edited by Petros Hadjicostas, Apr 28 2020

A180249 a(n) is the total number of k-reverses of n.

Original entry on oeis.org

1, 2, 4, 8, 16, 26, 50, 80, 130, 212, 342, 518, 820, 1276, 1864, 2960, 4336, 6704, 9710, 15068, 21368, 33420, 47082, 72950, 102316, 158888, 220882, 342616, 475108, 734816, 1015778, 1569680, 2161944, 3337952, 4587200, 7069748, 9699292, 14932444, 20445520
Offset: 1

Views

Author

John P. McSorley, Aug 19 2010

Keywords

Comments

See sequence A180171 for the definition of a k-reverse of n.
Briefly, a k-reverse of n is a k-composition of n whose reverse is cyclically equivalent to itself.
This sequence is the total number of k-reverses of n for k=1,2,...,n.
It is the row sums of the 'R(n,k)' triangle from sequence A180171.
For example a(6)=26 because there are 26 k-reverses of n=6 for k=1,2,3,4,5, or 6.
They are, in cyclically equivalent, classes: {6}, {15,51}, {24,42},{33},{114,411,141},{222} {1113,3111,1311,1131}, {1122,2112,2211,1221}, {1212,2121}, {11112,21111,12111,11211,11121}, {111111}.

References

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

Crossrefs

If we ask for the number of cyclically equivalent classes we get sequence A052955.
For example the 6th term of A052955 is 11, corresponding to the 11 classes in the example above.
Row sums of A180171.

Programs

  • Mathematica
    f[n_Integer] := Block[{c = 0, k = 1, ip = IntegerPartitions@ n, lmt = 1 + PartitionsP@ n, ipk}, While[k < lmt, c += g[ ip[[k]]]; k++ ]; c]; g[lst_List] := Block[{c = 0, len = Length@ lst, per = Permutations@ lst}, While[ Length@ per > 0, rl = Union[ RotateLeft[ per[[1]], # ] & /@ Range@ len]; If[ MemberQ[rl, Reverse@ per[[1]]], c += Length@ rl]; per = Complement[ per, rl]]; c]; Array[f, 24] (* Robert G. Wilson v, Aug 25 2010 *)
    b[n_] := Sum[MoebiusMu[n/d] * If[OddQ[d], 2, 3] * 2^Quotient[d-1, 2], {d, Divisors[n]}]; a[n_] := Sum[d*b[d], {d, Divisors[n]}] / 2; Array[a, 39] (* Jean-François Alcover, Nov 04 2017, after Andrew Howroyd *)
  • PARI
    \\ here b(n) is A056493
    b(n) = sumdiv(n, d, moebius(n/d) * if(d%2,2,3) * 2^((d-1)\2));
    a(n) = sumdiv(n, d, d*b(d)) / 2; \\ Andrew Howroyd, Oct 07 2017

Formula

a(n) = Sum_{d|n} d*A056493(d)/2. - Andrew Howroyd, Oct 07 2017
From Petros Hadjicostas, Oct 15 2017: (Start)
a(n) = (n/2)*Sum_{d|n} (phi^(-1)(d)/d)*b(n/d), where phi^(-1)(n) = A023900(n) is the Dirichlet inverse of the Euler totient function and b(n) = A029744(n+1) (= 3*2^((n/2)-1), if n is even, and = 2^((n+1)/2), if n is odd).
G.f.: Sum_{n>=1} phi^(-1)(n)*g(x^n), where phi^(-1)(n) = A023900(n) and g(x) = x*(x+1)*(2*x+1)/(1-2*x^2)^2.
(End)

Extensions

a(11) - a(24) from Robert G. Wilson v, Aug 25 2010
a(25) - a(27) from Robert G. Wilson v, Aug 29 2010
Terms a(28) and beyond from Andrew Howroyd, Oct 07 2017

A181135 a(n) = ADP(n) is the total number of aperiodic k-double-palindromes of n, where 2 <= k <= n.

Original entry on oeis.org

0, 0, 2, 4, 12, 16, 42, 60, 112, 168, 310, 432, 756, 1106, 1722, 2640, 4080, 6062, 9198, 13860, 20300, 31062, 45034, 68340, 98208, 149940, 212576, 325080, 458724, 700128, 983010, 1501440, 2096096, 3202800, 4456074, 6800976, 9437148, 14398958, 19920474
Offset: 1

Views

Author

John P. McSorley, Oct 05 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, so it is an aperiodic 7-double-palindrome of 17. See sequence A181111.
The n-th term of this sequence is ADP(n), the total number of aperiodic k-double-palindromes of n, where 2 <= k <= n.
For example ADP(6)=16 because there are 16 aperiodic k-double-palindromes of 6 for k=2,3,4,5, or 6. They are:
(with k=2) 15=1|5, 51=5|1, 24=2|4, 42=4|2,
(with k=3) 114=11|4, 411=4|11,
(with k=4) 1113=111|3, 3111=3|111, 1311=131|1, 1131=1|131, 1122=11|22, and 2211=22|11,
(with k=5) 11112=1111|2, 21111=2|1111, 12111=121|11, 11121=11|121.

References

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

Crossrefs

Row sums of A181111 (number of aperiodic k-double-palindromes of n).

Programs

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

Formula

a(n) = A180322(n) - A179781(n). - Andrew Howroyd, Sep 27 2019

Extensions

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