Teaser 2575: More teams
From The Sunday Times, 29th January 2012 [link] [link]
In our local pub soccer league each team plays each of the others at home and away during the season. Two seasons ago we had a two-digit number of teams. The number increased the next year, and again this year, but this time the increase was one less than the previous season. This season the number of games played will be over three times the number played two seasons ago. Also, this season’s increase in games played actually equals the number played two seasons ago.
How many teams are there now in the league?
[teaser2575]
Jim Randell 8:16 am on 7 February 2025 Permalink |
The number of teams goes:
where n is a 2-digit number.
So the current season has an odd number of teams (≥ 3) more than the number of teams two seasons ago.
Each pair of teams plays twice, so for n teams the number of matches in a season is:
and if the numbers of matches are A → B → C we have:
This Python program looks for the first possible solution.
It runs in 66ms. (Internal runtime is just 38µs).
from enigma import (irange, inf, printf) # number of matches for n teams = 2 * C(n, 2) M = lambda n: n * (n - 1) def solve(): # consider a league with c teams (current season) for c in irange(13, inf): C = M(c) # consider an odd number of teams less than this (two seasons ago) for a in irange(c - 3, 10, step=-2): A = M(a) if 3 * A >= C or a > 99: continue b = (a + c + 1) // 2 B = M(b) if A + B == C: yield ((a, b, c), (A, B, C)) # find the first solution for ((a, b, c), (A, B, C)) in solve(): printf("{a} teams, {A} matches -> {b} teams, {B} matches -> {c} teams, {C} matches") breakSolution: There are now 17 teams in the league.
And so there are 272 matches in the current season.
Two years ago there were 10 teams in the league, and the season consisted of 90 matches. (The current season has more than 3× this number of matches).
One year ago there were 14 teams in the league, and the season consisted of 182 matches, and 182 + 90 = 272.
LikeLike
Frits 4:07 pm on 7 February 2025 Permalink |
Further analysis (solving a quadratic equation) leads to :
c = (5a + 1) / 3
and C greater than 3 * A means a^2 -11a + 1 less than 0.
a =10 is still valid but already at a = 11 the condition is not met.
LikeLike
John Crabtree 4:58 am on 14 February 2025 Permalink |
Frits, nicely done. It is useful to know the intermediate result, ie n = 3k – 2
LikeLike