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.

A135490 Number of tieless basketball games from the years 1967-present with n scoring events.

Original entry on oeis.org

1, 6, 30, 162, 886, 4932, 27714, 157018, 894942, 5126268, 29481732, 170128850, 984577446, 5712117772, 33210790018, 193456179430, 1128789904110, 6596174575548, 38596967873100, 226120320617484, 1326180436400932
Offset: 0

Views

Author

Sequence discovered by the students of D. Zeilberger's course (avitalo(AT)math.rutgers.edu), Feb 07 2008

Keywords

Comments

A game is a sequence of valid scores (positive values for the home team, negative values for the visiting team). The valid scores for basketball played during the years 1967-present are {1, 2, 3, -1, -2, -3}. A tieless game is one in which the teams are never in a tie (except at the beginning, when no team has scored yet).

Crossrefs

Cf. A135489 (without 3-pointers), A137684 (American football).

Programs

  • Maple
    TieLessGamesGeneral := proc(S, n, k) local s; option remember; if n = 0 then if k = 0 then return 1; else return 0; fi; fi; if k = 0 then return 0; fi; return add(TieLessGamesGeneral(S, n-1, k-s), s in S); end: TieLessGames := proc(S, n) local k, Smin, Smax; Smin := min(op(S)); Smax := max(op(S)); return add(TieLessGamesGeneral(S, n, k), k = Smin*n..Smax*n); end: TieLessOldBasketballGames := proc(n) return TieLessGames({1, 2, 3, -1, -2, -3}, n); end:

A135489 Number of tieless basketball games from the years 1896-1967 with n scoring events.

Original entry on oeis.org

1, 4, 12, 42, 148, 540, 1990, 7434, 27972, 106008, 403764, 1544796, 5931486, 22846252, 88228998, 341518606, 1324627044, 5146959168, 20030812360, 78066774400, 304643526276, 1190209498344, 4654949367204, 18223301727108
Offset: 0

Views

Author

Sequence discovered by the students of D. Zeilberger's course (avitalo(AT)math.rutgers.edu), Feb 07 2008

Keywords

Comments

A game is a sequence of valid scores (positive values for the home team, negative values for the visiting team). The valid scores for basketball played during the years 1896-1967 are {1, 2, -1, -2}. A tieless game is one in which the teams are never in a tie (except at the beginning, when no team has scored yet).

Crossrefs

Cf. A135490 (with 3-pointers), A137684 (American football).

Programs

  • Maple
    TieLessGamesGeneral := proc(S, n, k) local s; option remember; if n = 0 then if k = 0 then return 1; else return 0; fi; fi; if k = 0 then return 0; fi; return add(TieLessGamesGeneral(S, n-1, k-s), s in S); end: TieLessGames := proc(S, n) local k, Smin, Smax; Smin := min(op(S)); Smax := max(op(S)); return add(TieLessGamesGeneral(S, n, k), k = Smin*n..Smax*n); end: TieLessOldBasketballGames := proc(n) return TieLessGames({1, 2, -1, -2}, n); end:

A334288 Number of tieless rugby (union) games with n scoring events.

Original entry on oeis.org

1, 6, 30, 180, 1002, 6012, 34224, 205344, 1180010, 7080060, 40911324, 245467944, 1423944024, 8543664144, 49710351720, 298262110320, 1739627237002, 10437763422012, 61002039226716, 366012235360296, 2142786218045748, 12856717308274488, 75380119335678608
Offset: 0

Views

Author

Cameron Ford, Jun 13 2020

Keywords

Comments

In rugby (union) a scoring event can give 3, 5 or 7 points.
In April 1992 the current scoring format was introduced: 3 points are awarded for kicks/penalties, 5 points for unconverted tries and 7 points for converted tries. A game is a list of members of {-7,-5,-3,3,5,7} with negative points for the away team, positive for the home team.
A tieless game is one in which the teams never have the same score (except at the beginning, when no team has scored yet).

Examples

			a(2)=30, because there are 6^2=36 sequences of length 2 from {3,5,7,-3,-5,-7}; the 6 sequences that correspond to games with ties are precisely those of the form {k,-k}.
		

Crossrefs

Inspired by A137684.

Programs

  • Python
    def number_of_tieless_rugby_games(n):
        """
        Returns the number of tieless rugby games with n scoring events.
        A scoring event is a number in (-7,-5,-3,3,5,7) and a game is tieless
        if the score is never zero, apart from at the start.
        Negative points represent points for the away team, positive points
        represent points for the home team
        """
        dictionary_of_scores = {0:1}
        # The keys of this dictionary represent possible scores.
        # The values represent the number of ways this score can be reached.
        scoring_events = (-7,-5,-3,3,5,7)
        for i in range(n):
            # At each stage, we have the nonzero scores with i scoring events in
            # dictionary_of_scores. To find nonzero scores with i+1 scoring events
            # consider each nonzero score, and each possibility for the next
            # scoring event.
            old_dictionary = dictionary_of_scores
            dictionary_of_scores = {}
            for score, number_of_ways in old_dictionary.items():
                for scoring_event in scoring_events:
                    new_score = score + scoring_event
                    if new_score != 0:
                        dictionary_of_scores[new_score] =\
                        dictionary_of_scores.get(new_score, 0) + number_of_ways
        return sum(dictionary_of_scores.values())

