# Questions tagged [math]

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

487 questions
Filter by
Sorted by
Tagged with
2k views

### Simple Factorial Challenge [duplicate]

In light of today's date... A factorial of a number n, is the product of all the numbers from 1 to n inclusive. The Challenge Given an integer n where 0 <= n <= 420, find the sum of the digits ...
1k views

### Arithmetic Sequences

An arithmetic sequence is a sequence of numbers of the form a,a+n,a+2n,...
549 views

### Polynomial extrapolation

Task Given a list of integers a1, a2, …, ak (k ≥ 2) and a positive integer m, write a function or a complete program that calculates the next m numbers of the list. Assume that ai = P(i) where P(x) = ...
230 views

### Create sets with a Goldbach-like property

Goldbach's conjecture states that every even number > 4 is the sum of two prime numbers. Although this conjecture is not yet proven, similar results have been proven for other series of numbers. For ...
847 views

### Return the highest possible placement value based on the input

Introduction The challenge itself was something I came across and had to try and figure out for a personal of project of mine. I ended up branching out and asking family members if they could provide ...
2k views

### Smallest unseen, but no sharing digits!

Challenge Here at PPCG, we sure do like our sequences, so here's a fun another one. Let's define a(n) as being the smallest non-negative integer ...
2k views

### Sum It Up with a Digital Triangle

Well, sum it down really. Write a program or function that takes in a nonempty list of decimal integers (0-9) and outputs a downward pointing "triangle" of digits with the input list at the top where ...
2k views

### Illustrate the square of a binomial

Given (by any means) two different natural numbers (of any reasonable size), output (by any means) the square of their sum as in the examples below: Given 4 and 3, output: ...
3k views

### An infinite FTW

The infinite Fibonacci word is a specific, infinite sequence of binary digits, which are calculated by repeated concatenation of finite binary words. Let us define that a Fibonacci-type word sequence ...
1k views

### Substring Sum Set

Introduction Let's observe this array: [3, 2, 4, 1, 1, 5, 1, 2]. Each element displays the length of the substring which must be summed up. Let's take a look at ...
1k views

### A list of number modulus their indices in the list

A simple one: Take a list of positive integers as input and output the numbers modulus their 1-based index in the list. If the input integers are ...
2k views

### Find a Fixed Point

Given an integer x1 and some black box function f: ℤ → ℤ find a fixed point of f in the ...
2k views

### Magnanimous numbers

Given an positive integer as input determine if it is a magnanimous number. A magnanimous number is a number such that any insertion of a + sign between any two ...
1k views

### Find the nth Fibohexaprime

The challenge this time is to find the nth Fibohexaprime. The definition of a Fibohexaprime is as following: We first observe a list with Fibonacci numbers: ...
3k views

### Print the nth Fibonacci number containing the nth Fibonacci number!

