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

A380376 Numbers k such that A341721(k)/k (proportion of supporters needed to win an election when there are k voters) sets a new minimum.

Original entry on oeis.org

1, 3, 5, 7, 9, 15, 21, 25, 35, 45, 49, 63, 77, 81, 91, 99, 117, 121, 135, 143, 165, 169, 187, 195, 209, 221, 225, 247, 255, 273, 285, 289, 315, 323, 345, 357, 361, 391, 399, 425, 437, 441, 475, 483, 513, 525, 529, 567, 575, 609, 621, 625, 651, 667, 675, 713
Offset: 1

Views

Author

Pontus von Brömssen, Jan 24 2025

Keywords

Comments

See A341721 for the rules of the election.

Crossrefs

A380377 Minimum number of total votes needed for one party to win if there are n voters divided into balanced districts, i.e., the numbers of voters in two districts may differ by at most 1.

Original entry on oeis.org

1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 11, 12, 12, 12, 12, 12, 12, 13, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 17, 18, 18, 18, 18, 18, 18, 18, 19, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 22
Offset: 1

Views

Author

Pontus von Brömssen, Jan 24 2025

Keywords

Comments

The rules are the same as in A341721 (except that the number of voters in two districts may differ by 1 here): The winner must have a strict majority of the votes in a strictly larger number of districts than the other party has.
Empirically, it seems that the limit of (a(n)-n/4)/sqrt(n) exists with an approximate value of 0.3538.

Examples

			For n = 9, a(9) = 4 votes are required to win. There can be either 3 districts 3+3+3 with 2 supporters in 2 of them, 6 districts 1+1+1+2+2+2 with 3 supporters in the single-voter districts and 1 in a 2-voter district, or 7 districts 1+1+1+1+1+2+2 with supporters in 4 of the single-voter districts.
For n = 17, a(17) = 6 votes are required to win. This can only be achieved with 5 districts 3+3+3+4+4 with 2 supporters in each of the 3 smaller districts.
		

Crossrefs

Formula

a(n) <= A341721(n).
a(n) = a(n-1)+1 if n is in A380379, otherwise a(n) = a(n-1).
a(n) = A380378(n,A380381(n)) = A380378(n,A380382(n)).

A341319 Minimum number of cells needed in an n X n grid to win a majority of districts when all districts are required to be the same size.

Original entry on oeis.org

1, 3, 4, 9, 9, 14, 16, 25, 25, 33, 36, 45, 49, 60, 64, 81, 81, 95, 100, 117, 121, 138, 144, 165, 169, 189, 196, 225, 225, 247, 256, 289, 289, 315, 324, 350, 361, 390, 400, 429, 441, 473, 484, 529, 529, 564, 576, 625, 625, 663, 676, 729, 729, 770, 784, 825, 841, 885, 900, 943
Offset: 1

Views

Author

Sean Chorney, Feb 08 2021

Keywords

Comments

Consider an n X n grid in which each cell represents a vote for a political party "A" or "B". The grid is divided into equal-sized districts and the winner of each district is decided by a majority of "A"s or "B"s. This sequence is the minimum number of "A"s needed to win more districts than "B" if n = 1, 2, 3, ... A tie within a district is not accepted. For example, if n=5, and the district size is also 5, party "A" needs 3 cells in 3 districts (total = 3*3=9) to win 3 districts to 2.
This is related to the gerrymandering question. - N. J. A. Sloane, Feb 27 2021

Examples

			For a(3), divisors of 3^2 are 1, 3, 9:
  d=1: (floor(1/2)+1)*(floor(3^2/(2*1))+1) = 1*5 = 5
  d=3: (floor(3/2)+1)*(floor(3^2/(2*3))+1) = 2*2 = 4
  d=9: (floor(9/2)+1)*(floor(3^2/(2*9))+1) = 5*1 = 5
Party A only needs 4 cells out of 9 to win a majority of districts.
For a(6), divisors of 6^2 are 1, 2, 3, 4, 6, 9, 12, 18, 36:
By symmetry we can ignore d = 9, 12, 18 and 36;
  d=1: (floor(1/2)+1)*(floor(6^2/(2*1))+1) = 1*19 = 19
  d=2: (floor(2/2)+1)*(floor(6^2/(2*2))+1) = 2*10 = 20
  d=3: (floor(3/2)+1)*(floor(6^2/(2*3))+1) = 2*7  = 14
  d=4: (floor(4/2)+1)*(floor(6^2/(2*4))+1) = 3*5  = 15
  d=6: (floor(6/2)+1)*(floor(6^2/(2*6))+1) = 4*4  = 16
Party A only needs 14 cells out of 36 to win a majority of districts.
		

Crossrefs

Cf. A341578 (ties are allowed), A002265(n+6) (US Electoral College system: unequal sizes of districts, winner in each district takes all its votes), A290323 (multiple levels).
See A341721 for a case where the number of voters need not be a square.

