# Questions tagged [math]

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

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

1k views

### All-inclusive semi-primes

$723 = 3 \times 241$ is a semi-prime (the product of two primes) whose prime factors include all digits from $1$ to $n$, where $n$ is the total number of digits between them. Another way to ...
99 views

### Dobble Double Challenge [closed]

I have a problem, which I haven't found a solution for. Solutions to the first part are well documented, but I have yet to find anyone who has solved the second part. I call this the "Dobble"...
2k views

### Fastest square root of an arbitrary size

We do seem to have a fastest square root challenge, but it's very restrictive. In this challenge, your program (or function) will be given an arbitrarily sized nonnegative integer, which is the square ...
3k views

### Narcissistic loop lengths

A narcissistic number is a natural number which is equal to the sum of its digits when each digit is taken to the power of the number digits. For example $8208 = 8^4 + 2^4 + 0^4 + 8^4$, so is ...
1k views

### Display the exponent from a binary floating point number as a decimal value

Had my software final exams recently, one of the last questions had me thinking for a while after the exam had finished. Background IEEE754 numbers are according to the below layout The exponent is ...
321 views

2k views

### A Portuguese sequence of integers

Context Consider the following sequence of integers: $$2, 10, 12, 16, 17, 18, 19, ...$$ Can you guess the next term? Well, it is $200$. What about the next? It is $201$... In case it hasn't become ...
1k views

### Find all integer pairs that produce a given Loeschian number

Inspired by and drawns from Is this number Loeschian? A positive integer $k$ is a Loeschian number if $k$ can be expressed as $i^2 + j^2 + i\times j$ for $i$, $j$ integers. For example, ...
2k views

### Three other numbers

Given three distinct numbers from $1$ to $7$, output three other distinct numbers from $1$ to $7$, that is having no numbers in common with the original numbers. Your code must produce a ...
4k views

### Is that number a Two Bit Number™️?

Let's start by defining a Two Bit Number™️: It is a positive integer When expressed as a binary string it has exactly 2 true bits OR When expressed as a decimal number, it has exactly 2 of the ...
3k views

### Circumference of an ellipse

Challenge Unlike the circumference of a circle (which is as simple as $2\pi r$), the circumference of an ellipse is hard. Given the semi-major axis $a$ and semi-minor axis $b$ of an ellipse (see ...
1k views

### Plot a centered circle

Intro Given radius $r$, draw a circle in the center of the screen. Sandbox. The Challenge Here is a simple challenge. Plot a circle using the formula $x^2+y^2=r^2$, or any other formula that will ...
2k views

### Delicate primes

Inspired by Find the largest fragile prime. By removing at least 1 digit from a positive integer, we can get a different non-negative integer. Note that this is different to the ...
127 views

### The Perfect Polynomial [closed]

The coefficients of a perfect square polynomial can be calculated by the formula $(ax)^2 + 2abx + b^2$, where both a and b are integers. The objective of this challenge is to create a program that ...
436 views

624 views

### Prime Modified Z-Factorials

Let me explain one by one the above terms... We will call $\text{Z-Factorial}(n)$ of a positive integer $n$, $n!$ (i.e. $n$ factorial) without any trailing zeros. So, $\text{Z-Factorial}(30)$...
541 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, ...
470 views

2k views

### Cleaning up decimal numbers

Background Sometimes in calculus you're expected to calculate the sum of an infinite series. Sometimes these series are very friendly, like a geometric series, but add anything else onto it and it can ...
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 ...
211 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 ...
420 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 ...
175 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

### 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 ...
952 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, ...
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 ...
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 ...
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 ...
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 ...
248 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 ...
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. ...