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.

User: Tony Bartoletti

Tony Bartoletti's wiki page.

Tony Bartoletti has authored 12 sequences. Here are the ten most recent ones:

A351299 a(n) is the number of distinct bipartitions of a solid triangular array of edge n, discounting inversions, reflections, and rotations.

Original entry on oeis.org

1, 2, 13, 128, 2864
Offset: 1

Author

Tony Bartoletti, Feb 06 2022

Keywords

Comments

Determined by exhaustive enumeration and testing. (Related to A061348 but discounting inversions.)
Discounting inversions allows only one of these two to be counted:
1 0
0 0 1 1
Related to A061348 (number of distinct binary labels of a solid triangular array of edge n, discounting reflections and rotations) except that inversions (swapping 0's and 1's) are also discounted.
Note that since the triangular numbers T(n) exhibit the odd/even pattern o o e e o o e e and only the odd triangular numbers are unable to support a 50/50 binary labeling, this sequence is A061348(n)/2 only for odd T(n), i.e., where floor((n-1)/2) is even.

Examples

			For n = 2, the a(2)=2 solutions are
    0     1
   0 0   0 0
		

Crossrefs

Cf. A061348.

Formula

a(n) = A061348(n)/2 where floor((n-1)/2) is even.

A249796 Triangle T(n,k), n>=3, 3<=k<=n, read by rows. Number of ways to make n selections without replacement from a circular array of n unlabeled cells (ignoring rotations and reflection), such that the first selection of a cell adjacent to previously selected cells occurs on the k-th selection.

Original entry on oeis.org

1, 1, 2, 2, 6, 4, 6, 18, 28, 8, 24, 72, 128, 120, 16, 120, 360, 672, 840, 496, 32, 720, 2160, 4128, 5760, 5312, 2016, 64, 5040, 15120, 29280, 43200, 47616, 32928, 8128, 128, 40320, 120960, 236160, 360000, 435264, 387072, 201728, 32640, 256, 362880, 1088640, 2136960, 3326400, 4249920, 4314240, 3121152, 1226880, 130816, 512
Offset: 1

Author

Tony Bartoletti, Nov 05 2014

Keywords

Comments

With m=n+3, T(m,3) = n!, T(m,m) = 2^n (easy proofs), and T(m,m-1) = A006516(n) = 2^(n-1) * (2^n - 1). Remaining supplied elements generated by exhaustive examination of permutations.

Examples

			T(3,3) = 1 since, given any permutation of <1,2,3>, the third element will be the first to be adjacent to previous elements (modulo 3), and these 6 permutations are indistinguishable given rotations and reflection. Sample table (left-justified):
.....1
.....1........2
.....2........6........4
.....6.......18.......28........8
....24.......72......128......120.......16
...120......360......672......840......496.......32
...720.....2160.....4128.....5760.....5312.....2016.......64
..5040....15120....29280....43200....47616....32928.....8128......128
.40320...120960...236160...360000...435264...387072...201728....32640......256
362880..1088640..2136960..3326400..4249920..4314240..3121152..1226880...130816......512
		

Programs

  • Sage
    # Counting by exhaustive examination after a C program by Bartoletti.
    def A249796_row(n):
        def F(p, n):
            for k in range(2, n):
                a = mod(p[k] + 1, n)
                b = mod(p[k] - 1, n)
                fa, fb = false, false
                for i in range(k):
                    if a == p[i] : fa = true
                    if b == p[i] : fb = true
                if fa and fb:
                   counts[k] += 1
                   return
        counts = [0]*n
        for p in Permutations(n):
            F(p, n)
        for k in range(2, n):
            counts[k] = counts[k] / (2*n)
        return counts
    for n in range(9): A249796_row(n) # Peter Luschny, Nov 11 2014

A186783 Diameter of the symmetric group S_n when generated by the transposition (1,2) and both left and right rotations by (1,2,...,n).

Original entry on oeis.org

0, 1, 2, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78
Offset: 1

Author

Tony Bartoletti, Feb 26 2011

Keywords

Comments

