# Questions tagged [math]

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

1,580 questions
Filter by
Sorted by
Tagged with
332 views

### Multiplication for geometric algebra

The basis vectors for geometric algebra are $$(e_0=1), e_1, e_2,\dots,e_n$$ They all square to 1 (we do not consider vectors which square to -1 or zero) $$e_i \cdot e_i = 1$$ They are associative and ...
139 views

### Pythagoras' Golfing Grid [closed]

Recently, I created a binary word search that got me working with grids. It was fun, so I wanted to create some more similar content. Meet Pythagoras' Golfing grid: Each of ...
630 views

### Written Word Equation

Word equations, but not as you know it! Given a sentence which will include two numbers, numerically, and a spelt operator, in the order seen in the examples, your goal is to give the numerical answer ...
294 views

### Yet another coin flipping problem

Problem Starting with a set of 10 coins at the start where all coins are tails up, and given n number of integers $x_1, x_2, x_3... x_n$ representing n rounds of coin flipping. At each round, we ...
1k views

### Minimally prepend numbers to get a symmetric Young diagram

Background A Young diagram is a diagram that represents a nonincreasing sequence of positive integers using left-justified rows of squares. As an example, 5, 4, 1 ...
530 views

### Generate all $3\times 3$ magic squares

Though challenges involving magic squares abound on this site, none I can find so far ask the golfer to print / output all normal magic squares of a certain size. To be clear, a normal magic square of ...
904 views

### Boustrophedon transform

Related: Boustrophedonise, Output the Euler Numbers (Maybe a new golfing opportunity?) Background Boustrophedon transform (OEIS Wiki) is a kind of transformation on integer sequences. Given a sequence ...
470 views

### Is this an interval graph?

Background An interval graph (Wikipedia, MathWorld, GraphClasses) is an undirected graph derived from a set of intervals on a line. Each vertex represents an interval, and an edge is present between ...
217 views

### Bijection between $\mathbb N$ and at-most-$n$-ary trees

Background Related: a golflang theory I posted in TNB a while ago At-most-$n$-ary trees are rooted trees where each internal node has between 1 and $n$ children (inclusive). Two trees are ...
532 views

### Maximal hexagonal dot pattern

Challenge Imagine a hexagonal grid as shown below. Let's call such a grid has size $n$ if it has $n$ dots on one side. The following is one of size 3: ...
242 views

### Flatten a parabola keeping the distances between points along the curve constant

Background Math SE's HNQ How to straighten a parabola? has 4,000+ views, ~60 up votes, 16 bookmarks and six answers so far and has a related companion HNQ in Mathematica SE How to straighten a curve? ...
205 views

183 views

### Minkowski sum of two convex polygons

Background Minkowski addition is a binary operation on two sets of points (usually geometric objects) in the Euclidean space. The Minkowski sum of two sets $A$ and $B$ is formally defined as ...
882 views

6k views

### iHateOddNumbers

Task Given a non-negative number, check if it's odd or even. In case it's even, output that number. Otherwise, throw any exception/error that your language supports, and stop the program. Example with ...
510 views

### Sums of square roots

Program the sequence $R_k$: all numbers that are sum of square roots of some(maybe one) natural numbers $\left\{\sum_{i\in A}\sqrt i\middle|A\subset \mathbb{N}\right\}$, in ascending order without ...
114 views

### Conic Sections (simplified)

Given the equation of a non-parabolic conic section, output its characteristics. Spec Some info on conic sections: for more info visit Wikipedia From an equation of the form $ax^2+bx+cy^2+dy+E=0$, ...
739 views

2k views

### Triangle-style sequences

Consider the triangular numbers and their forward differences: $$T = 1, 3, 6, 10, 15, 21, ... \\ \Delta T = 2,3,4,5,6, ...$$ If we alter $\Delta T$ so that it begins with a different integer, we ...
1k views

### Multiply elements of the dihedral group

This is a copy cat question of Simplify ijk string applied to the other nonabelian group of order 8. See also Dihedral group composition with custom labels. Challenge Given a string made of ...
2k views

### Simplify ijk-string

Related: Multiply Quaternions Challenge Given a string made of ijk, interpret it as the product of imaginary units of quaternion and simplify it into one of the ...
582 views

### Calculate $\lfloor n \log_2(n) \rfloor$, exactly

Given an integer $n \ge 2$, you need to calculate $\lfloor n \log_2(n) \rfloor$, assuming all integers in your language are unbounded. However, you may not ignore floating-point errors - for ...
405 views

### Compute the size of intersections of sets

Input A positive integer N representing the size of the problem and four positive integers v, x, y, z. Output This is what your code should compute. Consider a set of N distinct integers and consider ...
4k views

### Convince me Gabriel's Horn is possible

From Wikipedia, Gabriel's Horn is a particular geometric figure that has infinite surface area but finite volume. I discovered this definition in this Vsauce's video (starting at 0:22) where I took ...
1k views

### Exact generalised harmonic numbers

The generalised harmonic number of order $m$ of $n$ is $$H_{n,m} = \sum_{k=1}^n \frac 1 {k^m}$$ For example, the harmonic numbers are $H_{n,1}$, and $H_{\infty,2} = \frac {\pi^2} 6$. These are ...
2k views

### Sum of first n terms of this series

Given a digit x (between 0 to 9, inclusive) and a number n, calculate the sum of the first n ...
An addition-subtraction chain, is a sequence $a_1, a_2, a_3, ... ,a_n$, such that $a_1=1$ and for all $i > 1$, there exist $j,k<i$ such that $a_i = a_j \pm a_k$. Your task, is given a ...