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: Dean D. Ballard

Dean D. Ballard's wiki page.

Dean D. Ballard has authored 8 sequences.

A382411 a(n) is the greatest possible length of a circular sequence on n symbols such that: no two adjacent symbols are the same, any group of n adjacent symbols contains at least n-1 different symbols, and all groups of n adjacent symbols within the sequence are unique.

Original entry on oeis.org

1, 2, 12, 96, 840, 7920, 80640, 887040, 10523520, 134265600, 1836172800, 26824089600, 417210393600, 6887085004800, 120306041856000, 2217815728128000, 43038178799616000, 877125197684736000, 18733345462960128000, 418459145406382080000, 9758369954796503040000, 237164153561075220480000
Offset: 1

Author

Dean D. Ballard, Mar 24 2025

Keywords

Examples

			Using symbols from the set {A, B, C} the sequence ABCACBCBABAC, when arranged in a circle, contains these 12 unique groups of three: ABC, BCA, CAC, ACB, CBC, BCB, CBA, BAB, ABA, BAC, ACA, and CAB. Each group contains at least two different symbols, no two adjacent symbols are the same, and the whole sequence contains the complete set of groups of three meeting these conditions. Hence, a(3)=12.
		

Crossrefs

Programs

Formula

a(n) = n!*(n^2 - 3*n + 4)/2.
a(n) = A000142(n) * A152947(n).

A354423 a(0)=1; a(n) is the smallest positive integer that cannot be obtained from the integers {1, ..., n} using each number at most once, and the operators addition and multiplication.

Original entry on oeis.org

1, 2, 4, 10, 22, 58, 233, 827, 3359, 16631, 114371, 708278, 3975838, 35724478
Offset: 0

Author

Dean D. Ballard, May 26 2022

Keywords

Comments

This is a simpler version of A060315, which uses all four arithmetic operations: addition, subtraction, multiplication, and division. The sequence is the answer to FiveThirtyEight.com's Riddler Express of June 3, 2022 (see links).

Examples

			a(3)=10 because 1=1, 2=2, 3=3, 4=1+3, 5=2+3, 6=2*3, 7=2*3+1, 8=(3+1)*2, 9=(1+2)*3, but there is no way to make 10 using 1, 2, and 3 at most once.
		

Crossrefs

Cf. A060315.

