The Pillai sequence is the sequence of integers that have a record number of terms in their greedy representations as sums of prime numbers (and one).
It is named after Subbayya Sivasankaranarayana Pillai, who first defined it in 1930.
[1] It would follow from Goldbach's conjecture that every integer greater than one can be represented as a sum of at most three prime numbers.
However, finding such a representation could involve solving instances of the subset sum problem, which is computationally difficult.
Instead, Pillai considered the following simpler greedy algorithm for finding a representation of
And if it reaches one instead of zero, it must include one in the sum (even though it is not prime), and then halt.
[2] For instance, the number 27 in the sequence is 4 + 23, where the first prime gap larger than 4 is the one between 23 and 29.
Because the prime numbers become less dense as they become larger (as quantified by the prime number theorem), there is always a prime gap larger than any term in the Pillai sequence, so the sequence continues to an infinite number of terms.
It has been estimated that expressing the next term in the sequence would require "hundreds of millions of digits".