Given an ordered sequence of n elements (1,2,3,...,n), let X represent the permutation that transposes the first two elements, X(1,2,3,...,n) = (2,1,3,...,n), let L be the "left rotation" of the sequence, L(1,2,3,...,n) = (2,3,...,n,1), and let R be the "right rotation", R(1,2,3,...,n) = (n,1,2,...,n-1). Then every permutation of (1,2,3,...,n) can be expressed as a composition of the permutations X, L and R. One can exhaustively generate such compositions by taking L="0", X="1", R="2", and considering, in turn, base 3 numbers of increasing length (padded with leading zeros). Note that any base 3 number containing the subsequence "11", "02" or "20" may be discarded.
Note also that by defining the distance between any two permutations p and q in S_n, dist(p,q), to be the length of the minimal composition of LXR transforming p into q, we have dist(p,q) = dist(q,p), owing to L and R being mutually inverse, and X being self-inverse.
Conjecture from Chervov et. al., section 4.2: The longest and unique element of S_n is (1,2)(n,3)(n-1,4)(n-2,5)... = (2,1,n,n-1,n-2,...,3). The conjecture holds for n <= 13. - Dmitry Kamenetsky, Jun 22 2025

Examples

			The diameter of S_5 is 10, given this set of generators, since there is no sequence shorter than 0010010121 (i.e., LLXLLXLXRX) that will transform (1,2,3,4,5) into (2,1,5,4,3), and there is no permutation of (1,2,3,4,5) that requires more than a length-10 composition of L, X and R. Thus a(5) = 10.
		

Crossrefs

Programs

  • Mathematica
    a[1] = 0; a[n_] := GraphDiameter[CayleyGraph[PermutationGroup[{Cycles[{{1, 2}}], Cycles[{Range[n]}], InversePermutation[Cycles[{Range[n]}]]}]]]; (* Ben Whitmore, Jan 09 2018 *)
  • Sage
    def a(n): return PermutationGroup([[(1, 2)], [tuple(1..n)], PermutationGroupElement([tuple(1..n)])^(-1)]).cayley_graph().diameter() # Max Alekseyev, Sep 09 2011

Formula

Conjecture: a(n) = - Sum_{k=1..n-1} Stirling1(n+k-1, (n-1)*k). This formula holds for all known n. - Arkadiusz Wesolowski, Mar 30 2013. For n>3, this formula contains only one nonzero term (for k=1) and reduces to the formula n*(n-1)/2 conjectured below. - Max Alekseyev, Sep 10 2020
Conjecture: a(n) = n*(n-1)/2 for all n>3. - Per W. Alexandersson, Aug 25 2020
Conjectures from Colin Barker, Aug 26 2020: (Start)
G.f.: x^2*(1 - x + 3*x^2 - 3*x^3 + x^4) / (1 - x)^3.
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3).
(End)

Extensions

a(8)=28 added by Tony Bartoletti, Mar 12 2011
a(9)=36 added by R. H. Hardin, Sep 09 2011
a(10)=45 added by Sharon Li, Mar 09 2013
a(11)=55 and a(12)=66 added by James Bieron, Mar 15 2013
a(13)=78 added by Ben Whitmore, Jan 09 2018

A186752 Length of minimum representation of the permutation [n,n-1,...,1] as the product of transpositions (1,2) and left and right rotations (1,2,...,n).

Original entry on oeis.org

0, 1, 2, 4, 8, 13, 19, 26, 34, 43, 53, 64, 76
Offset: 1

Author

Tony Bartoletti, Feb 26 2011

Keywords

Comments

Example: Taking "0" to indicate the "left" rotation (1,2,...,n) -> (2,3,...,n,1), "1" to represent the transposition (1,2), and "2" to indicate the "right" rotation (1,2,...,n) -> (n,1,2,...n-1), the sequence 10010121 (length = 8) is a minimal sequence producing the reverse permutation on S_5.
It was suggested that a(10) = 61, but this cannot be correct. It would conflict with A186783(10)=45, the diameter of the set under these same operations. We must have a(n) <= A186783(n) for all n. - Tony Bartoletti, Mar 08 2019
Conjecture: for n>=4, a(n)=A186783(n)-2. Conjecture holds for n<=13. - Dmitry Kamenetsky, Jun 15 2025

Crossrefs

Cf. A378834 (number of ways), A048200 (LE reversal distance).

Programs

  • Sage
    def a186752(n): t = tuple(1..n); G = PermutationGroup([[(1, 2)], [t], PermutationGroupElement([t])^(-1)]); return G.cayley_graph().distance(G.one(),G(list(t)[::-1])) # Max Alekseyev, Sep 09 2011

Extensions