Programs

  • Python
    def a(n):
        R = dict()  # R[|s|-1][s] = reachable values using subset s
        for i in range(n+1): R[i] = dict()
        for i in range(1, n+1): R[0][(i,)] = {i}
        reach = set(range(1, n+1))
        for j in range(1, n):
            for i in range((j+1)//2):
                for s in R[i]:
                    for t in R[j-1-i]:
                        if set(s) & set(t) == set():
                            u = tuple(sorted(set(s) | set(t)))
                            if u not in R[len(u)-1]:
                                R[len(u)-1][u] = set()
                            for a in R[i][s]:
                                for b in R[j-1-i][t]:
                                    R[len(u)-1][u].update([a+b, a*b])
                                    reach.update([a+b, a*b])
        k = n+1
        while k in reach: k += 1
        return k
    print([a(n) for n in range(10)]) # Michael S. Branicky, May 30 2022

Formula

a(n) <= A060315(n+1). - Michael S. Branicky, Jun 04 2022

Extensions

a(10)-a(12) from Michael S. Branicky, May 27 2022
a(13) from Michael S. Branicky, May 30 2022
a(0) inserted by Michael S. Branicky, Jun 04 2022

A339271 a(n) is the smallest number k that can be partitioned into a set of n distinct positive integers {e(1), e(2), ..., e(n)} where Sum_{i=1..n} e(i)*(e(i)-1) = k*(k-1)/2.

Original entry on oeis.org

4, 13, 20, 53, 56, 92, 109, 120, 160, 200, 221, 268, 325, 389, 420, 497, 561, 616, 684, 725, 813, 901, 969, 1064, 1132, 1197, 1329, 1421, 1516, 1581, 1740, 1849, 1904, 2060, 2189, 2288, 2444, 2560, 2696, 2849, 2985, 3128, 3261, 3404, 3564, 3744, 3904, 4044, 4204, 4381, 4585, 4725
Offset: 2

Author

Dean D. Ballard, Nov 29 2020

Keywords

Comments

These numbers solve the problem of what is the required minimum number of socks of n colors such that a random drawing of two socks has a 50% chance of matching. In this version the number of socks of each color is distinct, but there may be a color with only one sock.

Examples

			For n = 3, {1, 3, 9} is the set with the smallest sum that has this property. With 1 socks of one color, 3 socks of another color, and 9 socks of a third color, there is exactly a 50% chance that a random draw of two socks will produce a matching pair. (1*0 + 3*2 + 9*8) = (13*12) / 2.
n = 2, sum = 4, set = {1, 3}
n = 3, sum = 13, set = {1, 3, 9}
n = 4, sum = 20, set = {1, 2, 3, 14}
n = 5, sum = 53, set = {1, 2, 3, 11, 36}
n = 6, sum = 56, set = {1, 2, 3, 5, 6, 39}
		

Crossrefs

Cf. other variations of the problem: A246750, A332105, A339272.

Programs

  • PARI
    \\ See 'Faster PARI Program' link in A246750 for PartsByWeight.
    a(n)={local(FC=Map()); for(k=1, oo, if(PartsByWeight(n, k-n*(n-1)/2, k*(k-1)/2, (i,v)->(i+v-1)*(i+v-2)), return(k))); oo} \\ Andrew Howroyd, Nov 30 2020

Extensions

a(16)-a(24) from Michael S. Branicky, Nov 29 2020
a(25)-a(30) from Andrew Howroyd, Nov 30 2020
a(31)-a(53) from Michael S. Branicky, Dec 03 2020

A339272 a(n) is the smallest number k that can be partitioned into a set of n positive integers {e(1), e(2), ..., e(n)} where Sum_{i=1..n} e(i)*(e(i)-1) = k*(k-1)/2.

Original entry on oeis.org

4, 13, 17, 40, 24, 21, 44, 41, 41, 57, 48, 48, 68, 65, 65, 81, 85, 72, 72, 85, 89, 89, 105, 109, 109, 96, 116, 133, 113, 113, 133, 133, 140, 140, 120, 157, 153, 137, 157, 164, 164, 164, 181, 181, 181, 181, 188, 188, 201, 188, 205, 205, 225, 212, 205, 212, 212, 229, 229, 229, 229, 249, 249, 256, 236, 236, 253, 253, 253
Offset: 2

Author

Dean D. Ballard, Nov 29 2020

Keywords

Comments

These numbers solve the problem of what is the required minimum number of socks of n colors such that a random drawing of two socks has a 50% chance of matching. In this version there may be a color with only one sock, and the number of socks of each color need not be distinct.
If the set solving a(n)=k has three 2's, then a(n+1)<=k, replacing them with one 3 and three 1's; this leads to many repeats in the data. Similar substitutions include {4, 5} for {1, 2, 6}, {3, 3, 4} for {1, 2, 2, 5}, and {3, 3} for {1, 1, 4}. - Dean D. Ballard and Michael S. Branicky, Nov 30 2020

Examples

			For n = 4, {1, 2, 2, 12} is the set with the smallest sum that has this property. With 1 sock of one color, 2 socks of a second color, 2 socks of a third color, and 12 socks of a fourth color, there is exactly a 50% chance that a random draw of two socks will produce a matching pair. (1*0 + 2*1 + 2*1 + 12*11) = (17*16) / 2.
n = 2, sum = 4, set = {1, 3}
n = 3, sum = 13, set = {1, 3, 9}
n = 4, sum = 17, set = {1, 2, 2, 12}
n = 5, sum = 40, set = {3, 3, 3, 3, 28}
n = 6, sum = 24, set = {1, 1, 1, 2, 2, 17}
		

Crossrefs

A246750, A332105, A339271 are other variations of the problem.

Programs

  • PARI
    \\ See 'Faster PARI Program' link in A246750 for PartsByWeight.
    a(n)={local(FC=Map()); for(k=1, oo, if(PartsByWeight(n, k, k*(k-1)/2, (i,v)->v*(v-1)), return(k))); oo} \\ Andrew Howroyd, Nov 30 2020

Extensions

a(26)-a(70) from Andrew Howroyd, Nov 30 2020

A246750 a(n) is the smallest number k that can be partitioned into a set of n distinct integers {e(1), e(2), ..., e(n)} where all e(i) >= 2 and the sum of e(i)*(e(i)-1) for i = 1 to n equals k*(k-1)/2.

Original entry on oeis.org

9, 28, 41, 65, 85, 96, 149, 176, 200, 244, 281, 332, 389, 400, 497, 565, 609, 657, 745, 833, 884, 989, 1060, 1132, 1217, 1312, 1441, 1536, 1621, 1740, 1832, 1961, 2080, 2189, 2308, 2424, 2533, 2669, 2832, 2948, 3128, 3244, 3441, 3557, 3717, 3901, 4064, 4204, 4408
Offset: 2

Author

Dean D. Ballard, Nov 20 2020

Keywords

Comments

These numbers solve the problem of what is the required minimum number of socks of n colors such that a random drawing of two socks has a 50% chance of matching.

Examples

			For n = 3, {3, 6, 19} is the set with the smallest sum that has this property. With 3 socks of one color, 6 socks of another color, and 19 socks of a third color, there is exactly a 50% chance that a random draw of two socks will produce a matching pair. (3*2 + 6*5 + 19*18) = (28*27) / 2.
n = 2, sum = 9, set = {3, 6}
n = 3, sum = 28, set = {3, 6, 19}
n = 4, sum = 41, set = {2, 3, 8, 28}
n = 5, sum = 65, set = {2, 4, 6, 8, 45}
n = 6, sum = 85, set = {2, 3, 5, 6, 10, 59}
		

Crossrefs

Cf. A332105.

Programs

  • PARI
    \\ See Links for a faster program.
    a(n)={for(k=(n+1)*(n+2)/2-1, oo, my(t=k*(k-1)/2); forpart(p=k-n*(n+1)/2, if(sum(i=1, n, (p[i]+i)*(p[i]+i-1))==t, return(k)), , [n,n]))} \\ Andrew Howroyd, Nov 20 2020

Extensions

a(13)-a(50) from Andrew Howroyd, Nov 22 2020

A332105 a(n) is the smallest number k that can be partitioned into a set of n distinct positive even integers {e(1), e(2), ..., e(n)} where the sum of e(i)*(e(i)-1) for i = 1 to n equals k*(k-1)/2.

Original entry on oeis.org

16, 144, 80, 96, 160, 208, 256, 304, 384, 432, 544, 608, 720, 816, 832, 1040, 1168, 1264, 1360, 1568, 1664, 1808, 1984, 2080, 2256, 2480, 2704, 2800, 3104, 3248, 3520, 3744, 3968, 4112, 4464, 4688, 4880, 5200, 5472, 5744, 6016, 6336, 6608, 6800, 7248, 7568, 7888, 8080, 8528
Offset: 2

Author

Dean D. Ballard, Nov 20 2020

Keywords

Comments

These numbers solve the problem of what is the required minimum even number of socks of n colors such that a random drawing of two socks has a 50% chance of matching.

Examples

			For n = 3, {6, 48, 90} is the set of even numbers with the smallest sum that has this property. With 6 socks of one color, 48 socks of another color, and 90 socks of a third color, there is exactly a 50% chance that a random draw of two socks will produce a matching pair. (6*5 + 48*47 + 90*89) = (144*143) / 2.
n = 2, sum = 16, set = {6, 10}
n = 3, sum = 144, set = {6, 48, 90}
n = 4, sum = 80, set = {2, 8, 16, 54}
n = 5, sum = 96, set = {2, 6, 8, 14, 66}
n = 6, sum = 160, set = {2, 6, 8, 10, 24, 110}
		

Crossrefs

Cf. A246750.

Programs

  • PARI
    \\ See Links in A246750 for a faster program.
    a(n)={for(k=n*(n+1)/2, oo, my(t=k*(4*k-1)); forpart(p=2*k-n*(n-1)/2, if(sum(i=1, n, (p[i]+i-1)*(2*(p[i]+i-1)-1))==t, return(4*k)), ,[n,n]))} \\ Andrew Howroyd, Nov 21 2020

Extensions

a(16)-a(50) from Andrew Howroyd, Nov 22 2020

A330431 a(n) is the smallest k such that {1^2, 2^2, 3^2, ..., k^2} can be partitioned into n sets of equal sums.

Original entry on oeis.org

1, 7, 13, 15, 19, 31, 27, 32, 53, 39, 43, 63, 52, 55
Offset: 1

Author

Dean D. Ballard, Jun 08 2020

Keywords

Examples

			For n = 1 the set is {1}
For n = 2 the sets are {1,2,4,7}, {3,5,6}.
For n = 3 the sets are {2,10,13}, {4,7,8,12}, {1,3,5,6,9,11}.
For n = 4 the sets are {2,9,15}, {1,7,8,14}, {4,5,10,13}, {3,6,11,12}.
For n = 5 the sets are {4,6,9,19}, {1,13,18}, {3,14,17}, {2,7,8,11,16}, {5,10,12,15}.
For n = 6 the sets are {1,3,6,27,31}, {4,12,26,30}, {5,7,14,25,29}, {2,8,20,22,28}, {9,13,15,18,19,24}, {10,11,16,17,21,23}.
		

Crossrefs

Extensions

a(12) from Giovanni Resta, Jun 08 2020
a(13)-a(14) from Dean D. Ballard, Jun 12 2020

A330212 a(n) is the smallest k such that {1^3, 2^3, 3^3, ..., k^3} can be partitioned into n sets of equal sums.

Original entry on oeis.org

1, 12, 23, 24, 24, 35, 41, 47, 53, 59, 65, 63
Offset: 1

Author

Dean D. Ballard, Jun 08 2020

Keywords

Examples

			For n = 1 the set is {1}.
For n = 2 the sets are {1,2,4,8,9,12}, {3,5,6,7,10,11}.
For n = 3, the sets are {2,5,9,11,14,15,17,23}, {1,4,7,8,12,16,20,22}, {3,6,10,13,18,19,21}.
For n = 4, the sets are (all 3 of them):
{1,2,3,4,14,18,24}, {7,9,21,23}, {8,10,11,16,17,22}, {5,6,12,13,15,19,20}
OR
{1,8,10,11,18,24}, {7,9,21,23}, {2,3,4,14,16,17,22}, {5,6,12,13,15,19,20}
OR
{1,2,3,4,14,18,24}, {7,9,21,23}, {5,6,8,11,13,15,16,22}, {10,12,17,19,20}.
For n = 5 the sets are {2,4,9,15,24}, {1,18,23}, {8,14,16,22}, {3,5,12,19,21}, {6,7,10,11,13,17,20}.
For n = 6 the sets are {4,11,13,27,35}, {9,12,29,34}, {1,5,7,14,30,33}, {6,15,31,32}, {2,3,8,10,19,20,23,25,28}, {16,17,18,21,22,24,26}.
		

Crossrefs

Extensions

a(11)-a(12) from Jork Loeser, Jun 27 2020