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.

A249876 Pseudo-lucky numbers.

Original entry on oeis.org

1, 3, 5, 7, 11, 13, 17, 21, 23, 25, 31, 35, 41, 43, 45, 47, 55, 57, 63, 65, 73, 75, 83, 87, 95, 97, 101, 105, 107, 113, 123, 127, 131, 133, 141, 143, 147, 151, 153, 161, 175, 177, 183, 185, 197, 201, 211, 213, 215, 217, 227, 233, 235, 237, 251, 255, 265, 267
Offset: 1

Views

Author

Robert FERREOL, Nov 07 2014

Keywords

Comments

Appears to grow more slowly than the Lucky numbers. - Jon Perry, Nov 07 2014

Examples

			Start with the natural numbers. The 2nd number is 2, so delete every 2nd number, leaving 1 3 5 7 9 11 13 15 17 19...; the 3rd number remaining is 5, so delete every 5th number, leaving 1 3 5 7 11 13 15 17 ...; now delete every 7th number, leaving 1 3 5 7 11 13 17 ...; now delete every 11th number; etc.
		

Crossrefs

Cf. A000959 (Lucky numbers).

Programs

  • Maple
    L:= [seq(i, i=1..10^3)]:
    for n from 2 while n < nops(L) do
      r:= L[n];
      L:= subsop(seq(r*i=NULL, i=1..nops(L)/r), L);
    od:
    L;
  • Mathematica
    FixedPoint[Function[{L}, n++; Delete[L, List /@ (L[[n]]*Range[Quotient[Length[L], L[[n]] ]])]], n=1; Range[1000]] (* Jean-François Alcover, Nov 27 2014 *)
  • Python
    def listed(n):
       L=list(range(1,n+1));j=1
       while L[j] <= len(L):
          L=[L[i] for i in range(len(L)) if (i+1)%L[j]!=0]
          j+=1
       return(L)