a(9) from Max Alekseyev, Sep 09 2011
Incorrect value for a(10) deleted by N. J. A. Sloane, Mar 09 2019
a(10) and a(11) added by Sai Satwik Kuppili and Bhadrachalam Chitturi, Mar 28 2019
a(12) and a(13) from Kevin Ryde, Dec 12 2024

A186144 Number of elements in the symmetric group S_n whose distance from a fixed element is the group diameter under compositions of (1,2) and (1,2,...,n).

Original entry on oeis.org

1, 1, 3, 3, 2, 1, 2, 1, 2, 1, 2, 1, 2
Offset: 1

Author

Tony Bartoletti, Feb 23 2011

Keywords

Comments

a(n) is the number of elements in the symmetric group S_n that are maximally distant from any fixed element, where distance is taken to be the minimal sequence of operations composed from transposition (1,2) and rotation (1,2,...,n) producing one element from another. This maximal distance is the diameter of S_n under the stated compositions, given by A039745(n).
From Ben Whitmore, Nov 14 2020: (Start)
Conjecture (verified up to n = 13): Consider the a(n) permutations that take A039745(n) steps to reach the identity. For odd n>5, we have a(n) = 2 and the actions of these permutations on the list [1, 2, ..., n] are
[2, 1, (n+3)/2, n, n-1, ..., (n+5)/2, (n+1)/2, (n-1)/2, ..., 4, 3],
[2, 1, n-1, n-2, ..., (n+3)/2, n, (n+1)/2, (n-1)/2, ..., 4, 3],
and for even n>5, we have a(n) = 1 and the action of the permutation is
[2, n, 1, n-1, n-2, ..., 4, 3].
(End)

Crossrefs

Formula

Conjecture: For n>4, a(n) = 1 if n is even, a(n) = 2 if n is odd. - Ben Whitmore, Nov 14 2020

Extensions

a(10)-a(13) by Ben Whitmore, Nov 14 2020

A185378 Number of binary necklaces of 2n beads that are identical when turned over yet cannot be cut to produce a palindrome.

Original entry on oeis.org

1, 3, 6, 15, 28, 62, 120, 255, 496, 1020, 2016, 4094, 8128, 16376
Offset: 1

Author

Tony Bartoletti, Feb 20 2011

Keywords

Comments

These necklaces have bilateral symmetry across axes that involve only vertices. a(n) = A029744(2n) - A185333(2n). Conjecture: a(n) = 2^n - 2^((n - 2^t)/(2^(t+1))), where t = number of factors of 2 in n.

A185333 Number of binary necklaces of n beads for which a cut exists producing a palindrome.

Original entry on oeis.org

2, 2, 4, 3, 8, 6, 16, 9, 32, 20, 64, 34, 128, 72, 256, 129, 512, 272, 1024, 516, 2048, 1056, 4096, 2050, 8192, 4160, 16384, 8200, 32768, 16512, 65536, 32769, 131072, 65792, 262144, 131088, 524288, 262656, 1048576, 524292, 2097152
Offset: 1

Author

Tony Bartoletti, Feb 20 2011

Keywords

Comments

For odd n, this corresponds to A029744, necklaces of n beads that are the same when turned over. For even n, consider the necklace "01", which satisfies A029744 but cannot be cut to produce a palindrome.

Crossrefs

Cf. A185376, A025480. - Hugo Pfoertner, Jul 30 2011

