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.

A242535 Start with the natural numbers and repeatedly take and keep the current initial term i, and remove m and 2m, where m = i-th term of the rest; repeat.

Original entry on oeis.org

1, 3, 5, 6, 8, 9, 10, 12, 13, 16, 17, 18, 20, 21, 24, 25, 27, 28, 29, 32, 33, 35, 36, 37, 39, 41, 42, 44, 45, 48, 49, 50, 53, 54, 56, 57, 58, 59, 61, 63, 65, 66, 67, 70, 71, 73, 74, 76, 77, 78, 79, 82, 83, 85, 87, 88, 90, 91, 93, 95, 97, 98, 99, 101, 103
Offset: 1

Views

Author

Reinhard Zumkeller, May 17 2014

Keywords

Examples

			Start with 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,...
step 1: take 1, remove (1st term from the rest) = 2 and 2*2 = 4,
leaving 3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26...
step 2: take 3, remove (3rd term from the rest) = 7 and 2*7 = 14,
leaving 5,6,8,9,10,11,12,13,15,16,17,18,19,20,21,22,23,24,25,26,27,28,...
step 3: take 5, remove (5th term from the rest) = 11 and 2*11 = 22,
leaving 6,8,9,10,12,13,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30,...
step 4: take 6, remove (6th term from the rest) = 15 and 2*15 = 30,
leaving 8,9,10,12,13,16,17,18,19,20,21,23,24,25,26,27,28,29,31,32,33,...
step 5: take 8, remove (8th term from the rest) = 19 and 2*19 = 38,
leaving 9,10,12,13,16,17,18,20,21,23,24,25,26,27,28,29,31,32,33,34,35,...
step 6: take 9, remove (9th term from the rest) = 23, and 2*23 = 46,
leaving 10,12,13,16,17,18,20,21,24,25,26,27,28,29,31,32,33,34,35,36,...
		

Crossrefs

Cf. A136119.

Programs

  • Haskell
    import Data.List ((\\))
    a242535 n = a242535_list !! (n-1)
    a242535_list = f [1..] where
       f xs'@(x:xs) = x : f (xs \\ [z, 2 * z]) where z = xs' !! x