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.

A094511 Smallest number distinct from n, not occurring earlier and having in binary representation not more ones than n.

This page as a plain text file.
%I A094511 #14 Nov 30 2014 03:29:42
%S A094511 2,1,4,8,3,5,6,16,10,9,7,17,11,12,13,32,18,20,14,24,19,21,15,33,22,25,
%T A094511 23,26,27,28,29,64,34,36,37,40,35,41,30,48,38,44,39,42,43,45,31,65,50,
%U A094511 49,46,56,51,52,47,66,53,54,55,57,58,59,60,128,68,72,69,80,67,73,70
%N A094511 Smallest number distinct from n, not occurring earlier and having in binary representation not more ones than n.
%C A094511 Permutation of the natural numbers: A094512(a(n))=a(A094512(n))=n.
%H A094511 Paul Tek, <a href="/A094511/b094511.txt">Table of n, a(n) for n = 1..10000</a>
%H A094511 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%H A094511 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%o A094511 (Haskell)
%o A094511 import Data.List (delete)
%o A094511 a094511 n = a094511_list !! (n-1)
%o A094511 a094511_list = f 1 [1..] where
%o A094511    f x zs = g zs where
%o A094511      g (y:ys) = if y /= x && a000120 y <= wt
%o A094511                    then y : f (x + 1) (delete y zs) else g ys
%o A094511      wt = a000120 x
%o A094511 -- _Reinhard Zumkeller_, Nov 23 2014
%Y A094511 Cf. A007088, A000120, A094513, A094510.
%K A094511 nonn
%O A094511 1,1
%A A094511 _Reinhard Zumkeller_, May 06 2004