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.

Showing 1-10 of 12 results. Next

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).

Original entry on oeis.org

12, 21, 23, 31, 32, 34, 41, 42, 43, 45, 51, 52, 53, 54, 56, 61, 62, 63, 64, 65, 67, 71, 72, 73, 74, 75, 76, 78, 81, 82, 83, 84, 85, 86, 87, 89, 91, 92, 93, 94, 95, 96, 97, 98, 99, 101, 110, 111, 112, 121, 122, 123, 131, 132, 141, 142, 151, 152, 161, 162, 171
Offset: 1

Views

Author

Bernardo Recamán, Jul 22 2007

Keywords

Comments

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.
A048992 is a similar sequence, but is different because it does not contain 21, etc. - see comments in A048992.
A220376(n) = position of a(n) in 1234567891011121314151617181... . - Reinhard Zumkeller, Dec 13 2012

Examples

			"12" appears at the start of the string, ahead of its position after "11", so is a member.
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
		

References

  • Martin Gardner, Transcendentals and early birds, Math. Horizons, XIII(2) (2005), pp. 5, 34 (published by Math. Assoc. America).

Crossrefs

Cf. A117804. A131881 gives complement.
Cf. A048991 and A048992 (Rollman numbers).
Cf. A007908 (subsequence, apart from initial 1).

Programs

  • ARIBAS
    s:= ""; for n:=1 to 200 do sn:=itoa(n);
    if substr_index(s, sn) >= 0 then write(n, ","); end;
    s:=concat(s, sn); end; (* Klaus Brockhaus, Jul 23 2007 *)
    
  • Haskell
    import Data.List (isPrefixOf, find)
    import Data.Maybe (fromJust)
    a116700 n = a116700_list !! (n-1)
    a116700_list = filter early [1 ..] where
       early z = not (reverse (show (z - 1)) `isPrefixOf` fst bird) where
          bird = fromJust $ find ((show z `isPrefixOf`) . snd) xys
       xys = iterate (\(us, v : vs) -> (v : us, vs))
                     ([], concatMap show [0 ..])
    -- Reinhard Zumkeller, Dec 13 2012
    
  • Mathematica
    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 *)
  • Python
    def aupto(limit):
        s, alst = "", []
        for k in range(1, limit+1):
            sk = str(k)
            if sk in s: alst.append(k)
            s += sk
        return alst
    print(aupto(171)) # Michael S. Branicky, Dec 21 2021
  • UBASIC
    10 X=""
    20 for N=1 to 396
    30 A=cutspc(str(N))
    40 if instr(X,A)>0 then print N;
    50 X+=A
    60 next N
    70 'Warut Roonguthai, Jul 23 2007
    

Formula

Asymptotically, the early bird numbers have density 1 [Golomb].

Extensions

More terms from Warut Roonguthai and Klaus Brockhaus, Jul 23 2007
Golomb links from Jeremy Gardiner, Jul 23 2007

A048991 Write down the numbers 1,2,3,... but omit any number (such as 12 or 23 or 31 ...) which appears in the concatenation of all earlier terms.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29, 30, 32, 33, 35, 36, 37, 38, 39, 40, 43, 44, 46, 47, 48, 49, 50, 54, 55, 57, 58, 59, 60, 65, 66, 68, 69, 70, 76, 77, 79, 80, 87, 88, 90, 99, 100, 102, 103, 104, 105, 106, 107, 108, 109, 110, 112
Offset: 1

Views

Author

Keywords

Comments

Similar to the "punctual birds" A131881, numbers which do not occur earlier than their "natural" position in the string 123...9101112..., but more complex to compute due to the fact that here the omitted numbers must be taken into account. Contains powers of ten A011557 as a subsequence, at indices (1, 10, 63, 402, 2954, ...), giving the number of n-digit terms as (9, 53, 339, 2552, ...). - M. F. Hasler, Oct 25 2019

Examples

			12 is omitted since we see "1,2" at the beginning of the sequence; 101 is omitted because we can see "10,1[1]"; etc.
Since 12 is omitted, 21 does not occur "earlier" and it is in this sequence, but not in A131881, since it occurs earlier in "12,13". - _M. F. Hasler_, Oct 25 2019
		

References

  • Invented by 10-year-old Hannah Rollman.

Crossrefs

