### Communities

tag:snake search within a tag
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
created:<1w created < 1 week ago
post_type:xxxx type of post
Sandbox

# Posts tagged math

This tag doesn't have any usage information yet.

This tag doesn't have a detailed wiki yet.

41 posts
50%
+0 −0

posted 12mo ago by trichoplax‭  ·  edited 9d ago by trichoplax‭

Article math
58%
+5 −3

In this challenge, add 2 integers, but if both the integers are 2, output 5. Shortest code in each language wins! Example ungolfed program in Python 3.x def add(x, y): if x == 2 and y == 2: ...

20 answers  ·  posted 2y ago by General Sebast1an‭  ·  last activity 2mo ago by qwr‭

Question math
75%
+4 −0

The probability of rolling every number from 1 to 6 with $N$ six-sided dice. Input A positive integer $N$. Your code must work for inputs up to and including 10, but may crash, error, or give ...

4 answers  ·  posted 3mo ago by trichoplax‭  ·  last activity 3mo ago by RubenVerg‭

Question math
66%
+2 −0

You roll $N$ six-sided dice simultaneously. Your score is the highest number rolled. If you play this game many times, what is the expected value (mean) of your score? Input A positive integer ...

2 answers  ·  posted 3mo ago by trichoplax‭  ·  last activity 3mo ago by RubenVerg‭

Question math
60%
+1 −0

posted 3mo ago by trichoplax‭  ·  edited 3mo ago by trichoplax‭

Article math
66%
+2 −0

posted 3mo ago by trichoplax‭  ·  edited 3mo ago by trichoplax‭

Article math
66%
+2 −0

posted 2y ago by General Sebast1an‭  ·  edited 3mo ago by trichoplax‭

Article math
75%
+4 −0

posted 2y ago by General Sebast1an‭  ·  edited 3mo ago by trichoplax‭

Article math
60%
+1 −0

posted 2y ago by General Sebast1an‭  ·  edited 3mo ago by trichoplax‭

Article math
71%
+3 −0

posted 2y ago by General Sebast1an‭  ·  edited 3mo ago by trichoplax‭

Article math
71%
+3 −0

posted 2y ago by Moshi‭  ·  edited 3mo ago by trichoplax‭

Article math
83%
+8 −0

Challenge A simple challenge: Given a two-dimensional matrix (an array of arrays) of real numbers, compute the determinant. The determinant of a matrix is a mathematical construct used in many ap...

9 answers  ·  posted 2y ago by Moshi‭  ·  last activity 6mo ago by aspen138‭

Question math
50%
+0 −0

Given a potentially recurring binary string, output the number it represents, as a fraction in lowest terms. The notation used in this challenge for recurring digits is non-standard. An r is used ...

0 answers  ·  posted 12mo ago by trichoplax‭  ·  edited 12mo ago by trichoplax‭

Question math
71%
+3 −0

Take an input string representing a number and convert it to decimal (base 10). However, the base of the input is not specified. Assume the input is in the smallest base for which its digits are va...

5 answers  ·  posted 1y ago by trichoplax‭  ·  last activity 1y ago by Shaggy‭

Question math
71%
+3 −0

Challenge Given an array in any suitable format, create a frequency table for it. i.e: Pair each unique element with the number of times it appears in the array. You can return the frequency tabl...

10 answers  ·  posted 1y ago by Razetime‭  ·  last activity 1y ago by Moshi‭

Question math
81%
+7 −0

Challenge A Niven number is a positive integer which is divisible by the sum of its digits. For example, 81 -> 8+1=9 -> 81%9=0. Your task is to find the first n Niven numbers, given n. Te...

7 answers  ·  posted 1y ago by Razetime‭  ·  last activity 1y ago by Shaggy‭

Question math
66%
+6 −2

Multiply complex numbers. 2 space-seperated ones will be input, as follows: (update: you can replace i with j or some other symbol if needed) a+bi -a+bi a-bi -a-bi where a and b are integers ...

7 answers  ·  posted 2y ago by heav‭  ·  last activity 1y ago by __blackjack__‭

Question math
81%
+7 −0