Programs

  • Maple
    a:= n->min(map(d->(iquo(d, 2)+1)*(iquo(n^2, 2*d)+1), numtheory[divisors](n^2))):
    seq(a(n), n=1..60);  # Alois P. Heinz, Feb 09 2021
  • Mathematica
    a[n_] := Table[(Floor[d/2]+1)*(Floor[n^2/(2d)]+1), {d, Divisors[n^2]}] // Min;
    Table[a[n], {n, 1, 60}] (* Jean-François Alcover, Apr 04 2023 *)
  • PARI
    a(n)={vecmin([(floor(d/2) + 1)*(floor(n^2/(2*d)) + 1) | d<-divisors(n^2)])} \\ Andrew Howroyd, Feb 09 2021
    
  • Python
    from sympy import divisors
    def A341319(n): return min((d//2+1)*(e//2+1) for d,e in ((v,n**2//v) for v in divisors(n**2) if v <= n)) # Chai Wah Wu, Mar 05 2021

Formula

a(n) is the minimum value of (floor(d/2)+1)*(floor(n^2/(2*d))+1) over all divisors d of n^2.

Extensions

Terms a(29) and beyond from Andrew Howroyd, Feb 09 2021

A341578 a(n) is the minimum number of total votes needed for one party to win if there are n^2 voters divided into equal districts.

Original entry on oeis.org

1, 3, 4, 8, 9, 14, 16, 24, 25, 33, 36, 45, 49, 60, 64, 80, 81, 95, 100, 117, 121, 138, 144, 165, 169, 189, 196, 224, 225, 247, 256, 288, 289, 315, 324, 350, 361, 390, 400, 429, 441, 473, 484, 528, 529, 564, 576, 624, 625, 663, 676, 728, 729, 770, 784, 825, 841, 885, 900, 943
Offset: 1

Views

Author

Sean Chorney, Feb 14 2021

Keywords

Comments

Comments from Jack W Grahl and Andrew Weimholt, Feb 26 2021: (Start):
This is a two-party election. The size d of each district must divide n^2, so there are n^2/d equal districts.
The districts are winner-takes-all, and tied districts go to neither candidate. For an even number of districts, it is enough to win half the districts and tie in one further district.
So for 5 districts of 5 votes each, one party could win with 3 votes in each of 3 districts, and 0 in all other districts, for a total of a(5) = 9 votes.
For 8 districts of size 8, 5 votes in each of 4 districts and 4 votes in a fifth district are enough, for a total of a(8) = 24 votes.
d need not equal n. For n=6, it is better to gerrymander the 36 votes into 3 districts with 12 votes each, and then a(6) = 14 = 7+7+0 votes are enough to win. (End)
This is related to the gerrymandering question. What is the asymptotic behavior of a(n)? - N. J. A. Sloane, Feb 20 2021. Answer from Don Reble, Feb 26 2020: The lower bound is [(n^2+1)/4 + n/2]; the upper bound is [n^2/4 + n]. Each bound is reached infinitely often. In general the best choice for d is not unique, since d and n/d give the same answer.

Examples

			For a(2), divisors of 2^2 are 1, 2, 4:
d=1: (floor(1/2)+1)*(floor(2^2/(2*1))+1) = 1*3 = 3
d=3: (floor(2/2)+1)*(floor(2^2/(2*2))+1) = 2*2 = 4
d=9: (floor(4/2)+1)*(floor(2^2/(2*4))+1) = 3*1 = 3
OR
since n is even, ((2/2)+1)^2-1=3
Party A only needs 3 cells out of 4 to win a majority of districts.
For a(6), divisors of 6^2 are 1, 2, 3, 4, 6, 9, 12, 18, 36:
By symmetry we can ignore d = 9, 12, 18 and 36;
d=1: (floor(1/2)+1)*(floor(6^2/(2*1))+1) = 1*19 = 19
d=2: (floor(2/2)+1)*(floor(6^2/(2*2))+1) = 2*10 = 20
d=3: (floor(3/2)+1)*(floor(6^2/(2*3))+1) = 2*7  = 14
d=4: (floor(4/2)+1)*(floor(6^2/(2*4))+1) = 3*5  = 15
d=6: (floor(6/2)+1)*(floor(6^2/(2*6))+1) = 4*4  = 16
OR
since n is even, ((6/2)+1)^2-1=15
Party A only needs 14 cells out of 36 to win a majority of districts.
		

Crossrefs

See A341721 for an analog where there are n voters, not n^2.
See A341319 for a variant.
See also A290323.

Programs

  • Mathematica
    Table[Min[Table[(Floor[d/2]+1)*(Floor[n^2/(2*d)]+1),{d,Divisors[n^2]}],If[EvenQ[n],(n/2+1)^2-1,Infinity]],{n,60}](* Stefano Spezia, Feb 15 2021 *)
  • Python
    from sympy import divisors
    def A341578(n):
        c = min((d//2+1)*(n**2//(2*d)+1) for d in divisors(n**2,generator=True) if d<=n)
        return c if n % 2 else min(c,(n//2+1)**2-1) # Chai Wah Wu, Mar 05 2021

Formula

a(n) is the minimum value of {(floor(d/2)+1)*(floor(n^2/(2*d))+1) over all divisors d of n^2 AND (n/2+1)^2-1, if n is even}.

Extensions

Entry revised by N. J. A. Sloane, Feb 26 2021.
Showing 1-4 of 4 results.