See A048992 for the omitted numbers.
Cf. A105390.

Programs

  • Haskell
    import Data.List (isInfixOf)
    a048991 n = a048991_list !! (n-1)
    a048991_list = f [1..] [] where
       f (x:xs) ys | xs' `isInfixOf` ys = f xs ys
                   | otherwise          = x : f xs (xs' ++ ys)
                   where xs' = reverse $ show x
    -- Reinhard Zumkeller, Dec 05 2011
    
  • Mathematica
    Clear[a]; a[1] = 1; s = "1"; a[n_] := a[n] = Catch[ For[k = a[n-1] + 1, True, k++, If[ StringFreeQ[s, t = ToString[k]], s = s <> t; Throw[k] ] ] ]; Table[a[n], {n, 1, 75}] (* Jean-François Alcover, Jan 09 2013 *)
  • PARI
    D=[]; for(n=1,199, for(i=0,#D-#d=digits(n), D[i+1..i+#d]==d && next(2)); print1(n","); D=concat(D,d)) \\ M. F. Hasler, Oct 25 2019
  • Python
    # see Hobson link
    

Extensions

Edited by Patrick De Geest, Jun 02 2003

A118248 Least nonnegative integer whose binary representation does not occur in the concatenation of the binary representations of all earlier terms.

Original entry on oeis.org

0, 1, 2, 4, 7, 8, 11, 16, 18, 21, 22, 25, 29, 31, 32, 35, 36, 38, 40, 58, 64, 67, 68, 70, 75, 76, 78, 87, 88, 90, 93, 99, 101, 104, 107, 122, 128, 131, 133, 134, 136, 138, 140, 144, 148, 150, 152, 155, 156, 159, 161, 169, 170, 172, 178, 183, 188, 190
Offset: 0

Views

Author

Leroy Quet, Apr 18 2006

Keywords

Comments

Otherwise said: Omit numbers whose binary representation already occurs in the concatenation of the binary representation of earlier terms. As such, a binary analog of A048991 / A048992 (Hannah Rollman's numbers), rather than "early bird" binary numbers A161373. - M. F. Hasler, Jan 03 2013

Crossrefs

Cf. A118247 (concatenation of binary representations), A118250, A118252 (variants where binary representations are reversed).

Programs

  • Mathematica
    Block[{b = {{0}}, a = {0}, k, d}, Do[k = FromDigits[#, 2] &@ Last@ b + 1; While[SequenceCount[Flatten@ b, Set[d, IntegerDigits[k, 2]]] > 0, k++]; AppendTo[b, d]; AppendTo[a, k], {i, 57}]; a] (* Michael De Vlieger, Aug 19 2017 *)
  • PARI
    A118248(n,show=0,a=0)={my(c=[a],find(t,s,L)=L || L=#s; for(i=0,#t-L, vecextract( t,(2^L-1)<M. F. Hasler, Jan 03 2013
    
  • Perl
    $s="";$i=0;do{$i++;$b=sprintf("%b",$i);if(index($s,$b)<0){print("$i=$b\n");$s.=$b}}while(1);

Extensions

More terms from Graeme McRae, Apr 19 2006
Explicit definition from M. F. Hasler, Dec 29 2012
Perl program by Phil Carmody, Mar 19 2015
Crossref and Perl program by Phil Carmody, Mar 19 2015

A102462 Max{ k!/(a(1)!*a(2)!*..*a(n)!) : a(1) + 2*a(2) + 3*a(3) + ... + n*a(n) = n, a(1) + a(2) + ... + a(n) = k }.

Original entry on oeis.org

1, 1, 1, 2, 3, 4, 6, 12, 20, 30, 60, 105, 168, 280, 504, 840, 1512, 2520, 5040, 9240, 15840, 27720, 55440, 102960, 180180, 360360, 675675, 1201200, 2162160, 4084080, 7351344, 12697776, 24504480, 46558512, 84651840, 155195040, 296281440, 543182640, 961015440
Offset: 0

Author

Vladeta Jovovic, Feb 23 2005

Keywords

Comments

a(n) is the greatest number in row n of A048996 and in row n of A072811. Thus a(n) is the greatest number of compositions (permutations) obtainable from some partition of n. Example: a(7)=12 is the greatest number of compositions from some partition of 7, specifically, the partition {3,2,1,1}. - Clark Kimberling, Dec 24 2006
The partition(s) giving this optimum is always one where #{parts equal to i} >= #{parts equal to j} if i <= j. These partitions are counted in A007294. - Franklin T. Adams-Watters, Apr 08 2008
The number of partition(s) giving this optimum is given by A198254. - Olivier Gérard, Nov 17 2011

Crossrefs

Programs

  • Maple
    b:= proc(n,i,p) option remember; `if`(n=0 or i=1, (p+n)!/n!,
           max(seq(b(n-i*j, i-1, p+j)/j!, j=0..n/i)))
        end:
    a:= n-> b(n$2, 0):
    seq(a(n), n=0..50);  # Alois P. Heinz, Apr 15 2015
  • Mathematica
    b[n_, i_, p_] := b[n, i, p] = If[n == 0 || i == 1, (p + n)!/n!, Max[Table[ b[n-i*j, i-1, p+j]/j!, {j, 0, n/i}]]]; a[n_] := b[n, n, 0]; Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Dec 19 2015, after Alois P. Heinz *)

A161373 "Early bird" binary numbers: write the natural numbers in binary representation in a string 011011100101110111.... Sequence gives numbers which occur in the string strictly ahead of their natural place.

Original entry on oeis.org

3, 5, 6, 7, 9, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 65
Offset: 1

Author

Keywords

Comments

In contrast to sequences A048991, A048992 (Hannah Rollman's numbers), and binary analogs A190784 and related, the numbers listed here are repeated in their natural position when forming the concatenation of binary digits, even though they occur already earlier in the string. - M. F. Hasler, Jan 01 2013

Examples

			Decimal 0 1 2 3 4 5 ... Binary 0 1 10 11 100 101 ... 3 is before its natural position ('1' + beginning of '2' -> 011...) The same for : 5: '2' + beginning of '3' -> 01101... 6: '1' + '2' -> 0110... etc. In the first 5 binary numbers we can find ahead of their natural place: 3,5,6,7,9,11,12,13,14,18,23,25,27,28,37,46,50,55,57
20 ('10100') occurs at the joint of 18 and 19: the last 2 digits of '10010' and the first three of '10011'
		

Crossrefs

Extensions

"Strictly" added to definition, offset corrected as customary for lists, 20 added by Hagen von Eitzen, Jun 27 2009

A105390 Number of Hannah Rollman's numbers <= n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 9, 10, 10, 10, 11, 11, 11, 11, 11, 12, 13, 14, 15, 15, 15, 16, 16, 16, 16, 17, 18, 19, 20, 21, 21, 21, 22, 22, 22, 23, 24, 25, 26, 27, 28, 28
Offset: 1

Author

Reinhard Zumkeller, Apr 04 2005

Keywords

Comments

a(n) = #{k: A048992(k)<=n} = n - #{k: A048991(k)<=n};
a(n) < n/2 for n < 740; a(n) > n/2 for 740 < n < 1260,
see A105391 for numbers m with a(m) = m/2.

Crossrefs

A084383 a(0)=0; for n>0, a(n) = smallest number that is not a concatenation of any number of distinct earlier terms in increasing order.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 20, 21, 22, 30, 31, 32, 33, 40, 41, 42, 43, 44, 50, 51, 52, 53, 54, 55, 60, 61, 62, 63, 64, 65, 66, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 112, 113, 114, 115, 116, 117, 118, 119, 200, 201, 202
Offset: 0

Author

Amarnath Murthy, May 29 2003

Keywords

Comments

After 11 we can see 1,2 -> 12, 1,3 -> 13, etc., but not 20.

Crossrefs

Hannah Rollman's numbers: A048991, A048992.

Programs

  • Python
    from itertools import islice
    def incats(s, L):
        if s == "": return True
        return any(s.startswith(w) and incats(s[len(w):], L[i+1:]) for i, w in enumerate(L))
    def agen(): # generator of terms
        L, an, s = ["0"], 1, "1"
        yield from [0]
        while True:
            yield an
            L.append(s)
            while incats((s:=str(an)), L):
                an += 1
    print(list(islice(agen(), 70))) # Michael S. Branicky, Feb 01 2024

Extensions

More terms from Patrick De Geest, Jun 03 2003

A105391 Numbers m such that there are an equal number of numbers <= m that are contained and that are not contained in the concatenation of terms <= m in A048991.

Original entry on oeis.org

740, 1260, 1262, 5230, 15804, 15814, 15816, 36294, 194876, 213868
Offset: 1

Author

Reinhard Zumkeller, Apr 04 2005

Keywords

Comments

A105390(a(n)) = a(n)/2.
There are no other terms <= 600000. The plots in a105390.gif strongly suggest that the sequence is complete. - Klaus Brockhaus, Aug 15 2007

Examples

			A105390(n) < n/2 for n < a(1)=740;
A105390(n) > n/2 for n with 740 < n < a(2)=1260;
A105390(1261)=631, A105390(a(3))=A105390(1262)=631;
A105390(n) < n/2 for n with 1262 < n < a(4)=5230;
A105390(n) > n/2 for n with 5230 < n < a(5)=15804;
A105390(n) < n/2 for n with 15804 < n < a(6)=15814;
A105390(15815)=7908, A105390(a(7))=A105390(15816)=7909;
A105390(n) < n/2 for n with 15816 < n < a(8)=36294;
A105390(n) > n/2 for n with 36294 < n < a(9)=194876; etc.
		

Crossrefs

Cf. A048991, A048992, A105390, A131982 (numbers n such that A131981(n) = n/2).

Programs

  • JBASIC
    s$ = "" : c = 0 : d = 0
    FOR n = 1 TO 40000
    sn$ = str$(n)
    IF instr(s$, sn$) > 0 THEN d = d+1 ELSE c = c+1 : s$ = s$ + sn$
    IF c = d THEN print n ; "," ;
    NEXT ' Klaus Brockhaus, Aug 15 2007

A128291 Complement of A118248.

Original entry on oeis.org

3, 5, 6, 9, 10, 12, 13, 14, 15, 17, 19, 20, 23, 24, 26, 27, 28, 30, 33, 34, 37, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 59, 60, 61, 62, 63, 65, 66, 69, 71, 72, 73, 74, 77, 79, 80, 81, 82, 83, 84, 85, 86, 89, 91, 92, 94, 95, 96, 97, 98, 100
Offset: 0

Author

Nick Hobson, Feb 24 2007

Keywords

Comments

Also: Numbers whose binary representation is a substring of the concatenation of the binary representation of all smaller nonnegative integers not listed earlier. - M. F. Hasler, Dec 29 2012

Examples

			The first term is 3, smallest integer whose binary representation "11"[2] is a substring of the concatenation of the smaller numbers 0,1,2 ~> concat(0,1,10)="0110".
Next is 5="101"[2], which is a substring of concat(0,1,2="10",4="100") = "0110100". Note that 3, since it occurs earlier, is excluded from the list of numbers which are concatenated. - _M. F. Hasler_, Dec 29 2012
		

Crossrefs

A187752 Number of times the binary representation of n occurs in the concatenation of the binary representation of all smaller numbers.

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 2, 2, 0, 1, 0, 3, 2, 3, 4, 3, 0, 1, 1, 2, 1, 2, 0, 6, 2, 3, 3, 5, 5, 4, 6, 4, 0, 1, 1, 2, 0, 3, 2, 3, 1, 3, 1, 4, 1, 3, 3, 8, 2, 3, 4, 4, 3, 5, 3, 8, 5, 5, 5, 6, 8, 5, 8, 5, 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 4, 1, 5, 3, 4, 1, 3, 2, 5, 2, 4, 2, 6, 1, 4, 3, 6, 2, 6, 4, 10, 2, 3, 4, 4, 3
Offset: 0

Author

M. F. Hasler, Jan 03 2013

Keywords

Comments

Related to "early bird" (decimal: A116700, binary: A161373) and Hannah Rollman's numbers (cf. A048991, A048992 for decimal; A118248 and A118247-A118251 for binary versions). The latter would correspond to a variant of this sequence which has indices of nonzero terms omitted from the concatenation.

Examples

			a(3) = 1 since concatenation of 0,1,2 in binary yields "0110", and 3 = "11"[2] occurs once in this string.
		

Programs

  • PARI
    (nMax)->my(c=[],cnt(t,s,M)=M=2^#s-1;sum(i=0,#t-#s,vecextract(t,M<
    				
Showing 1-10 of 12 results. Next