Get ready for a comparatively dry question - this is intended to be one of the "the"s of the code-golfing dictionary. Create a program which inputs a base 10 non-negative whole number (without lea...

16 answers  ·  posted 2y ago by AndrewTheCodegolfer‭  ·  last activity 1y ago by Olin Lathrop‭

Question math
50%
+0 −0

posted 1y ago by Razetime‭

Article math
83%
+8 −0

Goldbach's Conjecture states that every even whole number greater than 2 is the sum of 2 prime numbers. Your task is to return those 2 prime numbers, given an even whole number as input. There are ...

10 answers  ·  posted 2y ago by Quintec‭  ·  last activity 1y ago by torres‭

Question math
81%
+7 −0

Background Check out this video on the Collatz conjecture, also known as A006577. If you don't know what this is, we're given an equation of $3x + 1$, and it is applied this way: If $x$ is odd...

15 answers  ·  posted 2y ago by General Sebast1an‭  ·  last activity 1y ago by torres‭

Question math
85%
+10 −0

Challenge A catalogue type challenge that simply asks: Given an integer n (where n>=0) as input return a truthy value if n is a perfect square or a falsey value if not. Rules You may take...

20 answers  ·  posted 2y ago by Shaggy‭  ·  last activity 1y ago by Zakk‭

Question math
66%
+2 −0

posted 2y ago by user‭  ·  edited 1y ago by user‭

Article math
81%
+7 −0

Challenge Make a program that takes input of 3 non-negative integers: a result and 2 other values that once calculated results to the 3rd value. The program must figure out how to get the 2 fir...

5 answers  ·  posted 2y ago by General Sebast1an‭  ·  last activity 1y ago by radarek‭

Question math
87%
+12 −0

Challenge Given a list of n numbers and x, compute $a + bx^1 + cx^{2} + ... + zx^{n-1}$, where a is the first value in the list, b is the second, etc. n is at most 256 and at least 0. The input va...

20 answers  ·  posted 3y ago by moony‭  ·  last activity 1y ago by south‭

Question math
66%
+2 −0

Background Inspired by this challenge that is also a mathematical English translator. Challenge Write a program that translates a mathematical expression using English with the following specifi...

1 answer  ·  posted 2y ago by General Sebast1an‭  ·  edited 2y ago by General Sebast1an‭

Question math
66%
+2 −0

Challenge Given the roots of a polynomial (that is, the $x$ values where the polynomial evaluates to zero), as an array of real numbers, return the polynomial's coefficients. That is, given real ...

4 answers  ·  posted 2y ago by Moshi‭  ·  last activity 2y ago by Moshi‭

Question math
75%
+4 −0

posted 2y ago by Moshi‭  ·  edited 2y ago by Moshi‭

Article math
60%
+1 −0

Create a program that gets all perfect squares starting from 0 or 1 without using any methods of multiplication (repetitive addition) and exponentiation (repetitive multiplication). Output them for...

7 answers  ·  posted 2y ago by General Sebast1an‭  ·  last activity 2y ago by General Sebast1an‭

Question math
75%
+4 −0
Sandbox Compute the determinant

posted 2y ago by Moshi‭  ·  edited 2y ago by Moshi‭

Article math
50%
+0 −0
Sandbox Recreate modulo [cancelled]

posted 2y ago by General Sebast1an‭  ·  edited 2y ago by General Sebast1an‭

Article math
60%
+1 −0

Challenge Create a program that takes input of a string and outputs an integer using the following calculation system: The string can only contain +, -, *, /, ^, ! (or a different character; ! ...

1 answer  ·  posted 2y ago by General Sebast1an‭  ·  edited 2y ago by General Sebast1an‭

Question math
80%
+6 −0

A Juggler sequence is a sequence that begins with a positive integer $a_0$ and each subsequent term is calculated as: a_{k+1} = \begin{cases} \left \lfloor a_k ^ \frac 1 2 \right \rfloor, &...

9 answers  ·  posted 2y ago by caird coinheringaahing‭  ·  last activity 2y ago by Shaggy‭

Question math
77%
+5 −0

Abundant numbers are numbers which are less than their proper divisor sum. For example $18$ is abundant as $1 + 2 + 3 + 6 + 9 = 21 > 18$ Deficient numbers are numbers which are greater than the...

8 answers  ·  posted 2y ago by caird coinheringaahing‭  ·  last activity 2y ago by General Sebast1an‭

Question math
84%
+9 −0

Heavily based on this closed challenge from SE. Description A Sumac sequence starts with two non-zero integers $t_1$ and $t_2.$ The next term, $t_3 = t_1 - t_2$ More generally, $t_n = t_{n-2} ... 9 answers · posted 3y ago by Razetime‭ · edited 2y ago by General Sebast1an‭ Question math 71% +3 −0 posted 2y ago by user‭ · edited 2y ago by user‭ Article math 50% +0 −0 posted 2y ago by General Sebast1an‭ · edited 2y ago by General Sebast1an‭ Article math 77% +5 −0 About Negabinary Negabinary means base negative two (-2). That is, the$n$th place value is determined by$(-2)^n\$. Negabinary numbers can be evaluated just like any other base system. For exampl...

3 answers  ·  posted 2y ago by Moshi‭  ·  last activity 2y ago by Shaggy‭

Question math
71%
+3 −0

Define a cool number as a number whose proper divisors (all except for the number itself) have an integral mean. Define a really cool number as a number whose divisors (including itself) are all co...

3 answers  ·  posted 2y ago by Quintec‭  ·  last activity 2y ago by user‭

Question math
60%
+1 −0

posted 3y ago by Hakerh400‭  ·  edited 3y ago by Hakerh400‭

Article math
66%
+2 −0

posted 3y ago by Razetime‭  ·  edited 3y ago by Razetime‭

Article math