OFFSET
1,1
COMMENTS
Apply the lucky number sieve to the sequence of primes (rather than to the positive integers). Start with the full prime sequence [2, 3, 5, 7, 11, 13, ...]. At each step k >= 1, let s_k be the current second element of the surviving sequence; remove every s_k-th term. The sequence consists of the primes that survive all steps.
This sequence is NOT the same as A031157 (numbers that are both lucky and prime). The lucky sieve applied to the primes uses the positional structure of the prime sequence, not the value structure of the integers, so different primes survive. For example, 11 is in this sequence (it survives the lucky sieve on primes) but 11 is not a lucky number. Conversely, 13 is a lucky prime (A031157) but does not survive the lucky sieve on primes.
The survival fraction among primes up to N decreases slowly: 73/168 = 43.5% for N=1000, 452/1229 = 36.8% for N=10000, 3129/9592 = 32.6% for N=100000. The asymptotic density among primes is an open question.
EXAMPLE
Starting with primes: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, ...
Step 1: second element is 3; remove every 3rd prime (positions 3, 6, 9, ...): removes 5, 13, 23, 37, 47, ... Survivors: 2, 3, 7, 11, 17, 19, 29, 31, 41, 43, 53, 59, 67, ...
Step 2: second element is still 3; remove every 3rd survivor: removes 7, 19, 41, 59, ... Survivors: 2, 3, 11, 17, 29, 31, 43, 53, 67, 71, 83, 97, 107, ...
Step 3: second element is now 11; remove every 11th survivor: removes 83, 211, ... The process continues until the step size exceeds the sequence length.
MATHEMATICA
luckySieveOnSeq[seq_] := Module[{s = seq, i = 2},
While[i <= Length[s] && s[[i]] <= Length[s],
s = Delete[s, Table[{j}, {j, s[[i]], Length[s], s[[i]]}]];
i++];
s];
luckySieveOnSeq[Prime[Range[200]]]
PROG
(Python)
from sympy import primerange
def lucky_sieve_on_primes(limit):
s = list(primerange(limit+1))
i = 1
while i < len(s) and s[i] <= len(s):
step = s[i]
s = [s[j] for j in range(len(s)) if (j+1) % step != 0]
i += 1
return s
print(lucky_sieve_on_primes(1000))
CROSSREFS
KEYWORD
nonn
AUTHOR
Nova Spivack, Mar 20 2026
STATUS
approved
