Questions tagged [math]
The challenge involves mathematics in some central way. Also consider using more specific tags, listed in the tag wiki info.
1,881 questions
22
votes
13
answers
2k
views
Draw the Gauss Star (Heptadecagram)
Background
In 1796, 18-year-old Carl Friedrich Gauss proved that a regular heptadecagon can be constructed with compass and straightedge — the first such discovery in over 2,000 years. The stonemason ...
-1
votes
0
answers
98
views
Golf a function that grows faster then the Strong Array Notation [closed]
I recently saw this post, and apparently, the last well-defined stage of the Strong Array Notation, the Dropping Array Notation, grows faster than D^5(k), which lead me to creating this post. Your ...
12
votes
3
answers
436
views
Fast sampling of special binary strings
We are going to define a simple little language. A word in this language is a binary string where the longest run of consecutive \$0\$s, is shorter than every (maximal) run of \$1\$s. So for example:
\...
-1
votes
1
answer
145
views
Golf a number bigger than all other answers [duplicate]
You have to code in python, and the number generated by your code must be bigger than all other current submissions. You need to make your code as small as possible, it has to terminate but you can ...
8
votes
4
answers
659
views
Find a primitive polynomial
Objective
Given a prime number \$p\$ and an integer \$n \geq 2\$, find a degree-\$n\$ primitive polynomial modulo \$p\$.
Mathematical explanation
When we perform "modular arithmetic" over ...
14
votes
10
answers
1k
views
Polynomial Basis Conversion
The most common way to represent a polynomial is writing it as a linear combination of monomials, i.e., powers of the variable. For example, the polynomial \$p(x) = x^3 + 2x^2 + x + 1\$ is a linear ...
18
votes
3
answers
1k
views
Cancel and minimize game
Here is a game: Start with the set {1,2,3,...,n} of natural numbers. At any turn of the game, you may pick two numbers from this set, a and b, then replace them with their product a*b. Since it is a ...
9
votes
3
answers
330
views
Divide 1 by a sum/difference of square roots
Divide 1 by a sum/difference of square roots
Input: An expression that is a sum/difference of square roots of positive integers. You can assme it will not equal 0.
The general form is \$\pm\sqrt{a_1}\...
14
votes
17
answers
1k
views
Compute the NFL passer rating
Each quarterback in the NFL is given a passer rating at the end of the game, which measures how good their forward passes were. It is not strictly a basic arithmetic formula, and is calculated as ...
12
votes
12
answers
754
views
Recursive cumulative sum [duplicate]
Challenge:
Given inputs \$i\$ and \$n\$, calculate \$R_i(n)\$ where:
$$R_0(n)=n \\
R_i(n)=\sum_{j=0}^nR_{i-1}(j)$$
Note that \$R_1\$ is triangular function, and \$R_2\$ is tetrahedral function.
This ...
5
votes
1
answer
348
views
Implement 2ˣ using the polynomial system
Your job is to implement \$2^x\$ using polynomials, such that in a way that for all integers \$x\$ and \$y\$,
$$\exists(v_0,v_1,\dots)[P_1(x,y,v_0,v_1,v_2,\cdots) = 0 \land P_2(x,y,v_0,v_1,v_2,\cdots)=...
17
votes
6
answers
894
views
Decompose a palindromic polynomial
A palindromic polynomial is a polynomial whose list of coefficients is a palindrome. For example, the polynomial \$p(x) = x^4 + 2x^3 + 3x^2 + 2x + 1\$ is palindromic because its coefficients are \$[1, ...
13
votes
8
answers
1k
views
Float vs Decimal
You will be given a decimal number n in the form of a string. You must determine if that number, when stored in standard number type ...
16
votes
7
answers
1k
views
Solve the crossed ladders problem
I'm surprised we don't have the crossed ladders problem as a task here yet.
Two ladders of lengths a and b lie oppositely across an alley, as shown in the figure. The ladders cross at a height of h ...
15
votes
17
answers
2k
views
IMO 2025: Divisor sums that go forever
Problem 4 of the 2025 International Mathematical Olympiad asked (paraphrased):
Let \$f(n)\$ be the sum of the largest three proper divisors of \$n\$,
that is divisors excluding \$n\$ itself. For ...