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.

A075311 a(1) = 1; for n > 1, a(n) is the smallest number m > a(n-1) such that the number of 1's in the binary expansion of m is not already in the sequence.

Original entry on oeis.org

1, 3, 5, 6, 9, 10, 12, 15, 17, 18, 20, 23, 24, 27, 29, 30, 33, 34, 36, 39, 40, 43, 45, 46, 48, 51, 53, 54, 57, 58, 60, 65, 66, 68, 71, 72, 75, 77, 78, 80, 83, 85, 86, 89, 90, 92, 96, 99, 101, 102, 105, 106, 108, 113, 114, 116, 120, 127, 129, 130, 132, 135, 136, 139, 141
Offset: 1

Views

Author

Phil Carmody, Oct 11 2002

Keywords

Comments

If A000120(k) is in the sequence then k is not.
Differs from A001969: 63 is not included since it has 6 bits set.

Examples

			We start with a(1)=1. Then 2 is not included since it has one bit set and 1 is in the sequence. Next, 3 is included since it has 2 one bits and 2 is not in the sequence. And so on.
		

Crossrefs

Programs

  • Haskell
    a075311 n = a075311_list !! (n-1)
    a075311_list = 1 : f 2 [1] where
       f x ys = if a000120 x `elem` ys then f (x + 1) ys
                                       else x : f (x + 1) (x : ys)
    -- Reinhard Zumkeller, Apr 22 2012
  • PARI
    v=vector(1000): v[1]=1: for(curr=2,1000,e=A000120(curr): if(v[e],continue,v[curr]=1)): for(k=1,1000,if(v[k],print1(k",")))
    

Extensions

Edited by Ralf Stephan, Sep 14 2003