Skip to main content

Questions tagged [math]

The challenge involves mathematics in some central way. Also consider using more specific tags, listed in the tag wiki info.

2 votes
3 answers
24 views

Reduce a string up to idempotency

Objective Given a string consisting of printable ASCII characters (!0x21 ― ~0x7E), treat it as an element in the free idempotent ...
Dannyu NDos's user avatar
  • 5,981
6 votes
4 answers
355 views
+50

Compute Dickman

Input A floating point number \$x\$ between 1 and 8 inclusive. Output The Dickman function of \$x\$. The Dickman–de Bruijn function \$\rho(u)\$ is a continuous function that satisfies the delay ...
Simd's user avatar
  • 3,114
9 votes
12 answers
694 views

Minimum number of select-all/copy/paste steps for a string containing n copies of the original

This challenge is based on this Mathematics answer. Write the shortest program or function that, when given some natural number \$n\$, outputs \$S(n)\$, which is the minimum number of steps for ...
bigyihsuan's user avatar
  • 10.2k
16 votes
3 answers
2k views

Find 10 float64s that give the least accurate sum

Input Integer \$n > 1\$ Output Ten 64 bit floating point numbers between \$-n\$ and \$n\$, inclusive, whose sum is the least accurate. Details and examples. These examples are not claimed to be ...
Simd's user avatar
  • 3,114
13 votes
9 answers
1k views

Sum of square roots (as an algebraic number)

An algebraic number is a number that is a root of a non-zero polynomial with integer coefficients. It is well-known that the sum of two algebraic numbers is algebraic. In particular, the sum of a list ...
alephalpha's user avatar
  • 48.7k
3 votes
7 answers
342 views

Find the most isolated point

Given two non-empty sets of points \$P,T = \{(x,y)\ |\ x,y \in \mathbb{Z} \}\$, find the point \$p \in P\$ such that it is the "most isolated" from all points in \$T\$. The "most ...
bigyihsuan's user avatar
  • 10.2k
13 votes
13 answers
2k views

Compute the degree of a string

The input is a string made of the letters a,b,c only. The output is an integer representing the degree of the sequence. The degree of a sequence is computed as follows: Assume that each of the ...
Erel Segal-Halevi's user avatar
8 votes
4 answers
475 views

How far are you?

Write a program that gets coordinates of two objects on Earth, and calculates how far they are from each other directly in space (a straight line through Earth) and on the surface (through the ...
George Glebov's user avatar
13 votes
11 answers
799 views

*Trivial* near-repdigit perfect powers

Task Output the sequence that precisely consists of the following integers in increasing order: the 2nd and higher powers of 10 (\$10^i\$ where \$i \ge 2\$), the squares of powers of 10 times 2 or 3 (...
Bubbler's user avatar
  • 77.7k
16 votes
19 answers
1k views

Infer pluses and minuses

The problem Consider an equation such as      "3 ± 2 ± 4 ± 1 = 4"      and determine if there exists a sequence of pluses and minuses that makes it arithmetically correct. If it exists, ...
Nicola Sap's user avatar
  • 3,684
26 votes
14 answers
2k views

Is it a cartesian product?

The cartesian product of two multisets \$A\$ and \$B\$ is the multiset of all ordered pairs consisting of an element of \$A\$ and an element of \$B\$. For example, the cartesian product of \$\{1, 2, 7,...
emanresu A's user avatar
  • 39.2k
5 votes
1 answer
307 views

Dishonest dungeon staff

This is a joint post with https://puzzling.stackexchange.com/questions/126255/dishonest-dungeon-staff You are faced with the difficult task to set up a dungeon for adventurers. However you made a deal ...
Fluorine's user avatar
  • 151
10 votes
4 answers
2k views

Output a 1-2-3-5-7... sequence

Follow-up of my previous challenge, inspired by @emanresu A's question, and proven possible by @att (Mathematica solution linked) For the purposes of this challenge, a 1-2-3-5-7... sequence is an ...
Tbw's user avatar
  • 2,093
21 votes
15 answers
2k views

Output a 1-2-3 sequence

For the purposes of this challenge, a 1-2-3 sequence is an infinite sequence of increasing positive integers such that for any positive integer \$n\$, exactly one of \$n, 2n,\$ and \$3n\$ appears in ...
Tbw's user avatar
  • 2,093
18 votes
5 answers
3k views

Draw a Fibonacci Swoosh

Title courtesy of Greg Martin For this challenge, I'll define an arc of size \$k\$ as a single piece of a sine wave with a length of \$k\$ units and an height of \$\frac{k}{4}\$ units: And I'll ...
emanresu A's user avatar
  • 39.2k

15 30 50 per page
1
2 3 4 5
121