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.

Showing 1-4 of 4 results.

A118500 A variation on Flavius's sieves (A000960, A099207): Start with the Chen primes; at the k-th sieving step, remove every (k+1)-st term of the sequence remaining after the (k-1)-st sieving step; iterate.

Original entry on oeis.org

2, 5, 17, 41, 83, 137, 233, 317, 467, 617, 761, 941, 1259, 1427, 1913, 2281, 2531, 2957, 3511, 3797, 4447, 5153, 5351, 6481, 6863, 7669, 8581, 9533, 10259, 11497, 12569, 13441, 14081, 15737, 16187, 17657, 19541, 19991, 21587, 23017, 24317
Offset: 0

Views

Author

Jani Melik, May 05 2006

Keywords

Examples

			Start with
2 3 5 7 11 13 17 19 23 29 31 37 41 47 53 59 67 71 83 89 101 107 109 113 127 131 ... and delete every second term, giving
2 5 11 17 23 31 41 53 67 83 101 109 127 ... and delete every 3rd term, giving
2 5 17 23 41 53 83 101 127 ... and delete every 4th term, giving
.... Continue forever and what's left is the sequence.
		

Crossrefs

Programs

  • Maple
    ts_chen:= proc(n) local i, ans; ans:=[ ]: for i from 1 to n do if ( isprime(i) = 'true') then if ( isprime(i+2) = 'true' or numtheory[bigomega](i+2) = 2) then ans:=[ op(ans), i ] fi fi od: return ans end: S[1]:=convert(ts_chen(25000), set): for n from 2 to 2500 do S[n]:=S[n-1] minus {seq(S[n-1][n*i], i=1..nops(S[n-1])/n)} od: convert(S[2100],list);

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.

Original entry on oeis.org

1, 3, 7, 9, 15, 19, 25, 31, 33, 37, 45, 51, 61, 63, 67, 69, 81, 85, 97, 105, 109, 111, 123, 129, 135, 141, 145, 151, 159, 169, 183, 189, 195, 201, 211, 213, 219, 225, 229, 241, 261, 265, 273, 277, 289, 291, 307, 315, 319, 321, 325, 339, 351, 355, 361, 375, 381
Offset: 1

Views

Author

N. J. A. Sloane, Nov 16 2004

Keywords

Examples

			Start with
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ... and delete every second term, giving
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 ... and delete every 3rd term, giving
1 3 7 9 13 15 19 21 25 27 ... and delete every 5th term, giving
1 3 7 9 15 19 21 25 ... and delete every 7th term, giving
.... Continue forever and what's left is the sequence.
		

Crossrefs

Programs

  • Maple
    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
  • Mathematica
    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 *)
  • Python
    import sympy
    from sympy import prime
    def a(n):
      x = 1
      lst = []
      lst.extend(range(1, 1000))
      while x <= n:
        lst1 = []
        for i in lst:
          if (lst.index(i)+1)%prime(x)!=0:
            lst1.append(i)
        lst.clear()
        lst.extend(lst1)
        x += 1
      return lst1[n-1]
    n = 1
    while n < 100:
      print(a(n), end=', ')
      n += 1
    # Derek Orr, Jun 16 2014

Extensions

More terms from Ray Chandler, Nov 16 2004

A099361 A variation on the sieve of Eratosthenes (A000040): Start with the primes; the first term is 2, which is a(1) and we cross off every second prime starting with 2; the next prime not crossed off is 3, which is a(2) and we cross off every third prime starting with 3; the next prime not crossed off is 7, which is a(3) and we cross off every 7th prime starting with 7; and so on.

Original entry on oeis.org

2, 3, 7, 13, 29, 37, 53, 79, 89, 107, 113, 139, 151, 173, 181, 223, 239, 251, 311, 317, 349, 359, 383, 397, 421, 463, 491, 503, 541, 577, 593, 613, 619, 647, 659, 683, 743, 787, 821, 857, 863, 887, 911, 983, 997, 1033, 1061, 1151, 1163, 1193, 1213, 1249
Offset: 1

Views

Author

N. J. A. Sloane, Nov 18 2004

Keywords

Comments

In contrast to Flavius's sieve (A000960), primes are not erased when they are crossed off; that is, primes get crossed off multiple times (see A099362).

Examples

			The first few sieving stages are as follows (X or XX indicates a prime that has been crossed off one or more times):
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 ...
2 3 X 7 XX 13 XX 19 XX 29 XX 37 XX 43 XX 53 XX 61 XX 71 XX 79 XX 89 XX ...
2 3 X 7 XX 13 XX XX XX 29 XX 37 XX XX XX 53 XX 61 XX XX XX 79 XX 89 XX ...
2 3 X 7 XX 13 XX XX XX 29 XX 37 XX XX XX 53 XX XX XX XX XX 79 XX 89 XX ...
.... Continue forever and the numbers not crossed off give the sequence.
		

Crossrefs

Programs

  • Mathematica
    nn=300; a=Prime[Range[nn]]; Do[p=a[[i]]; If[p>0, Do[a[[j]]=0, {j, i+p, nn, p}]], {i, nn}]; Rest[Union[a]] (* T. D. Noe, Nov 18 2004 *)

Extensions

More terms from T. D. Noe and Ray Chandler, Nov 18 2004

A099243 A variation on Flavius's sieve (A000960): Start with the primes; 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.

Original entry on oeis.org

2, 5, 17, 23, 47, 67, 97, 127, 137, 157, 197, 233, 283, 307, 331, 347, 419, 439, 509, 571, 599, 607, 677, 727, 761, 811, 829, 877, 937, 1009, 1093, 1129, 1187, 1229, 1297, 1303, 1367, 1427, 1447, 1523, 1663, 1697, 1753, 1787, 1879, 1901, 2027, 2087, 2113, 2131
Offset: 1

Views

Author

N. J. A. Sloane, Nov 16 2004

Keywords

Examples

			Start with
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 ... and delete every second term, giving
2 5 11 17 23 31 41 47 59 67 73 83 97 103 ... and delete every 3rd term, giving
2 5 17 23 41 47 67 73 97 103 ... and delete every 5th term, giving
.... Continue forever and what's left is the sequence.
		

Crossrefs

Programs

  • Maple
    S[1]:={seq(ithprime(i),i=1..322)}: for n from 2 to 322 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[322]; # Emeric Deutsch, Nov 17 2004
  • Mathematica
    alle[0]=Table[Prime[i], {i, 1, 10000}]; alle[i_]:=alle[i]= Module[{zuloeschen= Table[alle[i-1][[j]], {j, Prime[i], Length[alle[i-1]], Prime[i]}]}, Complement[alle[i-1], zuloeschen]] (* alle[i] gives the sequence after the i-th iteration and here the first Prime[i] elements are fixed and will not chang in later iterations. So to get the first Prime[10]=29 terms, type *) Take[alle[10], Prime[10]] (* Michael Taktikos, Nov 16 2004 *)

Extensions

More terms from Michael Taktikos and Ray Chandler, Nov 16 2004
Showing 1-4 of 4 results.