# Questions tagged [math]

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

1,424 questions
Filter by
Sorted by
Tagged with
356 views

### Find the maximum flow

Given a directed network, with a single source and a single sink, it is possible to find the maximum flow through this network, from source to sink. For example, take the below network, $G$: Here, ...
362 views

2k views

### Complete the Magic Square

Background A magic square is an n×n matrix consisting of one of each of the integers from $1$ to $n^2$ where every row, column, and diagonal sum to the same ...
196 views

### Is it a uniform polyhedron?

Objective Given a vertex figure consisting of regular convex polygons, determine whether it represents a convex uniform polyhedron. What is a uniform polyhedron? A uniform polyhedron is a polyhedron ...
421 views

Introduction Imagine you are on a two dimensional cartesian plane and want to determine your position on it. You know 3 points on that plane and your distance to each of them. While it is always ...
1k views

### Make a Ramanujan magic square

Background As you maybe know Ramanujan made this magic square by $4x4$ Matrix: This works like all magic squares. But the special thing in this square is that his birthdate is hidden in the first ...
537 views

### Is magic possible?

A magic square is an n-by-n square grid, filled with distinct positive integers in the range 1,2,...n^2, such that each cell contains a different integer and the sum of the integers in each row, ...
2k views

### Verify Magic Square

A magic square is a square array of numbers with side n consisting of the distinct positive integers 1, 2, ..., n² arranged such that the sum of the n numbers in any horizontal, vertical, or main ...
2k views

### Music with pi and e

Because I forgot to celebrate the pi-day(14.3) lets celebrate with $\pi$, $e$ (Euler's number) and music! Challenge No, we don't have time to eat a pi-pizza, lets make a program. What you need is ...
414 views

### Count The Genus

Objective Given a matrix of connected box drawing characters, count its genus, the number of plane sections it encloses. Valid input The box drawing characters are ...
2k views

### Laguerre Polynomials

Laguerre polynomials are solutions to Laguerre's equation, a second-order linear differential equation: $xy''+(1-x)y'+ny=0$. For a given value of n, the solution, y, is named $L_n(x)$. The ...
1k views

### Form tiles in a rectangular ring

Given the input tilesX and tilesY create a method that would make a rectangular ring from the tiles. The function must order ...
962 views

### Fibonacci’s sexagesimals

Leonardo da Pisano a.k.a Fibonacci was instrumental in bringing the Hindu-Arabic numeral system into Europe. Before that, mathematicians there worked in base sixty with Roman numerals. For example, ...
166 views

### Solve the dress problem [closed]

Background Peter's Father, the Teacher of a dance-club, asks Peter a question: Given are two natural numbers ($\mathbb{N}$ $x$ and $y$). $x$ is the number of the garment types (e.g. shorts, ...
1k views

### Split pythagorean triples into two sets

Task Write a program/function that when given a positive integer $n$ splits the numbers from $1$ to $n$ into two sets, so that no integers $a, b, c$, satisfying $a^2 + b^2 = c^2$ are all in ...
3k views

### Is this number Loeschian?

A positive integer k is a Loeschian number if k can be expressed as i*i + j*j + i*j for <...
942 views

### What is the Subspace Dimension?

Challenge Given the Cartesian coordinates of two or more distinct points in Euclidean n-space ($\mathbb{R}^n$), output the minimum dimension of a flat (affine) subspace that contains those points, ...
572 views

### Code golf a random orthogonal matrix

An orthogonal matrix is a square matrix with real entries whose columns and rows are orthogonal unit vectors (i.e., orthonormal vectors). This means that M^T M = I, where I is the identity matrix ...
3k views

### Leyland Numbers

Given a natural number n, return the n-th Leyland number. Leyland Number Leyland numbers are positive integers ...
2k views

### Are they collinear?

Task Write a program/function that when given three 2d points in cartesian coordinates as input outputs a truthy value if they are collinear otherwise a falsey value Three points are said to be ...
237 views

### Is it a geometric sequence or not? [closed]

Well, last time I asked for an arithmetic sequence, now comes the geometric sequence Challenge In this challenge, the input will be an unordered set of numbers and the program should be able to tell ...
2k views

### Calculate golden ratio

Write the shortest code, in number of bytes, to display, return, or evaluate to the golden ratio (that is, the positive root of the quadratic equation: $x^2-x-1=0$, approximately 1.618033988749895), ...
3k views

### Approximation of e

We all know that the Euler's number, denoted by $e$, to the power of some variable $x$, can be approximated by using the Maclaurin Series expansion: By letting $x$ equal $1$, we obtain ...
2k views

### Find the perfect square!

Your task is to turn a square root like this: √12 into a form like this: 2√3 For our purpose, we only need to output the left ...
937 views

### Smple way to get min & max

You will take a set of input numbers, and output the minimum and maximum of the set. You can either write two programs, with 1 program doing each function, or one combined program. Here's an example ...
1k views

### Is a statement of propositional logic always true?

The challenge is to golf a program that checks if a statement of propositional calculus/logic is a logical tautology (i.e. it is true for all possible values of the variables). Input Input formulas ...
3k views

### Is this a Smith number?

Challenge description A Smith number is a composite number whose sum of digits is equal to the sum of sums of digits of its prime factors. Given an integer N, ...
7k views

### Find the Pisano Period

The Fibonacci sequence is a well know sequence in which each entry is the sum of the previous two and the first two entries are 1. If we take the modulo of each term by a constant the sequence will ...
5k views

### An abundance of integers!

An Abundant number is any number where the sum of its proper divisors is greater than the original number. For example, the proper divisors of 12 are: ...
202 views

### Is it an Arithmetic Sequence or not? [closed]

Challenge In this challenge, the input will be an ordered set of numbers and the program should be able to tell if the set of numbers is an Arithmetic Sequence. Input The input will be a list ...
441 views

### Reachable numbers

Definitions Euler Phi Function (AKA totient function): a function which takes in a positive number and returns the number of positive numbers less than the given number which are co-prime with given ...
Task Write a program/function that when given 3 positive integers $a, b$ and $m$ as input outputs a positive integer $x$ such that $a^x\equiv b\ (\text{mod}\ m)$ or that no such $x$ exists. ...