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 15 results. Next

A261467 Where records occur in A261461.

Original entry on oeis.org

0, 1, 2, 6, 12, 44, 92, 184, 1208, 1256, 4792, 9912, 19832, 39664, 563952, 576464, 4496112, 4499184, 17996528, 17997488, 143972080, 145057520, 145070832, 294967024, 589944560, 1179889136, 2359778272, 71079255008, 72019201952
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 30 2015

Keywords

Comments

A261461(a(n)) = A261466(n).

Crossrefs

Programs

  • C
    See Links section.
    
  • Haskell
    a261467 n = a261467_list !! (n-1)
    -- where a261467_list is defined in A261466.
    
  • Python
    from itertools import count, islice
    def f(n):
        b, k = bin(n)[2:], 1
        return next(k for k in count(1) if bin(k)[2:] not in b)
    def agen(record=-1):
        yield from (((record:=f(k)), k)[1] for k in count(0) if f(k) > record)
    print(list(islice(agen(), 18))) # Michael S. Branicky, Feb 26 2023

Extensions

Leading zero and more terms from Rémy Sigrist, Mar 10 2018
a(26)-a(29) from Rémy Sigrist, Feb 26 2023

A261466 Records in A261461.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 29, 31, 32, 33, 34, 35
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 30 2015

Keywords

Comments

a(n) = A261461(A261467(n)).

Crossrefs

Programs

  • Haskell
    a261466 n = a261466_list !! (n-1)
    (a261466_list, a261467_list) = unzip $ (0, 1) : f 0 1 where
       f i x | y > x     = (y, i) : f (i + 1) y
             | otherwise = f (i + 1) x
             where y = a261461 i
    
  • Python
    from itertools import count, islice
    def f(n):
        b, k = bin(n)[2:], 1
        return next(k for k in count(1) if bin(k)[2:] not in b)
    def agen(record=-1):
        yield from (((record:=f(k)), k)[0] for k in count(0) if f(k) > record)
    print(list(islice(agen(), 18))) # Michael S. Branicky, Feb 26 2023

Extensions

Initial terms corrected and more terms from Rémy Sigrist, Mar 10 2018
a(26)-a(29) from Rémy Sigrist, Feb 26 2023

A126646 a(n) = 2^(n+1) - 1.

Original entry on oeis.org

1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 131071, 262143, 524287, 1048575, 2097151, 4194303, 8388607, 16777215, 33554431, 67108863, 134217727, 268435455, 536870911, 1073741823, 2147483647
Offset: 0

Views

Author

Aleksandar M. Janjic and Milan Janjic, Feb 08 2007, Feb 13 2007

Keywords

Comments

a(n) is the number of integers k less than 10^n such that the decimal representation of k lacks the digits 1,2,3,4,5,6 and 7 and at least one of the digits 8,9.
Partial sums of the powers of 2 (A000079).
a(n) is the number of elements (all m-dimensional faces) in an n-dimensional simplex (0 <= m <= n). - Sergey Pavlov, Aug 15 2015
A261461(a(n)) != A261922(a(n)). - Reinhard Zumkeller, Sep 17 2015
a(n) is the total number of matches in a knockout tournament with 2^n players. - Paul Duckett, Dec 12 2022

Examples

			a(8) = 2^9 - 1 = 511.
		

Crossrefs

Programs

Formula

a(n-1)^2 + a(n) = a(2n) + 1, a square. - Vincenzo Librandi and Ralf Stephan, Nov 23 2010
G.f.: 1/ ( (1-2*x)*(1-x) ). - R. J. Mathar, Dec 02 2013
a(n) = 3*a(n-1) - 2*a(n-2), n > 1. - Wesley Ivan Hurt, Aug 21 2015
E.g.f.: 2*exp(2*x) - exp(x). - G. C. Greubel, Mar 31 2021

A062289 Numbers n such that n-th row in Pascal triangle contains an even number, i.e., A048967(n) > 0.

Original entry on oeis.org

2, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 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, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77
Offset: 1

Views

Author

Ahmed Fares (ahmedfares(AT)my-deja.com), Jul 02 2001

Keywords

Comments

Numbers n such that binary representation contains the bit string "10". Union of A043569 and A101082. - Rick L. Shepherd, Nov 29 2004
The asymptotic density of this sequence is 1 (Burns, 2016). - Amiram Eldar, Jan 26 2021

Crossrefs

