Online Lemoine’s Conjecture Demo in Go

2n + 1 = p + 2q always has a solution in primes p and q (not necessarily distinct) for n > 2. This online demo finds p and q for given odd number greater than 5. The demo is written in Go and compiled to JavaScript using GopherJS.

 read more »

Lemoine’s Conjecture

2n + 1 = p + 2q always has a solution in primes p and q (not necessarily distinct) for n > 2. Write a Go program to find p and q for given odd number greater than 5.

 read more »

Descartes' rules of signs

Hard to believe that I don't remember seeing Descartes' rules of signs before -- you'd think this is impossible given the time I spent on ...

 read more »

Radon's theorem

I came across Radon's theorem the other day, and found this proof. It must have been discovered before.

 read more »

Count spread in O(n)

This is not hard but still interesting. A spread of an array of numbers is the difference between its maximum and minimum. Given an array...

 read more »

Balancing numbers

There are 2n+1 coins each associated with a weight. When we remove any coin, we can split the rest into two piles each with n coins...

 read more »

No crossing!

On the 2D plane there are (n) blue and (n) red points, no three of them are co-linear. Then we can always pair a blue point with a red ...

 read more »

[Golang] Goldbach's conjecture

Goldbach's conjecture - Every even integer greater than 2 can be written as the sum of two primes. Given a positive even integer, write a Go program to find the two primes.

 read more »

2017 APMO Problem 3

Let (A(n)) denote the number of sequences (a_1ge a_2gecdots{}ge a_k) of positive integers for which (a_1+cdots+a_k = n) and each ...

 read more »

APMO 2017 Problem 1

We call a (5)-tuple of integers arrangeable if its elements can be labeled (a, b, c, d, e) in some order so that (a-b+c-d+e=29). Deter...

 read more »

2009 USAMO Problem 3

I found a different solution to the second part of this problem. We define a chessboard polygon to be a polygon whose edges are situate...

 read more »

USAMO 2017 Problem 2

Let (m_1, m_2, ldots, m_n) be a collection of (n) positive integers, not necessarily distinct. For any sequence of integers (A = (a_1...

 read more »

USAMO 2008 Problem 3

The problem is rephrased. Q: A diamond of size n consists of 2n rows of nodes with lengths from top to bottom being 1, 3, 5, ..., 2n-1...

 read more »

USAMO 2017 Problem 4

Let (P_1, P_2, dots, P_{2n}) be (2n) distinct points on the unit circle (x^2+y^2=1), other than ((1,0)). Each point is colored eit...

 read more »

IMO 2007 Problem 3

In a mathematical competition some competitors are friends. Friendship is always mutual. Call a group of competitors a clique if each two of...

 read more »

IMO 2016 Problem 6

There are n>=2 line segments in the plane such that every two segments cross and no three segments meet at a point. Geoff has to choose an ...

 read more »

[Algorithm] Magical Recurrence

In a recent algorithmic coding contest which I didn't do well, the hardest problem killed me. It distinguished me from other superior coders. But it's still an interesting one. The problem is essentially to solve a 0/1 knapsack problem on a tree where each node is associated with an …

 read more »