# Questions tagged [math]

The challenge involves mathematics. Also consider using more specific tags: [number] [number-theory] [arithmetic] [combinatorics] [graph-theory] [geometry] [abstract-algebra].

1,331 questions
Filter by
Sorted by
Tagged with
1k views

### Longest Prime Sums

Sandbox There are special sets S of primes such that $\sum\limits_{p\in S}\frac1{p-1}=1$. In this challenge, your goal is to find the largest possible set of primes that satisfies this condition. ...
2k views

### Smallest Fibonacci Multiples

Sandbox Background (not necessary for the challenge) A standard number theory result using the pigeonhole principle is the fact that given any natural number k, there is a Fibonacci number that is a ...
178 views

### Interpreting the Wolfram Code

Introduction An elementary cellular automaton is a cellular automaton that is 1-dimensional and has 2 states, 1 and 0. These cellular automata are categorized based on a simple code: the Wolfram code,...
2k views

### Roll for Initiative!

Roll for Initiative! Introduction In tabletop games like Dungeons and Dragons, when you begin a battle, all involved parties roll for initiative. In DnD 5e, this is ...
431 views

### Find the number of n-by-n (-1, 0, 1) matrices with zero permanent as quickly as possible

The permanent of an $n$-by-$n$ matrix $A = (a_{i,j})$ is defined as: $$\operatorname{perm}(A)=\sum_{\sigma\in S_n}\prod_{i=1}^n a_{i,\sigma(i)}$$ For a fixed $n$, consider the $n$-by-$n$ ...
3k views

### How many times, are they multiples?

You are given three parameters: start(int), end(int) and list(of int); Make a function that returns the amount of times all the numbers between start and end are multiples of the elements in the list....
2k views

### How divisible are you?

You are to create a program which, when given a positive integer $n$, outputs a second program. This second program, when run, must take a second positive integer $x$ and output one of two ...
1k views

### Can Alice win the game?

Can Alice win the game? The game's rules are as follows. First, a finite non empty set of positive integers $X$ is defined. Then, Alice and Bob take turns choosing positive integers, with Alice ...
4k views

### How close are we, really?

Please note: this is a restricted-source challenge — see details below! Each natural number $n$ has 10 faces: its decimal representations in bases $1$ through to $10$. For example, the 10 faces ...
492 views

### Decorate Pascal's Triangle

Although what is a Pascal's triangle is well-known and we already can generate it, the task is now different: Output $n$ first lines of the Pascal's triangle as colored bricks. Color number is ...
62 views

### A simple calculator [duplicate]

Make a simple calculator which does the basic math operations +, -, * /, one at the time: Input example: 10+12 Output: 22 Of course, lightest code wins. Good luck!
114 views

126 views

### Shooting gallery Puzzle!

Have you been shooting gallery? We are recently. In our shooting gallery cans and aluminum cans from under various drinks hang and stand. More precisely, they hung and stood. From our shots, banks ...
312 views

6k views

### Random point on a sphere

The Challenge Write a program or function that takes no input and outputs a vector of length $1$ in a theoretically uniform random direction. This is equivalent to a random point on the sphere ...
5k views

### Divide Numbers by 0

We've all been told at some point in our lives that dividing by 0 is impossible. And for the most part, that statement is true. But what if there was a way to perform the forbidden operation? Welcome ...
2k views

### Calculate Landau's function

Landau's function $g(n)$ (OEIS A000793) gives the maximum order of an element of the symmetric group $S_n$. Here, the order of a permutation $\pi$ is the smallest positive integer $k$ such ...
379 views

### ​Plane​ ​Blow​up​

The Blow-up is a powerful tool in algebraic geometry. It allows the removal of singularities from algebraic sets while preserving the rest of their structure. If you're not familiar with any of that ...
449 views

### Compute height of Bowl Pile

Bowl Pile Height The goal of this puzzle is to compute the height of a stack of bowls. A bowl is defined to be a radially symmetric device without thickness. Its silhouette shape is an even ...
232 views

### Decompose Commutators

A theorem in this paper1 states that every integral n-by-n matrix M over the integers with trace M = 0 is a commutator, that means there are two integral matrices A,B of the same size ...
161 views

### Black and white shirt 2

This is a more complicated version of this puzzle. The premise is the same but a few rules differ in a few key places, making for a more complex problem. Assume I have some number of black shirts and ...
383 views

### Black and white shirts

This puzzle is based on this Math.SE post. A more complex version of this problem can be found over here. Assume I have some number of black shirts and some number of white shirts, both at least 1. ...
4k views

### Construct a pentagon avoiding compass use

Rules You will start with only two elements: Points $A$ and $B$ such that $A \neq B$. These points occupy a plane that is infinite in all directions. At any step in the process you may do any ...
429 views

### Find X,Y,Z coordinates from index

Introduction I began studying the Collatz Conjecture And noticed these patterns; 0,1,2,2,3,3...A055086, and 0,1,2,0,3,1...A082375, in the numbers that go to 1 in one odd step, 5,10,20,21,40,42......
282 views

### Multiplication in Brainfuck - minimum number of evaluations [closed]

Given two numbers in tape location #0 and tape location #1 in Brainfuck, compute their product into another tape location (specify with answer). Optimize for the least amount of time-units used, where ...
105 views

### One square root function for unsigned numbers [closed]

One square root function for unsigned numbers Write the function sqrti(x) that from one not negative integer number x, it returns the integer square root of that number truncate to the 0 digit, so ...
102 views

### Make a slow monotonic injection [duplicate]

In 256 bytes or fewer write a function, $f$, from the positive integers to the positive integers that is: Monotonic: larger inputs always map to larger outputs. ($a < b \implies f(a) < f(b)$...
316 views

### Golf my iteration function

Here is my ungolfed Ruby code for a function I want to try and golf: ...