Algorithmic mathematics
50 original programming-style mathematics puzzles in number theory, digit algorithms, combinatorics, dynamic programming, paths and geometry. Solve using any method; submit only the final integer, not code.
50 active competition problems in this category. Select Load more problems to see the next set.
Algorithmic mathematics problems
- Distinct odd partitionsHow many ways can 1000 be expressed as a sum of DISTINCT positive odd integers? Order is irrelevant. Return the number of ways modulo 1000000007.Read and solve →
- Accelerated recurrenceLet a_0=2, a_1=5, and a_n=(3*a_(n-1)+2*a_(n-2)) mod 1000003 for n>=2. Find a_50000.Read and solve →
- First zero in a coupled recurrenceDefine a_0=1, a_1=3, and a_n=(3*a_(n-1)+7*a_(n-2)) mod 1009 for n>=2. Find the smallest n>=2 for which a_n=0. If no such n<=100000 exists, submit -1.Read and solve →
- Second-order oscillator modulo a primeDefine b_0=5, b_1=11, and b_n=(4*b_(n-1)-b_(n-2)) mod 1000003 for n>=2. Find b_50000.Read and solve →
- Quadratic orbit checkpointSet x_0=1 and x_n=(x_(n-1)^2+37) mod 65521 for n>=1. How many indices n in 1..100000 satisfy x_n divisible by 11?Read and solve →
- Fibonacci residues that are squaresUse F_0=0, F_1=1 and F_n=F_(n-1)+F_(n-2). For how many indices n with 1<=n<=1000000000000 is F_n modulo 997 a quadratic residue modulo 997? Include residue 0 as a square.Read and solve →
- Right-and-down energy pathConsider grid points (r,c), 0<=r,c<=39. Entering (r,c) costs 1+(r^2+3rc+7c^2+11) mod 97. Starting at (0,0), travel to (39,39) moving only down (r+1,c) or right (r,c+1). The starting point costs zero. Find the minimum total cost.Read and solve →
- Sparse-barrier monotone routesCount right/down paths from (0,0) to (35,35), avoiding every lattice point (r,c) with (7r+11c) mod 17 = 0, except the start and destination which are allowed. Return the number of valid paths modulo 1000000007.Read and solve →
- Jump-path obstacle courseStarting at (0,0), reach (24,24) by repeated jumps of (1,2) or (2,1). A jump may land only on points with both coordinates nonnegative, and may NOT land on a point whose first coordinate is odd and second coordinate is divisible by 4. How many jump sequences reach the goal?Read and solve →
- Four-way weighted mazeIn a 20x20 grid with vertices (r,c), 0<=r,c<=19, entering vertex (r,c) costs 1+(17r+31c+7rc) mod 91. Starting at (0,0) for free, reach (19,19) with 4-neighbor moves, possibly revisiting vertices. Find the least total entering cost.Read and solve →
- Even-color twin-station coverageFor every lattice point (x,y) with integer coordinates 0<=x,y<=1000000000, consider Manhattan distances to A=(310000000,410000000) and B=(310180000,410090000). How many points have distance at most 250000 from at least one station AND satisfy x+y even? Count each point only once.Read and solve →
- Twelve-divisor sevensHow many integers n in 1..120000 are divisible by 7 and have exactly twelve positive divisors?Read and solve →