Complement of A000225, so these might be called non-Mersenne numbers.
A132782 is a subsequence.

Programs

  • Haskell
    a062289 n = a062289_list !! (n-1)
    a062289_list = 2 : g 2 where
       g n = nM n : g (n+1)
       nM k = maximum $ map (\i -> i + min i (a062289 $ k-i+1)) [2..k]
       -- Cf. link [Oliver Kullmann, Xishun Zhao], Def. 3.1, page 3.
    -- Reinhard Zumkeller, Feb 21 2012, Dec 31 2010
    
  • Mathematica
    ok[n_] := MatchQ[ IntegerDigits[n, 2], {_, 1, 0, _}]; Select[ Range[100], ok] (* Jean-François Alcover, Dec 12 2011, after Rick L. Shepherd *)
  • PARI
    isok(m) = #select(x->((x%2)==0), vector(m+1, k, binomial(m, k-1))); \\ Michel Marcus, Jan 26 2021
    
  • Python
    def A062289(n): return n+(m:=n.bit_length())-(not n>=(1<Chai Wah Wu, Jun 30 2024

Formula

a(n) = A057716(n+1) - 1.
a(n) = 2 if n=1, otherwise max{min{2*i, a(n-i+1) + i}: 1 < i <= n}.
A036987(a(n)) = 0. - Reinhard Zumkeller, Mar 06 2012
A007461(a(n)) mod 2 = 0. - Reinhard Zumkeller, Apr 02 2012
A102370(n) = A105027(a(n)). - Reinhard Zumkeller, Jul 21 2012
A261461(a(n)) = A261922(a(n)). - Reinhard Zumkeller, Sep 17 2015

Extensions

More terms from Rick L. Shepherd, Nov 29 2004

A260273 Successively add the smallest nonzero binary number that is not a substring.

Original entry on oeis.org

1, 3, 5, 8, 11, 15, 17, 20, 23, 27, 31, 33, 36, 39, 44, 51, 56, 61, 65, 68, 71, 76, 81, 84, 87, 91, 95, 99, 104, 111, 115, 120, 125, 129, 132, 135, 140, 145, 148, 151, 157, 165, 168, 171, 175, 179, 186, 190, 194, 199, 204, 209, 216, 223, 227, 232, 241, 246
Offset: 1

Views

Author

Alex Meiburg, Jul 22 2015

Keywords

Comments

a(n) is at least Omega(n), at most O(n*log(n)).
The empirical approximation n*(log(n)/2 + exp(1)) is startlingly close to tight, compared with many increasing upper bounds.
A261644(n) = A062383(a(n)) - a(n). - Reinhard Zumkeller, Aug 30 2015

Examples

			Begin with a(1)=1, in binary, "1". This contains the string "1" but not "10", so we add 2. Thus a(2)=1+2=3. This also contains "1" but not "10", so we move to a(3)=3+2=5. This contains "1" and "10" but not "11", so we add 3. Thus a(4)=5+3=8. (See A261018 for the successive numbers that are added. - _N. J. A. Sloane_, Aug 17 2015)
		

Crossrefs

See A261922 and A261461 for the smallest missing number function; also A261923, A262279, A261281.
See also A261396 (when a(n) just passes a power of 2), A261416 (the limiting behavior just past a power of 2).
First differences are A261018.
A262288 is the decimal analog.

Programs

  • Haskell
    a260273 n = a260273_list !! (n-1)
    a260273_list = iterate (\x -> x + a261461 x) 1
    -- Reinhard Zumkeller, Aug 30 2015, Aug 17 2015
    
  • Java
    public static void main(String[] args) {
       int a=1;
       for(int iter=0;iter<100;iter++){
           System.out.print(a+", ");
           int inc;
           for(inc=1; contains(a,inc); inc++);
           a+=inc;
       }
    }
    static boolean contains(int a,int test){
       int mask=(Integer.highestOneBit(test)<<1)-1;
       while(a >= test){
           if((a & mask) == test) return true;
           a >>= 1;
       }
       return false;
    }
    
  • Mathematica
    sublistQ[L1_, L2_] := Module[{l1 = Length[L1], l2 = Length[L2], k}, If[l2 <= l1, For[k = 1, k <= l1 - l2 + 1, k++, If[L1[[k ;; k + l2 - 1]] == L2, Return[True]]]]; False];
    a[1] = 1; a[n_] := a[n] = Module[{bb = IntegerDigits[a[n-1], 2], k}, For[k = 1, sublistQ[bb, IntegerDigits[k, 2]], k++]; a[n-1] + k]; Table[a[n], {n, 1, 60}] (* Jean-François Alcover, Apr 01 2016 *)
    NestList[Function[k, k + FromDigits[#, 2] &@ SelectFirst[IntegerDigits[Range[2^8], 2], Length@ SequencePosition[IntegerDigits[k, 2], #] == 0 &]], 1, 64] (* Michael De Vlieger, Apr 01 2016, Version 10.1 *)
  • Python
    A260273_list, a = [1], 1
    for i in range(10**3):
        b, s = 1, format(a,'b')
        while format(b,'b') in s:
            b += 1
        a += b
        s = format(a,'b')
        A260273_list.append(a) # Chai Wah Wu, Aug 26 2015

Formula

a(n+1) = a(n) + A261461(a(n)). - Reinhard Zumkeller, Aug 30 2015

A261922 a(n) = smallest nonnegative number that is not a substring of n in its binary representation.

Original entry on oeis.org

1, 0, 3, 0, 3, 3, 4, 0, 3, 3, 3, 4, 5, 4, 4, 0, 3, 3, 3, 5, 3, 3, 4, 4, 5, 5, 4, 4, 5, 4, 4, 0, 3, 3, 3, 5, 3, 3, 5, 5, 3, 3, 3, 4, 7, 4, 4, 4, 5, 5, 5, 5, 7, 4, 4, 4, 5, 5, 4, 4, 5, 4, 4, 0, 3, 3, 3, 5, 3, 3, 5, 5, 3, 3, 3, 6, 5, 7, 5, 5, 3, 3, 3, 6, 3, 3, 4, 4, 7, 7, 4, 4, 8, 4, 4, 4, 5, 5, 5, 5, 5, 7
Offset: 0

Views

Author

N. J. A. Sloane, Sep 16 2015

Keywords

Crossrefs

Programs

  • Haskell
    import Data.List (isInfixOf)
    a261922 x = f a030308_tabf where
       f (cs:css) = if isInfixOf cs (a030308_row x)
                       then f css else foldr (\d v -> 2 * v + d) 0 cs
    -- Reinhard Zumkeller, Sep 17 2015
    
  • PARI
    bstr(n) = if (n==0, "0", my(s="", b=binary(n)); for (i=1, #b, s=concat(s, b[i])); s);
    a(n) = my(sn=btostr(n), k=0); while (#strsplit(sn, bstr(k)) != 1, k++); k; \\ Michel Marcus, Sep 20 2023
    
  • Python
    def a(n): b=bin(n)[2:]; return next(k for k in range(2**len(b)) if bin(k)[2:] not in b)
    print([a(n) for n in range(99)]) # Michael S. Branicky, Sep 21 2023

Formula

From Reinhard Zumkeller, Sep 17 2015: (Start)
a(A062289(n)) = A261461(A062289(n)).
a(A126646(n)) != A261461(A126646(n)). (End)

A144016 a(n) = the largest positive integer m such that the binary representations of all positive integers <= m are found within the binary representation of n.

Original entry on oeis.org

1, 2, 1, 2, 2, 3, 1, 2, 2, 2, 3, 4, 3, 3, 1, 2, 2, 2, 4, 2, 2, 3, 3, 4, 4, 3, 3, 4, 3, 3, 1, 2, 2, 2, 4, 2, 2, 4, 4, 2, 2, 2, 3, 6, 3, 3, 3, 4, 4, 4, 4, 6, 3, 3, 3, 4, 4, 3, 3, 4, 3, 3, 1, 2, 2, 2, 4, 2, 2, 4, 4, 2, 2, 2, 5, 4, 6, 4, 4, 2, 2, 2, 5, 2, 2, 3, 3, 6, 6, 3, 3, 7, 3, 3, 3, 4, 4, 4, 4, 4, 6, 4, 4, 6, 6
Offset: 1

Views

Author

Leroy Quet, Sep 07 2008

Keywords

Comments

From Rémy Sigrist, Mar 10 2018: (Start)
a(n) is the greatest k <= n such that A213629(n, i) > 0 for i = 1..k.
See A261467 for the indices of record values.
(End)

Examples

			44 in binary is 101100. In this string we find 1 (1 in decimal): (1)01100; 10 (2 in decimal): (10)1100; 11 (3 in decimal): 10(11)00; 100 (4 in decimal): 101(100); 101 (5 in decimal): (101)100; and 110 (6 in decimal): 10(110)0; but not 111 (7 in decimal). So a(44) = 6.
		

Crossrefs

Formula

a(n) = A261461(n) - 1. - Rémy Sigrist, Mar 10 2018

Extensions

Extended by Ray Chandler, Nov 07 2008

A261018 First differences of A260273.

Original entry on oeis.org

2, 2, 3, 3, 4, 2, 3, 3, 4, 4, 2, 3, 3, 5, 7, 5, 5, 4, 3, 3, 5, 5, 3, 3, 4, 4, 4, 5, 7, 4, 5, 5, 4, 3, 3, 5, 5, 3, 3, 6, 8, 3, 3, 4, 4, 7, 4, 4, 5, 5, 5, 7, 7, 4, 5, 9, 5, 4, 4, 4, 3, 3, 3, 6, 3, 3, 6, 9, 5, 6, 5, 7, 8, 3, 3, 6, 3, 3, 4, 4, 4, 7, 4, 4, 8, 4, 4, 5, 5
Offset: 1

Views

Author

N. J. A. Sloane, Aug 17 2015

Keywords

Comments

a(n) = A261461(A260273(n)). - Reinhard Zumkeller, Aug 30 2015

Crossrefs

Programs

  • Haskell
    a261018 n = a261018_list !! (n-1)
    a261018_list = zipWith (-) (tail a260273_list) a260273_list
    -- Reinhard Zumkeller, Aug 30 2015
  • Mathematica
    b[1] = 1;
    b[n_] := b[n] = Module[{bits, k}, bits = IntegerDigits[b[n-1], 2]; For[k = 1, True, k++, If[SequencePosition[bits, IntegerDigits[k, 2]] == {}, Return[b[n-1] + k]]]];
    a[n_] := b[n+1] - b[n];
    Array[a, 100] (* Jean-François Alcover, Aug 02 2018 *)
  • Python
    A261018_list, a = [], 1
    for i in range(10**3):
        b, s = 1, format(a,'b')
        while format(b,'b') in s:
            b += 1
        a += b
        s = format(a,'b')
        A261018_list.append(b) # Chai Wah Wu, Aug 26 2015
    

A261787 a(n) is the smallest nonzero number that is not a substring of n in ternary representation.

Original entry on oeis.org

1, 2, 1, 2, 2, 3, 1, 3, 1, 2, 2, 4, 2, 2, 3, 3, 3, 3, 1, 3, 1, 4, 3, 3, 1, 3, 1, 2, 2, 4, 2, 2, 4, 4, 4, 4, 2, 2, 5, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 3, 3, 3, 1, 3, 1, 4, 3, 3, 1, 3, 1, 4, 4, 4, 5, 3, 3, 3, 3, 3, 1, 3, 1, 4, 3, 3, 1, 3, 1, 2, 2, 4, 2, 2
Offset: 0

Views

Author

Reinhard Zumkeller, Sep 01 2015

Keywords

Crossrefs

Programs

  • Haskell
    import Data.List (isInfixOf)
    a261787 x = f $ tail a030341_tabf where
       f (cs:css) = if isInfixOf cs (a030341_row x)
                       then f css else foldr (\d v -> 3 * v + d) 0 cs
    
  • PARI
    ts(n) = Str(fromdigits(digits(n, 3)));
    a(n) = my(s=ts(n), k=1); while (#strsplit(s, ts(k)) != 1, k++); k; \\ Michel Marcus, Feb 05 2022

Formula

A261789(n) = a(A261786(n)).

A261789 First differences of A261786.

Original entry on oeis.org

2, 2, 3, 1, 2, 4, 3, 1, 3, 3, 3, 2, 2, 4, 2, 5, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 1, 4, 3, 2, 2, 4, 2, 4, 4, 4, 4, 2, 5, 5, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 4, 3, 3, 3, 3, 4, 3, 3, 1, 4, 3, 4, 4, 5, 3, 3, 3, 3, 3, 1, 4, 3, 4, 3, 3, 1, 4, 3, 2, 2, 4, 2, 4, 4
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 01 2015

Keywords

Comments

a(n) = A261787(A261786(n)).

Crossrefs

Programs

  • Haskell
    a261789 n = a261789_list !! (n-1)
    a261789_list = zipWith (-) (tail a261786_list') a261786_list'
Showing 1-10 of 15 results. Next