cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A099204 A variation on Flavius's sieve (A000960): Start with the natural numbers; at the k-th sieving step, remove every p-th term of the sequence remaining after the (k-1)-st sieving step, where p is the k-th prime; iterate.

This page as a plain text file.
%I A099204 #25 May 22 2025 10:21:35
%S A099204 1,3,7,9,15,19,25,31,33,37,45,51,61,63,67,69,81,85,97,105,109,111,123,
%T A099204 129,135,141,145,151,159,169,183,189,195,201,211,213,219,225,229,241,
%U A099204 261,265,273,277,289,291,307,315,319,321,325,339,351,355,361,375,381
%N A099204 A variation on Flavius's sieve (A000960): Start with the natural numbers; at the k-th sieving step, remove every p-th term of the sequence remaining after the (k-1)-st sieving step, where p is the k-th prime; iterate.
%H A099204 Donovan Johnson, <a href="/A099204/b099204.txt">Table of n, a(n) for n = 1..10000</a>
%H A099204 <a href="/index/Si#sieve">Index entries for sequences generated by sieves</a>
%e A099204 Start with
%e A099204 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ... and delete every second term, giving
%e A099204 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 ... and delete every 3rd term, giving
%e A099204 1 3 7 9 13 15 19 21 25 27 ... and delete every 5th term, giving
%e A099204 1 3 7 9 15 19 21 25 ... and delete every 7th term, giving
%e A099204 .... Continue forever and what's left is the sequence.
%p A099204 S[1]:={seq(i,i=1..390)}: for n from 2 to 390 do S[n]:=S[n-1] minus {seq(S[n-1][ithprime(n-1)*i],i=1..nops(S[n-1])/ithprime(n-1))} od: S[390]; # _Emeric Deutsch_, Nov 17 2004
%t A099204 Clear[l,ps];ps=Prime[Range[100]];l=Range[400];Do[l=Drop[l,{First[ps],-1, First[ps]}];ps=Rest[ps],{17}];l (* _Harvey P. Dale_, Sep 03 2011 *)
%o A099204 (Python)
%o A099204 import sympy
%o A099204 from sympy import prime
%o A099204 def a(n):
%o A099204   x = 1
%o A099204   lst = []
%o A099204   lst.extend(range(1, 1000))
%o A099204   while x <= n:
%o A099204     lst1 = []
%o A099204     for i in lst:
%o A099204       if (lst.index(i)+1)%prime(x)!=0:
%o A099204         lst1.append(i)
%o A099204     lst.clear()
%o A099204     lst.extend(lst1)
%o A099204     x += 1
%o A099204   return lst1[n-1]
%o A099204 n = 1
%o A099204 while n < 100:
%o A099204   print(a(n), end=', ')
%o A099204   n += 1
%o A099204 # _Derek Orr_, Jun 16 2014
%Y A099204 Cf. A000960, A099207, A099243.
%K A099204 nonn,easy
%O A099204 1,2
%A A099204 _N. J. A. Sloane_, Nov 16 2004
%E A099204 More terms from _Ray Chandler_, Nov 16 2004