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.

A007952 Generated by a sieve: keep first number, drop every 2nd, keep first, drop every 3rd, keep first, drop every 4th, etc.

Original entry on oeis.org

0, 1, 3, 5, 9, 11, 17, 21, 29, 33, 41, 47, 57, 59, 77, 81, 101, 107, 117, 131, 149, 153, 173, 191, 209, 213, 239, 257, 273, 281, 321, 329, 359, 371, 401, 417, 441, 453, 497, 509, 539, 569, 611, 621, 647, 671, 717, 731, 779, 801, 839, 869, 917, 929, 989, 1001, 1053, 1067
Offset: 0

Views

Author

N. J. A. Sloane, R. Muller

Keywords

Comments

Also called the sieve of Tchoukaillon (or Mancala, or Kalahari).
If k+1 occurs at rank i for the first time, then i is given by the program: i = 0: for j = k to 1 step -1: i = 1 + i + int ( i / j ): next: - Claude Lenormand (claude.lenormand(AT)free.fr), Jan 15 2001
A082447(n+1) = (number of terms <= n); see A141262 for primes. - Reinhard Zumkeller, Jun 21 2008

References

  • Y. David, On a sequence generated by a sieving process, Riveon Lematematika, 11 (1957), 26-31.
  • M. Le, On the Smarandache n-ary Sieve, Smarandache Notions Journal, Vol. 10, No. 1-2-3, 1999, 146-147.

Crossrefs

Programs

  • Haskell
    a007952 n = a007952_list !! n
    a007952_list = f 1 [0..] where
       f k (x:xs) = x : f (k + 1) (g xs) where
         g ws = us ++ (g vs) where (us, _:vs) = splitAt k ws
    -- Reinhard Zumkeller, Jan 19 2014
    
  • Mathematica
    f[n_] := Fold[#2*Floor[#1/#2 + 1] &, n, Reverse@ Range[n - 1]]; Array[f, 55] (* From David Wilson *)
  • PARI
    a(n) = my(ret=0); forstep(k=n,1,-1, ret++; ret+=(-ret)%k); ret; \\ Kevin Ryde, Sep 30 2022

Formula

Equals A002491(n) - 1. Equals A108696 - 2.

Extensions

Corrected and extended by David W. Wilson