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.

A116700 "Early bird" numbers: write the natural numbers in a string 12345678910111213.... Sequence gives numbers that occur in the string ahead of their natural place, sorted into increasing order (cf. A117804).

This page as a plain text file.
%I A116700 #52 May 23 2024 14:49:06
%S A116700 12,21,23,31,32,34,41,42,43,45,51,52,53,54,56,61,62,63,64,65,67,71,72,
%T A116700 73,74,75,76,78,81,82,83,84,85,86,87,89,91,92,93,94,95,96,97,98,99,
%U A116700 101,110,111,112,121,122,123,131,132,141,142,151,152,161,162,171
%N A116700 "Early bird" numbers: write the natural numbers in a string 12345678910111213.... Sequence gives numbers that occur in the string ahead of their natural place, sorted into increasing order (cf. A117804).
%C A116700 Based on an idea by Argentinian puzzle creator Jaime Poniachik, these numbers were introduced by Martin Gardner in 2005 in the magazine Math. Horizons, published by the MAA.
%C A116700 A048992 is a similar sequence, but is different because it does not contain 21, etc. - see comments in A048992.
%C A116700 A220376(n) = position of a(n) in 1234567891011121314151617181... . - _Reinhard Zumkeller_, Dec 13 2012
%D A116700 Martin Gardner, Transcendentals and early birds, Math. Horizons, XIII(2) (2005), pp. 5, 34 (published by Math. Assoc. America).
%H A116700 Joshua Zucker and R. Zumkeller, <a href="/A116700/b116700.txt">Table of n, a(n) for n = 1..10000</a> (first 675 terms from Joshua Zucker)
%H A116700 S. W. Golomb, <a href="http://www.itsoc.org/publications/nltr/it1202.pdf">Early Bird Numbers</a>, Puzzle Column in IEEE Inform. Soc. Newsletter, 52(4) (2002), p. 10.
%H A116700 S. W. Golomb, <a href="http://www.itsoc.org/publications/nltr/it0303web.pdf">Early Bird Numbers: Solutions</a>, IEEE Inform. Soc. Newsletter, 53(1) (2003), p. 30.
%F A116700 Asymptotically, the early bird numbers have density 1 [Golomb].
%e A116700 "12" appears at the start of the string, ahead of its position after "11", so is a member.
%e A116700 So are 123, 23, 1234, 234, 34, ... and sorting these into increasing order we get 12, 21, 23, 31, ... - _N. J. A. Sloane_, Aug 28 2019
%t A116700 s = ""; Reap[For[n=1, n <= 200, n++, sn = ToString[n]; If[StringPosition[s, sn, 1] =!= {}, Sow[n]]; s = s <> sn]][[2, 1]] (* _Jean-François Alcover_, Nov 04 2016, after _Klaus Brockhaus_ *)
%o A116700 (ARIBAS) s:= ""; for n:=1 to 200 do sn:=itoa(n);
%o A116700 if substr_index(s, sn) >= 0 then write(n, ","); end;
%o A116700 s:=concat(s, sn); end; (* _Klaus Brockhaus_, Jul 23 2007 *)
%o A116700 (UBASIC)
%o A116700 10 X=""
%o A116700 20 for N=1 to 396
%o A116700 30 A=cutspc(str(N))
%o A116700 40 if instr(X,A)>0 then print N;
%o A116700 50 X+=A
%o A116700 60 next N
%o A116700 70 '_Warut Roonguthai_, Jul 23 2007
%o A116700 (Haskell)
%o A116700 import Data.List (isPrefixOf, find)
%o A116700 import Data.Maybe (fromJust)
%o A116700 a116700 n = a116700_list !! (n-1)
%o A116700 a116700_list = filter early [1 ..] where
%o A116700    early z = not (reverse (show (z - 1)) `isPrefixOf` fst bird) where
%o A116700       bird = fromJust $ find ((show z `isPrefixOf`) . snd) xys
%o A116700    xys = iterate (\(us, v : vs) -> (v : us, vs))
%o A116700                  ([], concatMap show [0 ..])
%o A116700 -- _Reinhard Zumkeller_, Dec 13 2012
%o A116700 (Python)
%o A116700 def aupto(limit):
%o A116700     s, alst = "", []
%o A116700     for k in range(1, limit+1):
%o A116700         sk = str(k)
%o A116700         if sk in s: alst.append(k)
%o A116700         s += sk
%o A116700     return alst
%o A116700 print(aupto(171)) # _Michael S. Branicky_, Dec 21 2021
%Y A116700 Cf. A117804. A131881 gives complement.
%Y A116700 Cf. A048991 and A048992 (Rollman numbers).
%Y A116700 Cf. A007908 (subsequence, apart from initial 1).
%K A116700 nonn,base,nice,look
%O A116700 1,1
%A A116700 _Bernardo Recamán_, Jul 22 2007
%E A116700 More terms from _Warut Roonguthai_ and _Klaus Brockhaus_, Jul 23 2007
%E A116700 Golomb links from _Jeremy Gardiner_, Jul 23 2007