# Questions tagged [math]

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

1,754 questions
Filter by
Sorted by
Tagged with
1 vote
54 views

### Funny Numbers :D

The task is to calculate the average "funniness" of a given number given the following scoring system: 1 point for each "420" in it 2 points for each "69" in it 3 points ...
3k views

### Raise integer x to power x, without exponentiation built-ins

Task - The title pretty much sums it up: raise an integer x to power x, where 0<x. Restrictions: Use of exponentiation, ...
6k views

### Last digit large number

For a given list of number $[x_1, x_2, x_3, ..., x_n]$ find the last digit of $x_1 ^{x_2 ^ {x_3 ^ {\dots ^ {x_n}}}}$ Example: ...
2k views

### How many ways to cut a number into an equation?

Too bad! I had such a beautiful equation, but I lost all my =+-*, so there is nothing left but a chain of digits, looking like a number: ...
1k views

### Find the smallest integer multiple of a Decimal

The Challenge Given a rational number, determine the smallest number which is a positive integer multiple of it. Eg. ...
257 views

### Generate a Kirkman triple system

Given a universe of $v$ elements, a Kirkman triple system is a set of $(v-1)/2$ classes each having $v/3$ blocks each having three elements, so that every pair of elements appears in exactly ...
636 views

### Find a number which generates all the integers mod q

Consider the integers modulo q where q is prime, a generator is any integer 1 < x < q ...
1k views

2k views

### Vanilla Natural Logarithm Challenge

There is a challenge for multiplying two numbers so I guess this counts too Given as input a positive real number n compute its natural logarithm. Your answer ...
2k views

### Is this polynomial a square?

Given an integral polynomial $p$, determine if $p$ is a square of another integral polynomial. An integral polynomial is a polynomial with only integers as coefficients. For example, $x^2+2x+1$ ...
523 views

### Is it a factor of a polynomial?

A polynomial is divisible by a factor (x-n) if f(n)=0 for a function f. Your job: to ...
938 views

### Calculate the Distance to a Line Segment

The Challenge Given two vertexes and a point calculate the distance to the line segment defined by those points. This can be calculated with the following psudocode ...
4k views

### Matrix Trigonometry

Introduction The two most common trigonometric functions, sine and cosine (or sin and ...
5k views

### Product over a range

Your task is simple: given two integers $a$ and $b$, output $\Pi[a,b]$; that is, the product of the range between $a$ and $b$. You may take $a$ and $b$ in any reasonable format, whether ...
2k views

### Calculate the partitions of N

Your challenge is simple: GIven an integer N, ouput every list of positive integers that sums to N. For example, if the input was 5, you should output ...
2k views

### Characteristic polynomial

The characteristic polynomial of a square matrix $A$ is defined as the polynomial $p_A(x) = \det(Ix-A)$ where $I$ is the identity matrix and $\det$ the determinant. Note that this definition ...
6k views

### Construct the Identity Matrix

The challenge is very simple. Given an integer input n, output the n x n identity matrix. The identity matrix is one that has <...
784 views

### Olympic game scoring [closed]

The challenge is to write a golf-code program that, given n positive real numbers from 0 to 10 (format x.y, y only can be 0 or 5: 0, 0.5, 1, 1.5, 2, 2.5 … 9.5 and 10), discard the lowest and highest ...
454 views

### CGAC2022 Day 3: $n$-dimensional Chocolate Pyramid

Part of Code Golf Advent Calendar 2022 event. See the linked meta post for details. I've got an infinite supply of $n$-dimensional chocolate for some positive integer $n$. The shape of the ...
972 views

### Exponential transform of an integer sequence

The exponential generating function (e.g.f.) of a sequence $a_n$ is defined as the formal power series $f(x) = \sum_{n=0}^{\infty} \frac{a_n}{n!} x^n$. When $a_0 = 0$, we can apply the ...
Let $p(x)$ be a polynomial. We say $a$ is a root of multiplicity $k$ of $p(x)$, if there is another polynomial $s(x)$ such that $p(x)=s(x)(x-a)^k$ and $s(a)\ne0$. For example, the ...