# Questions tagged [math]

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

1,353 questions
Filter by
Sorted by
Tagged with
51 views

### Find the number of edge in a graph [closed]

In graph theory, you can describe a graph using a letter and its number of vertices. For example, the complete graph with 5 vertices is denoted by K5 There are many identifiers for many family of ...
2k views

### Drawing one-liner

CodeDrawing one-liner Teaser Behold this formidable drawing: Can you draw this in a single stroke? Give it a try. Can you do this one, now: Give it a try. How it works These "make this drawing ...
1k views

40 views

### A task with some matches [closed]

members) I got some task with 5 matches you must move 2 of them to make figure More details in the file https://www.sendspace.com/file/2zwnon
207 views

### Estimate the mean minimum Hamming distance

Task Inputs $b \leq 100$ and $n \geq 2$. Consider $n$ binary strings, each of length $b$ sampled uniformly and independently. We would like to compute the expected minimum Hamming distance ...
4k views

### Calculate the Progressive Mean™

Disclaimer: This challenge is inspired by a coding error I once made. Okay, time for a maths lesson. A normal mean average looks like this: ...
590 views

### Computing a specific coefficient in a product of polynomials

Generator functions This gives the context for why this challenge came to life. Feel free to ignore. Generator functions are a nice way of encoding the solution to a problem of combinatorics. You ...
284 views

### Approximating the amount of prime numbers below x

Background We define the prime-counting function, $\pi(x)$, as the number of prime numbers less than or equal to $x$. You can read about it here. For example, $\pi(2) = 1$ and $\pi(6) = 3$. ...
5k views

### Shift right by half a bit

The challenge is to implement a program or function (subsequently referred to as "program") that takes a nonnegative integer $n$ as input and returns $n\over\sqrt{2}$ (the input divided by the ...
492 views

### Average number of strings with Levenshtein distance up to 4

This is a version of this question which should not have such a straightforward solution and so should be more of an interesting coding challenge. It seems, for example, very likely there is no easy ...
399 views

248 views

### Can this knot be colored with 3 colors?

In this challenge you will be asked to take a knot and determine if it can be colored in a particular way. First we draw a diagram of the knot. We use the standard way of drawing knots where we put ...
2k 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 ...
304 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,...
3k 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 ...
635 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$ ...
4k 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 ...
506 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 ...
126 views

128 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 ...
323 views

### Shorthand Combined Functions

I was doing some investigation into trig functions using compound angles recently, and noticed that the results are really long and tedious to write:  \cos(A+B) = \cos A \cos B - \sin A \sin B \\ \...
478 views

### How wavy is an array?

A wave of power $k$ is an infinite array that looks like $1,2,\dots,k,k-1,\dots,1,\dots,k,\dots,1,\dots$, and so on. For example, a wave of power 3 starts with $1,2,3,2,1,2,3,2,1,...$, and ...
3k views

### Are my triangles similar?

Given (in any structure; flat list, two lists of lists, a tuple of matrices, a 3D array, complex numbers,…) the coordinates for two non-degenerate triangles ...
Fermat's polygonal number theorem states that every positive integer can be expressed as the sum of at most $n$ $n$-gonal numbers. This means that every positive integer can be expressed as the ...
We haven't had any nice, easy challenges in a while, so here we go. Given a list of integers each greater than $0$ and an index as input, output the percentage of the item at the given index of the ...