Challenge You must write a program that takes a positive integer n as input, and outputs the nth Fibonacci number (shortened as ...
1k views

### Find the smallest positive integer which has all integers from 1 to n as factors [duplicate]

The question's pretty much described by the title: write a program or function that takes a positive integer n as input, and returns the smallest positive output which has all integers from 1 to n as ...
3k views

### Simplify a continued fraction

Continued fractions are expressions that describe fractions iteratively. They can be represented graphically: Or they can be represented as a list of values: ...
879 views

### Output the simplified Goodstein sequence

A number is in base-b simplified Goodstein form if it is written as b + b + ... + b + c, 0 < c ≤ b The simplified Goodstein sequence of a number starts with ...
4k views

### Compute the inverse of an integer modulo 100000000003

The task is the following. Given an integer x (such that x modulo 100000000003 is not equal ...
1k views

### Minimal sparse rulers

A standard ruler of length n has distance marks at positions 0, 1, ..., n (in whichever units). A sparse ruler has a subset of those marks. A ruler can measure the distance k if it has marks at ...
2k views

### Find an Unrelated Number

Given 2 non-negative integers as input, output a non-negative integer that cannot be created through any mathematical operators on the 2 inputs. For example, given inputs ...
1k views

### Novel Prime Factors of Repunits

The Background Folks were talking prime factorization in chat and we found ourselves talking about repunits. Repunits are a subset of the numbers known as repdigits, which are numbers consisting of ...
2k views

### Sum the diagonals

Take a matrix of positive integers as input, and output the individual sums of the elements on the diagonal lines through the matrix. You shall only count the lines that goes diagonally down and to ...
1k views

### Crazy Librarian's Arithmetic Sequence of Primes

Well, the librarian caught you cheating at your job by using your sorting algorithm, so now you're being punished. You've been ordered to create some code so the librarian can impress the object of ...
1k views

### Dividing Divisive Divisors

Given a positive integer $n$ you can always find a tuple $(k_1,k_2,...,k_m)$ of integers $k_i \geqslant 2$ such that $k_1 \cdot k_2 \cdot ... \cdot k_m = n$ and k_1 | k_2 \text{ , } k_2 | ...
1k views

### (RGS 4/5) Inverting matrices modulo m

Task Given an integer matrix M and a modulus m, find an inverse of M modulo ...
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

### Primes in Different Bases

Challenge: You are given a base 10 number. For each base from 10 counting down to base 2: Take the original input number as a base 10 string, and remove any digits of the number which are invalid ...
908 views

### Create an omnifix calculator

Inspiration. Inverse. Evaluate a given omnifix expression. Omnifix is like normal mathematics' infix notation, but with additional copies of each symbol surrounding the arguments. The outer symbols ...
875 views

### Fun With Permutations

Who doesn't absolutely love permutations, right? I know, they are amazing––so much fun! Well, why not take this fun and make it funner? Here's the challenge: Given an input in the exact form: ...
836 views

### Make an infinite chain

Lets define a class of functions. These functions will map from the positive integers to the positive integers and must satisfy the following requirements: The function must be Bijective, meaning ...
1k views

Related: Is this quadrilateral cyclic? Background A tangential quadrilateral is a quadrilateral which has an incircle: Examples include any square, rhombus, or a kite-like shape. Rectangles or ...
578 views

### Find the submatrix with the smallest mean, 2.0

You're given a n-by-m matrix of integers, where n,m > 3. Your task is to find the 3-by-3 sub-matrix that has the lowest mean, and output this value. Rules and clarifications: The integers will be ...
2k views

### Sum square difference

The sum of the squares of the first ten natural numbers is, $1^2 + 2^2 + \dots + 10^2 = 385$ The square of the sum of the first ten natural numbers is, $(1 + 2 + ... + 10)^2 = 55^2 = 3025$ ...
800 views

### Euler-Poincaré-Characteristic of Polyhedra

Given a triangulation of the surface of a polyhedron p, calculate its Euler-Poincaré-Characteristic χ(p) = V-E+F, where ...
522 views

### Dimensional Analysis

Calculate a product or ratio of SI units. For example, kg m / s s (kilogram-meter per second squared) should return N (newton). ...
2k views

### Prime or highest factor

Challenge: Given an array of non-negative whole numbers numbers in the range of 0 to Infinity, Check whether all of them are primes or not. (You can take input as ...
1k views

### Find the maximum determinant for each size Toeplitz matrix

For a fixed n, consider the n by n Toeplitz matrices with entries which are either 0 or 1. The aim is to find maximum determinant over all such Toeplitz matrices. Task For each ...
3k views

### Test if a given number is a Vampire Number

EDIT: In the interest of increasing the complexity, i've added more to the challenge. In mathematics, a vampire number (or true vampire number) is a composite natural number v, with an even ...
3k views

### Generate strong primes [duplicate]

In number theory, a strong prime is a prime number that is greater than the arithmetic mean of the nearest prime above and below (in other words, it's closer to the following than to the preceding ...
1k views

### Strict partitions of a positive integer

OEIS A000009 counts the number of strict partitions of the integers. A strict partition of a nonnegative integer n is a set of positive integers (so no repetition ...
1k views

### 2 factors factorization

Given a natural number n write a program or function to get a list of all the possible two factors multiplications that can be used to achieve ...
351 views

Many formulas in math involve nested radicals (square root signs inside other square roots signs). Your task here is to draw these using ascii art. Specs You will be given two integers, the number ...
643 views

### 1P5: Earthquake!

USGS's seismometers have just detected a major earthquake! Emergency response teams need a quick estimate of the number of people affected. Write a program to compute this estimate. Your program ...
882 views

### Permutations with Indistinguishable Items

Given a list of integers, output the number of permutations of the integers, with indistinguishable permutations counted once. If there are n integers, and each ...
640 views

### Supersonic domino tilings

Task Write a program that reads three integers m, n either from STDIN or as command-line arguments, prints all possible tilings of a rectangle of dimensions m × n by 2 × 1 and 1 × 2 dominos and ...
960 views

### Find pairs of numbers with a particular LCM and GCD

I was working on a math question with a friend of mine, and we decided to write a script that finds the answer. The original question is as follows: The difference of two natural numbers is 2010 ...
1k views

### Calculate the Kronecker symbol

Relevant links here and here, but here is the short version: You have an input of two integers a and b between negative ...