Programs

  • Mathematica
    f[n_] := If[OddQ@ n, 2^(n/2 + 1/2), Block[{k = IntegerExponent[n, 2] - 1}, 2^(n/2 - 1) + 2^((n/2 - 2^k)/(2^(k + 1)))]]; Array[f, 41] (* Robert G. Wilson v, Aug 08 2011 *)
  • Python
    def a(n):
        if n%2: return 2**((n + 1)//2)
        k=bin(n - 1)[2:].count('1') - bin(n)[2:].count('1')
        return 2**(n//2 - 1) + 2**((n//2 - 2**k)//(2**(k + 1)))
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 29 2017

A185376 Number of binary necklaces of 2n beads for which a cut exists producing a palindrome.

Original entry on oeis.org

2, 3, 6, 9, 20, 34, 72, 129, 272, 516, 1056, 2050, 4160, 8200, 16512, 32769, 65792, 131088, 262656, 524292, 1049600, 2097184, 4196352, 8388610, 16781312, 33554496, 67117056, 134217736, 268451840, 536871040, 1073774592, 2147483649
Offset: 1

Author

Tony Bartoletti, Feb 20 2011

Keywords

Comments

These are the values of A185333 for even n.
Conjecture: a(n) = 2^(n-1) + 2^((n-2^t)/(2^(t+1))), where t = number of factors of 2 in n.

Crossrefs

Cf. A185333.

Programs

  • Mathematica
    f[n_] := Block[{k = IntegerExponent[n, 2]}, 2^n/2 + 2^((n - 2^k)/(2^(k + 1)))]; Array[f, 32] (* Robert G. Wilson v, Aug 08 2011 *)
  • Python
    def a185333(n):
        if n%2: return 2**((n + 1)//2)
        k=bin(n - 1)[2:].count('1') - bin(n)[2:].count('1')
        return 2**(n//2 - 1) + 2**((n//2 - 2**k)//(2**(k + 1)))
    def a(n): return a185333(2*n)
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 29 2017, after the formula

Formula

a(n) = A185333(2n).

A048249 Number of distinct values produced from sums and products of n unity arguments.

Original entry on oeis.org

1, 2, 3, 4, 6, 9, 11, 17, 23, 30, 44, 60, 80, 114, 156, 212, 296, 404, 556, 770, 1065, 1463, 2032, 2795, 3889, 5364, 7422, 10300, 14229, 19722, 27391, 37892, 52599, 73075, 101301, 140588, 195405, 271024, 376608, 523518, 726812, 1010576, 1405013, 1952498
Offset: 1

Keywords

Comments

Values listed calculated by exhaustive search algorithm.
For n+1 operands (n operations) there are (2n)!/((n!)((n+1)!)) possible postfix forms over a single operator. For each such form, there are 2^n ways to assign 2 operators (here, sum and product). Calculate results and eliminate duplicates.
Number of distinct positive integers that can be obtained by iteratively adding or multiplying together parts of an integer partition until only one part remains, starting with 1^n. - Gus Wiseman, Sep 29 2018

Examples

			a(3)=3 since (in postfix): 111** = 11*1* = 1, 111*+ = 11*1+ = 111+* = 11+1* = 2 and 111++ = 11+1+ = 3. Note that at n=7, the 11 possible values produced are the set {1,2,3,4,5,6,7,8,9,10,12}. This is the first n for which there are "skipped" values in the set.
		

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=1, {1}, {seq(seq(seq(
         [f+g, f*g][], g=b(n-i)), f=b(i)), i=1..iquo(n, 2))})
        end:
    a:= n-> nops(b(n)):
    seq(a(n), n=1..35);  # Alois P. Heinz, May 05 2019
  • Mathematica
    ReplaceListRepeated[forms_,rerules_]:=Union[Flatten[FixedPointList[Function[pre,Union[Flatten[ReplaceList[#,rerules]&/@pre,1]]],forms],1]];
    Table[Length[Select[ReplaceListRepeated[{Array[1&,n]},{{foe___,x_,mie___,y_,afe___}:>Sort[Append[{foe,mie,afe},x+y]],{foe___,x_,mie___,y_,afe___}:>Sort[Append[{foe,mie,afe},x*y]]}],Length[#]==1&]],{n,10}] (* Gus Wiseman, Sep 29 2018 *)
  • Python
    from functools import cache
    @cache
    def f(m):
        if m == 1: return {1}
        out = set()
        for j in range(1, m//2+1):
            for x in f(j):
                for y in f(m-j):
                    out.update([x + y, x * y])
        return out
    def a(n): return len(f(n))
    print([a(n) for n in range(1, 40)]) # Michael S. Branicky, Aug 03 2022

Formula

Equals partial sum of "number of numbers of complexity n" (A005421). - Jonathan Vos Post, Apr 07 2006

Extensions

More terms from David W. Wilson, Oct 10 2001
a(43)-a(44) from Alois P. Heinz, May 05 2019

A048211 Number of distinct resistances that can be produced from a circuit of n equal resistors using only series and parallel combinations.

Original entry on oeis.org

1, 2, 4, 9, 22, 53, 131, 337, 869, 2213, 5691, 14517, 37017, 93731, 237465, 601093, 1519815, 3842575, 9720769, 24599577, 62283535, 157807915, 400094029, 1014905643, 2576046289, 6541989261, 16621908599, 42251728111, 107445714789, 273335703079
Offset: 1

Keywords

Comments

Found by exhaustive search. Program produces all values that are combinations of two binary operators a() and b() (here "sum" and "reciprocal sum of reciprocals") over n occurrences of 1. E.g., given 4 occurrences of 1, the code forms all allowable postfix forms, such as 1 1 1 1 a a a and 1 1 b 1 1 a b, etc. Each resulting form is then evaluated according to the definitions for a and b.
Each resistance that can be constructed from n 1-ohm resistors in a circuit can be written as the ratio of two positive integers, neither of which exceeds the (n+1)st Fibonacci number. E.g., for n=4, the 9 resistances that can be constructed can be written as 1/4, 2/5, 3/5, 3/4, 1/1, 4/3, 5/3, 5/2, 4/1 using no numerator or denominator larger than Fib(n+1) = Fib(5) = 5. If a resistance x can be constructed from n 1-ohm resistors, then a resistance 1/x can also be constructed from n 1-ohm resistors. - Jon E. Schoenfield, Aug 06 2006
The fractions in the comment above are a superset of the fractions occurring here, corresponding to the upper bound A176500. - Joerg Arndt, Mar 07 2015
The terms of this sequence consider only series and parallel combinations; A174283 considers bridge combinations as well. - Jon E. Schoenfield, Sep 02 2013

Examples

			a(2) = 2 since given two 1-ohm resistors, a series circuit yields 2 ohms, while a parallel circuit yields 1/2 ohms.
		

Crossrefs

Let T(x, n) = 1 if x can be constructed with n 1-ohm resistors in a circuit, 0 otherwise. Then A048211 is t(n) = sum(T(x, n)) for all x (x is necessarily rational). Let H(x, n) = 1 if T(x, n) = 1 and T(x, k) = 0 for all k < n, 0 otherwise. Then A051389 is h(n) = sum(H(x, n)) for all x (x is necessarily rational).
Cf. A180414.

Programs

  • Maple
    r:= proc(n) option remember; `if`(n=1, {1}, {seq(seq(seq(
          [f+g, 1/(1/f+1/g)][], g in r(n-i)), f in r(i)), i=1..n/2)})
        end:
    a:= n-> nops(r(n)):
    seq(a(n), n=1..15);  # Alois P. Heinz, Apr 02 2015
  • Mathematica
    r[n_] := r[n] = If[n == 1, {1}, Union @ Flatten @ {Table[ Table[ Table[ {f+g, 1/(1/f+1/g)}, {g, r[n-i]}], {f, r[i]}], {i, 1, n/2}]}]; a[n_] := Length[r[n]]; Table[a[n], {n, 1, 15}] (* Jean-François Alcover, May 28 2015, after Alois P. Heinz *)
  • PARI
    \\ not efficient; just to show the method
    N=10;
    L=vector(N);  L[1]=[1];
    { for (n=2, N,
        my( T = Set( [] ) );
        for (k=1, n\2,
            for (j=1, #L[k],
                my( r1 = L[k][j] );
                for (i=1, #L[n-k],
                    my( r2 = L[n-k][i] );
                    T = setunion(T,  Set([r1+r2, r1*r2/(r1+r2) ]) );
                );
            );
        );
        T = vecsort(Vec(T), , 8);
        L[n] = T;
    ); }
    for(n=1, N, print1(#L[n], ", ") );
    \\ Joerg Arndt, Mar 07 2015

Formula

From Bill McEachen, Jun 08 2024: (Start)
(2.414^n)/4 < a(n) < (1-1/n)*(0.318)*(2.618^n) (Khan, n>3).
Conjecture: a(n) ~ K * a(n-1), K approx 2.54. (End)

Extensions

More terms from John W. Layman, Apr 06 2002
a(16)-a(21) from Jon E. Schoenfield, Aug 06 2006
a(22) from Jon E. Schoenfield, Aug 28 2006
a(23) from Jon E. Schoenfield, Apr 18 2010
Definition edited (to specify that the sequence considers only series and parallel combinations) by Jon E. Schoenfield, Sep 02 2013
a(24)-a(25) from Antoine Mathys, Apr 02 2015
a(26)-a(27) from Johannes P. Reichart, Nov 24 2018
a(28)-a(30) from Antoine Mathys, Dec 08 2024