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.

Previous Showing 11-14 of 14 results.

A319436 Number of palindromic plane trees with n nodes.

Original entry on oeis.org

1, 1, 2, 3, 6, 10, 20, 35, 68, 122, 234, 426, 808, 1484, 2798, 5167, 9700, 17974, 33656, 62498, 116826, 217236, 405646, 754938, 1408736, 2623188, 4892848, 9114036, 16995110, 31664136, 59034488, 110004243, 205068892, 382156686, 712363344, 1327600346, 2474618434
Offset: 1

Views

Author

Gus Wiseman, Sep 18 2018

Keywords

Comments

A rooted plane tree is palindromic if the sequence of branches directly under any given node is a palindrome.

Examples

			The a(7) = 20 palindromic plane trees:
  ((((((o))))))  (((((oo)))))  ((((ooo))))  (((oooo)))  ((ooooo))  (oooooo)
                 ((((o)(o))))  (((o(o)o)))  ((o(oo)o))  (o(ooo)o)
                 (((o))((o)))  ((o((o))o))  (o((oo))o)  (oo(o)oo)
                               (((o)o(o)))  ((oo)(oo))
                               (o(((o)))o)  ((o)oo(o))
                               ((o)(o)(o))  (o(o)(o)o)
		

Crossrefs

Programs

  • Mathematica
    panplane[n_]:=If[n==1,{{}},Join@@Table[Select[Tuples[panplane/@c],#==Reverse[#]&],{c,Join@@Permutations/@IntegerPartitions[n-1]}]];
    Table[Length[panplane[n]],{n,10}]
  • PARI
    PAL(p)={(1+p)/subst(1-p, x, x^2)}
    seq(n)={my(p=O(1));for(i=1, n, p=PAL(x*p)); Vec(p)} \\ Andrew Howroyd, Sep 19 2018

Formula

a(n) ~ c * d^n, where d = 1.86383559155190653688720443906758855085492625375... and c = 0.24457511051198663873739022949952908293770055... - Vaclav Kotesovec, Nov 16 2021

A056513 Number of primitive (period n) periodic palindromic structures using a maximum of two different symbols.

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 4, 7, 10, 14, 21, 31, 42, 63, 91, 123, 184, 255, 371, 511, 750, 1015, 1519, 2047, 3030, 4092, 6111, 8176, 12222, 16383, 24486, 32767, 49024, 65503, 98175, 131061, 196308, 262143, 392959, 524223, 785910, 1048575, 1572256, 2097151, 3144702, 4194162
Offset: 0

Views

Author

Keywords

Comments

For example, aaabbb is not a (finite) palindrome but it is a periodic palindrome. Permuting the symbols will not change the structure.
Number of Lyndon compositions (aperiodic necklaces of positive integers) summing to n that can be rotated to form a palindrome. - Gus Wiseman, Sep 16 2018

Examples

			From _Gus Wiseman_, Sep 16 2018: (Start)
The sequence of palindromic Lyndon compositions begins:
  (1)  (2)  (3)  (4)    (5)    (6)      (7)
                 (112)  (113)  (114)    (115)
                        (122)  (1122)   (133)
                               (11112)  (223)
                                        (11113)
                                        (11212)
                                        (11122)
(End)
		

References

  • M. R. Nester (1999). Mathematical investigations of some plant interaction designs. PhD Thesis. University of Queensland, Brisbane, Australia. [See A056391 for pdf file of Chap. 2]

Crossrefs

Programs

  • Mathematica
    (* b = A164090, c = A045674 *)
    b[n_] := (1/4)*(7 - (-1)^n)*2^((1/4)*(2*n + (-1)^n - 1));
    c[0] = 1;
    c[n_] := c[n] = If[EvenQ[n], 2^(n/2 - 1) + c[n/2], 2^((n - 1)/2)];
    a56503[n_] := If[OddQ[n], b[n]/2, (1/2)*(b[n] + c[n/2])];
    a[n_] := DivisorSum[n, MoebiusMu[#] a56503[n/#]&];
    Array[a, 45] (* Jean-François Alcover, Jun 29 2018, after Andrew Howroyd *)
  • PARI
    a(n) = {if(n < 1, n==0, sumdiv(n, d, moebius(d)*(2 + d%2)*(2^(n/d\2)))/(4 - n%2))} \\ Andrew Howroyd, Sep 26 2019
    
  • PARI
    seq(n) = Vec(1 + (1/2)*sum(k=1, n, moebius(k)*x^k*(2 + 3*x^k)/(1 - 2*x^(2*k)) - moebius(2*k)*x^(2*k)*(1 + x^(2*k))/(1 - 2*x^(4*k)) + O(x*x^n))) \\ Andrew Howroyd, Sep 27 2019

Formula

a(n) = Sum_{d|n} mu(d)*A056503(n/d) for n > 0.
a(n) = Sum_{k=1..2} A285037(n, k). - Andrew Howroyd, Apr 08 2017
G.f.: 1 + (1/2)*Sum_{k>=1} mu(k)*x^k*(2 + 3*x^k)/(1 - 2*x^(2*k)) - mu(2*k)*x^(2*k)*(1 + x^(2*k))/(1 - 2*x^(4*k)). - Andrew Howroyd, Sep 27 2019

Extensions

a(17)-a(45) from Andrew Howroyd, Apr 08 2017
a(0)=1 prepended by Andrew Howroyd, Sep 27 2019

A319437 Number of series-reduced palindromic plane trees with n nodes.

Original entry on oeis.org

1, 0, 1, 1, 1, 2, 3, 4, 7, 10, 15, 23, 35, 52, 81, 121, 185, 280, 427, 645, 985, 1490, 2269, 3440, 5233, 7936, 12071, 18313, 27839, 42256, 64217, 97490, 148137, 224924, 341725, 518923, 788321, 1197178, 1818597, 2761926, 4195381, 6371808, 9678537, 14699771
Offset: 1

Views

Author

Gus Wiseman, Sep 18 2018

Keywords

Comments

A rooted plane tree is series-reduced if every non-leaf node has at least two branches, and palindromic if the sequence of branches directly under any given node is a palindrome.

Crossrefs

Programs

  • Mathematica
    srpanplane[n_]:=If[n==1,{{}},Join@@Table[Select[Tuples[srpanplane/@c],#==Reverse[#]&],{c,Join@@Permutations/@Select[IntegerPartitions[n-1],Length[#]>1&]}]];
    Table[Length[srpanplane[n]],{n,15}]
  • PARI
    PAL(p)={(1+p)/subst(1-p, x, x^2)}
    seq(n)={my(p=O(1));for(i=1, n, p=PAL(x*p)-x*p); Vec(p)} \\ Andrew Howroyd, Sep 19 2018

Extensions

Terms a(27) and beyond from Andrew Howroyd, Sep 19 2018

A335402 Numbers m such that the only normal integer partition of m whose run-lengths are a palindrome is (1)^m.

Original entry on oeis.org

0, 1, 2, 4, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269
Offset: 1

Views

Author

Gus Wiseman, Jun 06 2020

Keywords

Comments

An integer partition is normal if it covers an initial interval of positive integers.
Conjecture: The sequence consists of 0, 1, 4, and all primes except 3.
From Chai Wah Wu, Jun 22 2020: (Start)
The above conjecture is true.
Proof: The cases of 0, 1, 4 can be checked by inspection. Next we show that if n is prime and not equal to 3, then n is a term. Let n be prime and consider a palindromic normal partition of n covering the integers 1,...,k with k > 1. Then the multiplicity of 1 and k are the same and the multiplicities of 2 and k-1 are the same, etc.
If k is even, then n is of the form (k+1)r. Since n is prime, this implies that n = k+1. Since n >= k(k+1)/2. this means that k = 2 and n = 3.
If k is odd, then n is of the form (k+1)r + w(k+1)/2. Let m = (k+1)/2, then n = m(2r+w). Since n is prime and r,w > 0, this means that m = 1, k = 1, a contradiction.
Next we show that if n is composite and not equal to 4, then n is not a term.
Suppose n = pq for 1 < p <= q. If p is odd, let k = p-1 > 1.
Consider the partition covering 1,..,k where the multiplicity is 1 except for 1 and k where the multiplicity is q-k/2 + 1 > 0. This is a normal palindromic partition summing up to pq = n.
If p is even, without loss of generality we can choose p = 2. Since n != 4, q >= 3. In this case, choosing k = 3 with 1 and 3 having multiplicity 1 and 2 having multiplicity q-2 > 0 results in a normal palindromic partition of 2q = n. QED
It is clear that if n is not a term, then any multiple of n is also not a term.
(End)

Examples

			There are 4 normal integer partitions of 10 whose sequence of multiplicities is a palindrome, namely (4321), (33211), (32221), (1111111111), so 10 does not belong to the sequence. The normal integer partitions of 7 are (3211), (2221), (22111), (211111), (1111111), none of which has palindromic multiplicities except the last, so 7 belongs to the sequence.
		

Crossrefs

Positions of 1's in A317086.
Palindromic-multiplicity partitions are counted by A317085.
Normal integer partitions are counted by A000009.
Heinz numbers of normal palindromic-multiplicity partitions are A317087.

Programs

  • Mathematica
    Select[Range[0,30],Length[Select[IntegerPartitions[#],And[Or[#=={},Union[#]==Range[First[#]]],Length/@Split[#]==Reverse[Length/@Split[#]]]&]]==1&]
  • Python
    # from definition
    from sympy.utilities.iterables import partitions
    from sympy import integer_nthroot
    A335402_list = []
    for m in range(0,101):
        for d in partitions(m,k=integer_nthroot(2*m,2)[0]):
            l = len(d)
            if l > 0 and not(l == 1 and 1 in d):
                k = max(d)
                if l == k:
                    for i in range(k//2):
                        if d[i+1] != d[k-i]:
                            break
                    else:
                        break
        else:
            A335402_list.append(m) # Chai Wah Wu, Jun 22 2020
    
  • Python
    # from formula
    from sympy import prime
    A335402_list = [0,1,2,4] + [prime(i) for i in range(3,100)] # Chai Wah Wu, Jun 22 2020

Formula

n is a term if and only if n = 0, 1, 2, 4 or a prime > 3. - Chai Wah Wu, Jun 22 2020

Extensions

a(22)-a(59) from Chai Wah Wu, Jun 22 2020
Previous Showing 11-14 of 14 results.