Pillai sequence
The Pillai sequence is the sequence of integers that have record numbers of terms in their greedy representations as sums of prime numbers (and one).[src] It is named after Subbayya Sivasankaranarayana Pillai, who first defined it in 1930.[src] 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.[src] However, finding such a representation could involve solving instances of the subset sum problem, which is computationally difficult.[src] Instead, Pillai considered the following simpler greedy algorithm for finding a representation of n as a sum of primes: choose the first prime in the sum to be the largest prime p that is at most n , and then recursively construct the remaining sum recursively for n-p .[src] If this process reaches zero, then it halts; if it reaches one instead of zero, then it must include one in the sum (even though it is not prime), and then halt.[src] For instance, this algorithm represents 122 as 113 + 7 + 2, even though the shorter representations 61 + 61 or 109 + 13 are also possible.[src] The n th number in the Pillai sequence is the smallest number whose greedy representation as a sum of primes (and one) requires n terms.[src] These numbers are :0, 1, 4, 27, 1354, 401429925999155061, ...[src] .…[src]
The Pillai sequence is the sequence of integers that have record numbers of terms in their greedy representations as sums of prime numbers (and one).[src] It is named after Subbayya Sivasankaranarayana Pillai, who first defined it in 1930.[src] 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.[src] However, finding such a representation could involve solving instances of the subset sum problem, which is computationally difficult.[src] Instead, Pillai considered the following simpler greedy algorithm for finding a representation of n as a sum of primes: choose the first prime in the sum to be the largest prime p that is at most n , and then recursively construct the remaining sum recursively for n-p .[src] If this process reaches zero, then it halts; if it reaches one instead of zero, then it must include one in the sum (even though it is not prime), and then halt.[src] For instance, this algorithm represents 122 as 113 + 7 + 2, even though the shorter representations 61 + 61 or 109 + 13 are also possible.[src] The n th number in the Pillai sequence is the smallest number whose greedy representation as a sum of primes (and one) requires n terms.[src] These numbers are 0, 1, 4, 27, 1354, 401429925999155061, ...[src] .[src] Each number a(n) in the sequence is the sum of the previous number a(n-1) with a prime number p , the smallest prime whose following prime gap is larger than a(n-1) .[src] For instance, the number 27 in the sequence is 4 + 23, and the first prime gap larger than 4 is the one between 23 and 29.[src] 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.[src] However, the terms in the sequence grow very rapidly; Cramér's conjecture implies the sequence grows tetrationally.[src] It has been estimated that expressing the next term in the sequence would require "hundreds of millions of digits".[src] ==References==[src]
26 sentences · 26 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"Pillai sequence." encyclopegia.org, 2025, https://encyclopegia.org/wiki/pillai-sequence. Accessed 29 November 2026.
Chicago
"Pillai sequence." encyclopegia.org. Accessed November 29, 2026. https://encyclopegia.org/wiki/pillai-sequence.
APA
encyclopegia.org. (2025). Pillai sequence. Retrieved November 29, 2026, from https://encyclopegia.org/wiki/pillai-sequence
Accessed November 29, 2026 · CC BY-SA 4.0 · citation page · JSON