Questions tagged [math]
The challenge involves mathematics in some central way. Also consider using more specific tags, listed in the tag wiki info.
1,871 questions
5
votes
1
answer
295
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
800
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
966
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
14
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 ...
14
votes
7
answers
1k
views
Squaring the roots of a polynomial
In this challenge, you are given a polynomial \$p(x)\$, and you need to find a polynomial \$q(x)\$ whose roots are exactly the squares of the roots of \$p(x)\$ (counted with multiplicity). In other ...
1
vote
1
answer
284
views
The Parable of the Dagger Prelude
Taken from lesswrong.com
Once upon a time, there was a court jester who dabbled in logic.
The jester presented the king with two boxes. Upon the first box was
inscribed:
"Either this box ...
24
votes
6
answers
2k
views
Computing Pi with iF*ck
Objective
Compute \$\pi\$ using nothing but \$i\$ (\$\sqrt{-1}\$).
Guidelines
ONLY exponentiation and multiplication may be used (i.e. \$i^i\$ or \$ii\$)
No additional symbols may be used (so no ...
5
votes
10
answers
1k
views
Genshin Elemental Aura Decay
There is this game Genshin Impact, when an element is applied to an enemy i.e. Electro it remains for some time causing decay to the enemy health. For this challenge, we'll simplify this to a single ...
10
votes
2
answers
672
views
Intersection check in the fewest operations
Challenge
Given two line segments, your goal is to write a function which determines if they intersect using only the operations given below:
Multiplication: x*y
...
6
votes
17
answers
1k
views
555 Timer Calculator
The Challenge
In honour of getting 555 Rep, here's a little challenge to work out the frequency of a 555 Timer. The frequency can be worked out using
$$ f=\frac{1.44}{(R_1+2R_2)C_1} $$
Implement this ...
-4
votes
12
answers
340
views
Power Grid Management
You are writing the management software for one "node" of a power grid. A node has a layout like this
+
|
+---N---+
|
+
Each + is a ...
4
votes
8
answers
910
views
How many distinct characters can be used to implement Boolean Algebra in your programming language [closed]
I am interested in the following problem:
What is the minimum number of distinct characters used in any programming language that can implement Boolean Algebra?
In particular, what is the set that ...
9
votes
4
answers
496
views
Ultra-modular representative of rational numbers
Objective
Given a reduced fraction \$p/q\$ where \$q > 0\$, output the (unique) reduced fraction \$p'/q'\$ such that:
\$p'\$ is nonnegative and less than \$q'\$, and
\$q'\$ is a positive odd ...
-10
votes
2
answers
276
views
Fizz-Buzz-Bazz-Pazz
Fizz-Buzz-Bazz-Pazz
Problem Summary
Write a program that prints numbers from 1 to 100 with replacements based on the following ...