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

A380380 Numbers k such that A380377(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, 4, 7, 10, 13, 16, 17, 23, 24, 31, 38, 45, 49, 59, 60, 67, 71, 82, 93, 97, 104, 111, 112, 123, 127, 142, 157, 161, 172, 180, 195, 199, 218, 229, 237, 241, 256, 264, 283, 287, 310, 325, 333, 337, 356, 364, 379, 387, 391, 418, 437, 445, 449, 472, 480, 499
Offset: 1

Views

Author

Pontus von Brömssen, Jan 24 2025

Keywords

Comments

The only term common to this sequence and A380379 is 1.

Crossrefs

A380379 Least k for which A380377(k) = n, i.e., the least number of voters for which n supporters are needed to win an election with rules as in A380377.

Original entry on oeis.org

1, 2, 5, 8, 11, 14, 18, 20, 25, 28, 32, 33, 39, 40, 46, 50, 53, 54, 61, 62, 68, 72, 74, 75, 83, 86, 88, 94, 98, 99, 105, 106, 113, 116, 117, 124, 128, 129, 130, 138, 143, 144, 150, 151, 158, 162, 163, 164, 173, 176, 181, 182, 188, 189, 196, 200, 203, 204, 205
Offset: 1

Views

Author

Pontus von Brömssen, Jan 24 2025

Keywords

Comments

Also, indices of records in A380377.

Crossrefs

A380381 Smallest number of districts needed for A380377(n).

Original entry on oeis.org

1, 1, 1, 3, 1, 4, 5, 3, 3, 3, 3, 8, 9, 3, 3, 3, 5, 5, 13, 3, 3, 3, 7, 7, 5, 5, 5, 3, 9, 9, 9, 9, 3, 3, 5, 5, 5, 7, 7, 3, 12, 12, 13, 13, 13, 5, 5, 9, 9, 7, 7, 7, 7, 5, 5, 5, 5, 11, 11, 11, 11, 7, 7, 7, 7, 7, 9, 9, 13, 13, 13, 13, 21, 21, 5, 5, 5, 7, 7, 7, 11
Offset: 1

Views

Author

Pontus von Brömssen, Jan 24 2025

Keywords

Comments

Smallest k such that A380378(n,k) = A380377(n).

Crossrefs

Cf. A380377, A380378, A380382 (largest number of districts).

A380382 Largest number of districts possible for A380377(n).

Original entry on oeis.org

1, 2, 3, 3, 5, 5, 5, 7, 7, 7, 9, 9, 9, 11, 11, 11, 5, 13, 13, 15, 15, 15, 7, 7, 17, 5, 5, 19, 9, 9, 9, 9, 23, 23, 11, 11, 11, 11, 11, 27, 13, 13, 13, 13, 13, 13, 9, 9, 9, 15, 15, 15, 15, 17, 17, 17, 17, 17, 17, 11, 11, 19, 19, 19, 19, 19, 9, 13, 13, 13, 13, 21
Offset: 1

Views

Author

Pontus von Brömssen, Jan 24 2025

Keywords

Comments

Largest k such that A380378(n,k) = A380377(n).

Crossrefs

Cf. A380377, A380378, A380381 (smallest number of districts).

A380383 Numbers k such that the minimum number of votes A380377(k) can be attained with an even number of districts.

Original entry on oeis.org

2, 3, 5, 6, 8, 9, 11, 12, 14, 15, 18, 20, 21, 28, 33, 34, 35, 40, 41, 42, 54, 55, 56, 62, 63, 75, 76, 77, 88, 99, 130, 131, 132, 164, 165, 206, 207, 208, 209, 210, 300, 341, 342
Offset: 1

Views

Author

Pontus von Brömssen, Jan 24 2025

Keywords

Comments

342 is almost certainly the last term of this sequence.
Numbers k such that A380377(k) = A380378(k,m) for some even m.

Examples

			A380377(342) = 95 can be obtained with either 36 districts 18*9 + 18*10 with 5 supporters in each of the 18 9-voter districts and 5 supporters in one of the 10-voter districts, or 37 districts 28*9 + 9*10 with 5 supporters in 19 of the 9-voter districts. Since one solution has an even number of districts, 342 is a term.
		

Crossrefs

A380378 Triangle read by rows: T(n,k) is the minimum number of total votes needed for one party to win if there are n voters divided into k balanced districts, 1 <= k <= n.

Original entry on oeis.org

1, 2, 2, 2, 2, 2, 3, 3, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 3, 3, 4, 4, 4, 4, 4, 3, 4, 4, 5, 5, 4, 5, 4, 4, 4, 5, 5, 5, 4, 5, 5, 4, 4, 5, 5, 6, 6, 4, 5, 6, 5, 4, 5, 5, 6, 6, 6, 5, 5, 6, 6, 5, 5, 5, 6, 6, 7, 7, 6, 6, 6, 7, 6, 5, 5, 6, 6, 7, 7, 7, 6, 6, 6, 7, 7, 6, 5, 6, 6, 7, 7
Offset: 1

Views

Author

Pontus von Brömssen, Jan 24 2025

Keywords

Comments

See A380377 for further details.
It is never optimal to have any supporters in a losing district or to win a district with a greater margin than necessary. This implies that, in any optimal strategy, any district of size m should have 0, m/2, (m+1)/2, or m/2+1 supporters. If k is odd, the optimal strategy is to win the (k+1)/2 smallest districts. If k is even and n/k is an odd integer, the best strategy is to win k/2+1 districts (all districts have n/k voters in this case). If k is even and n/k is not an odd integer, the best strategy is to draw one of the even districts and win the k/2 smallest remaining districts.

Examples

			Triangle begins:
  n\k| 1  2  3  4  5  6  7  8  9 10 11 12
  ---+-----------------------------------
   1 | 1
   2 | 2  2
   3 | 2  2  2
   4 | 3  3  2  3
   5 | 3  3  3  3  3
   6 | 4  4  4  3  3  4
   7 | 4  4  4  4  3  4  4
   8 | 5  5  4  5  4  4  4  5
   9 | 5  5  4  5  5  4  4  5  5
  10 | 6  6  4  5  6  5  4  5  5  6
  11 | 6  6  5  5  6  6  5  5  5  6  6
  12 | 7  7  6  6  6  7  6  5  5  6  6  7
		

Crossrefs

Cf. A380377 (row minima), A380379, A380380, A380381, A380382, A380383.

Programs

  • Python
    def A380378(n,k):
        q,r = divmod(n,k)
        q2,rq = divmod(q,2)
        k2,rk = divmod(k,2)
        x = (k2+1)*(q2+1)
        if 2*r
    				
Showing 1-6 of 6 results.