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.

A039672 Fibonacci-lucky numbers: generated by a sieve process with Fibonacci rule.

Original entry on oeis.org

1, 2, 4, 5, 7, 10, 11, 13, 16, 19, 20, 23, 25, 28, 29, 32, 37, 38, 40, 41, 49, 50, 52, 56, 58, 59, 61, 65, 68, 74, 76, 77, 82, 83, 86, 88, 91, 97, 101, 103, 104, 106, 115, 118, 121, 122, 124, 130, 131, 133, 136, 137, 149, 151, 154, 155, 158, 163, 164, 166, 173, 175
Offset: 1

Views

Author

Keywords

Comments

Start with 1 2 3 4 5 6 7 8 9 10 11 12 13...; sum of first and 2nd terms = 3; strike out every 3rd term: 1 2 4 5 7 8 10 11 13...; sum of 2nd and 3rd terms = 6; strike out every 6th term: 1 2 4 5 7 10 11 13...; sum of 3rd and 4th terms = 9; strike out every 9th number; etc.

Crossrefs

Programs

  • Haskell
    a039672 n = a039672_list !! (n-1)
    a039672_list = sieve 1 [1..] where
       sieve k xs = z : sieve (k + 1) (fLucky xs) where
          z = xs !! (k - 1 )
          fLucky ws = us ++ fLucky vs where
                 (us, _:vs) = splitAt (z + xs !! k - 1) ws
    -- Reinhard Zumkeller, Dec 05 2011
  • Mathematica
    Fold[ Delete[ #1, Thread[ List[ Rest[ Range[ 0, Length[ #1 ], #1[ [ #2 ] ]+#1[ [ #2+1 ] ] ] ] ] ] ]&, Range[ 200 ], Range[ 20 ] ]

Extensions

Corrected by Larry Reeves (larryr(AT)acm.org), Feb 21 2001