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

learn more… | top users | synonyms

6
votes
0answers
186 views

Where will the cat go?

A nearly massless cat is dropped in space (don't worry, with a space suit and everything) at the point (x, y, z) with velocity (vx, vy, vz). There is an fixed, infinitely dense planet (with volume of ...
11
votes
1answer
263 views

A tricky infinite sum (or…to infinity and beyond)

This challenge is to write fast code that can perform a computationally difficult infinite sum. Input An n by n matrix P with integer entries that are smaller than 20 in absolute value. When testing ...
-8
votes
0answers
38 views

solving problem step by step, limit x to inf, limit x to 0 and limit x to -1 [on hold]

lim x to inf ((x^4)-3x)/(-2x+5) solving step by step lim x to 0 ((-(cosx)^2)/4x^2) solving step by step lim x to -1 ((x+1)/((6(x^2)+3)^1/2)+3x) solving step by step
20
votes
23answers
2k views

The plus-minus sequence

The plus-minus sequence The plus-minus sequence is one that starts with two seeds, a(0) and b(0). Each iteration of this sequence is the addition and subtraction of the previous two members of the ...
26
votes
13answers
1k views

The Arithmetic Derivative

The derivative of a function is a cornerstone of mathematics, engineering, physics, biology, chemistry, and a large number of other sciences as well. Today we're going to be calculating something only ...
-4
votes
3answers
168 views

Evaluate an infinite sum [on hold]

This challenge is write code that can perform an infinite sum to high precision. Task Your code should compute sum(exp(-x^2), x = -infinity..infinity) to 50 decimal places. The answer should ...
3
votes
4answers
97 views

Is this a Lucas number? [duplicate]

Write a program or function that takes an input greater than or equal to 2. It should output a truthy or falsy value corresponding to whether the input is a Lucas number or not. You may take input ...
14
votes
11answers
427 views

Ravenity of Cube Distance Numbers

Inspired by this Numberphile entry Background The cube distance numbers of an integer n are defined here as the set of integers that are x³ distance away for a given x. For a simple example, with ...
7
votes
2answers
132 views

Count rectangle intersections

The Challenge Given an arbitrary amount of rectangles, output the total count of intersections of those when drawn in a 2D plane. An intersection here is defined as a point P which is crossed by two ...
15
votes
11answers
605 views

Create an ABACABA city

Here is the 3rd ABACABA city: _ A|_| B|__| A|_|_ C|___| A|_| B|__| A|_| It is made out of the ABACABA sequence, which is basically: A (1st iteration) place B - AB repeat A - ABA (2nd iteration) ...
11
votes
3answers
305 views

Solve a Linear Equation

This challenge but with a better spec. Spec Your program will take a linear equation containing a single variable x and output the value of x. Input / Parsing The input will only contain numbers, ...
14
votes
4answers
269 views

How far from the exterior?

Take a 2D region of space divided into axis aligned unit square elements with their centers aligned at integer intervals. An edge is said to be internal if it is shared by two elements, otherwise it ...
7
votes
6answers
349 views

Generate m-sequences

Introduction Maximum-length sequences, usually known as m-sequences, are binary sequences with some interesting properties (pseudo-noise appeareance, optimal periodic autocorrelation) which make them ...
11
votes
3answers
262 views

Trilaterate your position

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 ...
28
votes
1answer
204 views

Addition on Elliptic Curves

Addition on Elliptic Curves Disclaimer: This does not do any justice on the rich topic of elliptic curves. It is simplified a lot. As elliptic curves recently got a lot of media attention in the ...
10
votes
6answers
941 views

On the edges of the hypercube

Your job will be to write a function or a program, that will take an integer n>0 as input and output a list of the edges of the n-dimensional hypercube. In graph theory an edge is defined as a ...
10
votes
16answers
906 views

Print the difference in the Thue-Morse sequence

Note, when I say "negate", I mean replace all ones with zeroes (i.e. a bitwise negation) The Thue-Morse sequence goes like 01101001 The way you generate it is: Start by taking 0. Negate what is ...
12
votes
1answer
197 views

Iterated Moving Average

If we have a list, say the list [9, 2, 4, 4, 5, 5, 7], we can do a moving average across it. Taking a window of say, 3 elements, each element is replaced by a window like such: [[9], [9, 2], [9, ...
12
votes
12answers
529 views

Minimum Scalar Product

Minimum Scalar Product The inspiration for this code golf problem is from Google's code jam competition. The premise behind the problem is, given the input of two vectors of varying lengths, find the ...
4
votes
2answers
164 views

Calculate the Riemann Zeta Function of a Complex Number

Introduction I found this question that was closed because it was unclear, yet it was a nice idea. I'll do my best to make this into a clear challenge. The Riemann Zeta function is a special ...
18
votes
12answers
2k views

Calculate the volume of an object

You can determine the volume of objects based on a given set of dimensions: The volume of a sphere can be determined using a single number, the radius (r) The volume of a cylinder can be determined ...
27
votes
14answers
2k views

Find the powertrain!

The winner (pretty obviously) is Dennis ♦, who used Jelly with 10 bytes! This challenge will still be up here, however results won't be taken anymore. The powertrain of a number is a concept by ...
-5
votes
4answers
155 views

Solve an algebraic expression

The Challenge Your task is to create a program that can solve an algebraic equation. Input Input will consist of a String. The string will be an equality involving the variable x, and follows the ...
7
votes
9answers
298 views

set intersection of two lists

Your goal is to compute the set intersection of two lists of integers. The intersection is defined as the unique un-ordered group of integers found at least once in both input list. Input The input ...
21
votes
15answers
776 views

Vandermonde Determinant

Given a vector of n values (x1,x2,x3,...,xn) return the determinant of the corresponding Vandermonde matrix. This determinant can be written as: Details Your program/function has to accept a list ...
4
votes
2answers
196 views

Bit Manipulator/Reader

Introduction There are often times that we have challenges which require communication of some sort (such as in team KOTH), where density of information may be more important than density of code. ...
9
votes
8answers
314 views

Pascal's Triangle as a 2-dimensional list

Create a Pascal's Triangle that is a nested list and contains zeros in the unused spots. In the output array, the numbers of Pascal's Triangle are separated by zeroes and padded by zeroes on each ...
26
votes
11answers
2k views

One-zero dividend

Challenge description For every positive integer n there exists a number having the form of 111...10...000 that is divisible by n i.e. a decimal number that starts with all 1's and ends with all 0's. ...
42
votes
12answers
2k views

Calculate the number of primes up to n

π(n) is the number of primes less than or equal to n. Input: a natural number, n. Output: π(n). Scoring: This is a fastest-code challenge. Score will be the sum of times for the score cases. I ...
2
votes
1answer
204 views

Implement my method of adding numbers mentally

Note: This challenge has been changed to eliminate the strict whitespace manipulation requirements that made this challenge low-quality. Some rules regarding whitespace have been changed. I'm ...
9
votes
3answers
252 views

Cause maximal disruption to a Straw Poll

Context Straw Poll is a website that is meant for the creation of simple/informal polls. Provided with a list of options, the user can select their choice(s), and the votes are tallied up. There's ...
10
votes
49answers
4k views

Golf the xᵗʰ root of x

While bored in high-school (when I was half my current age...), I found that f(x) = x(x-1) had some interesting properties, including e.g. that the maximum f for 0 ≤ x is f(e), and that the binding ...
18
votes
1answer
145 views

Sandpile integers

Challenge You will be given a positive integer n as input. Output should be a pyramid-like sandpile built on the rules specified below: Each integer "falls" downward from the same initial starting ...
23
votes
31answers
1k views

Adding up the digits and the digits reversed

Given a number > 0, output the sum with all digits (1 .. n) concatenated and reversed and add them up. For example, with n = 6: The numbers 1 to 6 concatenated: 123456 Reversed: 654321 Adding ...
9
votes
1answer
135 views

Taxi me some numbers

Taxicab Numbers or OEIS A011541 are the least numbers that are able to be represented as n different sums of two positive cubed integers, for successive n. You'll need to print out the nth taxicab ...
24
votes
8answers
2k views

That's a prime… almost

If you've ever learned about primes in math class, you've probably have had to, at one point, determine if a number is prime. You've probably messed up while you were still learning them, for example, ...
10
votes
1answer
252 views

How many letters in this word?

Inspired by Project Euler #17, this is your challenge. Write a full program or function that takes a number as input, then print or return how many letters it would take to count up to and including ...
11
votes
6answers
674 views

A Free Sample of Autocorrelation

Consider a 1-dimensional, real-valued vector x that represents observations of some process measured at equally spaced intervals over time. We call x a time series. Let n denote the length of x and ...
6
votes
0answers
128 views

Solving variants of the blue-eyes puzzle

The original "Blue Eyes" puzzle is given here (and below). A group of people with assorted eye colors live on an island. They are all perfect logicians -- if a conclusion can be logically ...
13
votes
20answers
1k views

Output the juggler sequence

The juggler sequence is described as follows. Beginning with an input a1, the next term is defined by the recurrence relation The sequence terminates when it reaches 1, as all subsequent terms ...
15
votes
13answers
867 views

Get the closest value to number

In this code golf, you need to get the closest number from another one in a list. The output may be the closest number to the input. Example: value: (Input) 5 --- [1,2,3] --- 3 And, the program ...
10
votes
1answer
157 views

Residue Number System

In the vein of large number challenges I thought this one might be interesting. In this challenge, we will be using the Residue Number System (RNS) to perform addition, subtraction, and ...
14
votes
9answers
302 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 is allowed, and order does not ...
11
votes
15answers
296 views

Congruence Relations

Given 3 positive integers a, b, and n (whose maximum values are the maximum representable integer value in your language), output a truthy value if a ≡ b (mod n), and falsey otherwise. For those ...
6
votes
1answer
97 views

Calculating Parabolic Curves in 3D Space

Task Write a program or function that will determine if a point in 3D space lies on a 2D parabolic curve. Input 3 points in 3D space vertex of a 2D parabolic curve arbitrary point on the curve ...
15
votes
1answer
354 views

Same-color arithmetic progressions

Van der Waerden's theorem says that For any given positive integers r and k, there is some number N such that if the integers {1, 2, ..., N} are colored, each with one of r different colors, ...
6
votes
3answers
144 views

Inverse Champernowne Substrings

The Champernowne Constant is the irrational number 0.1234567891011... extending ad infinum. We've done a question about it before. But this question is about its reciprocal, known as the Inverse ...
28
votes
18answers
3k views

Sort by Multiplying

You should write a program or function that given a list of positive integers multiplies each element with the smallest positive integer possible to create a strictly increasing list. For example if ...
-1
votes
1answer
172 views

Find the square root, BUT [closed]

Write a square root function that takes an input, positive or negative, and calculate it's square root, correct up to six decimal places (then truncate after the sixth decimal place). But, you cannot ...
3
votes
7answers
440 views

Print cos(2π/17) exactly

One way to construct a regular heptadecagon starts with drawing a horizontal line of length 1 from the center to a vertex. Then the distance along that line from the center to the second vertex is ...