A335974 Number of tieless quidditch games with n scoring events.

Original entry on oeis.org

2, 4, 4, 8, 12, 24, 40, 80, 140, 280, 504, 1008, 1848, 3696, 6864, 13726, 25740, 51450, 97240, 194210, 369512, 737124, 1410864, 2810178, 5408312, 10752868, 20801200, 41273500, 80233200, 158851800, 310235040, 612835830, 1202160780, 2369260560, 4667212440
Offset: 1

Views

Author

Cameron Ford, Jul 03 2020

Keywords

Comments

Quidditch is a sport invented by author J. K. Rowling for her fantasy book series Harry Potter.
In quidditch, the match ends when the snitch is caught. The team which caught it is awarded 150 points. All other scoring events are worth 10 points, and occur when the quaffle is thrown through one of the hoops.
A game is, therefore, a list of +10s and -10s, with a final entry of either +150 or -150. Negative points are for the away team, positive points are for the home team.
A tieless game is one in which the teams never have the same score (except at the beginning, when no team has scored yet).
For n <= 15 and all odd n: a(n) = 2*A063886(n)
For even n greater than 15: a(n) = 2*(A063886(n) + A009766((n-2+14)/2,(n-2-14)/2))

Examples

			a(3) = 4 because to avoid a tie after two scoring events, the same team must score the first two goals, i.e., the game starts (+10,+10) or (-10,-10). Then there are two options for who catches the snitch. So the tieless games with three scoring events are (-10,-10,-150), (-10,-10,+150), (+10,+10,-150) and (+10,+10,+150).
		

References

  • J. K. Rowling, Harry Potter and the Philosopher's Stone, Chapter 10, Bloomsbury, 1997.

Crossrefs

Inspired by A137684 and Robin Smyrl.
Tieless games: A137684 (American football), A135490 (basketball), A135489 (basketball 1896-1967), A334288 (rugby union), this sequence (quidditch).
Cf. A063886.

Programs

  • Python
    def number_of_tieless_quidditch_games(n):
        """
        Takes an integer n, and returns a list containing the number of tieless
        quidditch games with 1, 2, 3 .... n scoring events.
        Note, the last scoring event is always catching the snitch, which gives
        +150 if the home team caught it, or -150 if the away team caught it.
        All scoring events prior to the snitch being caught are worth +10 or -10.
        """
        dictionary_of_scores = {0:1}
        # The keys of this dictionary represent possible scores.
        # The values represent the number of ways this score can be reached with
        # the game being tieless.
        list_to_return = []
        for i in range(n):
            # We have a dictionary of tieless games with i ten point scoring events.
            # Check still tieless after snitch catch
            number_of_tieless_games = 0
            for score, number_of_ways in dictionary_of_scores.items():
                if score != 150: # away team can catch snitch without a tie
                    number_of_tieless_games += number_of_ways
                if score != -150: # home team can catch snitch without a tie
                    number_of_tieless_games += number_of_ways
            list_to_return.append(number_of_tieless_games)
            # Update dictionary to have one more ten point scoring event
            old_dictionary = dictionary_of_scores
            dictionary_of_scores = {}
            for scoring_event in (-10, 10):
                for score, number_of_ways in old_dictionary.items():
                    new_score = score + scoring_event
                    if score + scoring_event != 0:
                        dictionary_of_scores[new_score] =\
                        dictionary_of_scores.get(new_score,0) + number_of_ways
        return list_to_return

Formula

A063886(n-1) gives the number of n-1 step walks on a line starting from the origin but not returning to it. This is equivalent to the number of quidditch games with n scoring events which are tieless after the first n-1 scores (all of which are +10 or -10). Therefore, as the last score can be +150 or -150, there are 2*A063886(n-1) quidditch games with n scoring events which are tieless after n-1 scores.
To be tied after n scores, one team must be 150 points ahead after n-1 scores and then the other team must catch the snitch. If n-1 is less than 15, this cannot happen. Additionally, if n is odd, then after n-1 scores the difference between the scores is an even multiple of 10, so cannot be 150.
Now, for even n greater than 15, we must subtract from 2*A063886(n-1) the number of games which are tieless after n-1 scores but tied after n scores. For this to be the case, supposing the away team catches the snitch, we must have the game starting with +10, ending with -150 and with a block of n-2 +10s and -10s in the middle such that the net score after n-1 scores is +150 and the cumulative number of -10s in the n-2 block is never more than the cumulative number of +10s.
Catalan's triangles, Catalan(m,k) gives the number of sequences of m +10s and k -10s such that the cumulative number of -10s is never greater than the cumulative number of +10s. We require m+k = n-2 and m = k+14. Solving this gives m = (n+12)/2 and k = (n-16)/2. Doubling, to count the games where the home team catches the snitch, we have the number of games which are tieless after n-1 scoring events but tied after the snitch catch is 2*Catalan((n+12)/2,(n-16)/2) hence giving the formula below.
Therefore, the total number of tieless quidditch games with n scoring events is:
2*A063886(n-1) if n is odd or n < 16.
2*A063886(n-1) - 2*A009766((n+12)/2,(n-16)/2) otherwise
Showing 1-4 of 4 results.