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-7 of 7 results.

A261926 First differences of A261416.

Original entry on oeis.org

3, 3, 3, 6, 3, 3, 6, 9, 5, 6, 5, 7, 9, 5, 6, 3, 3, 6, 9, 5, 7, 5, 9, 3, 5, 3, 6, 3, 3, 6, 10, 6, 7, 7, 9, 5, 5, 5, 7, 7, 5, 5, 9, 9, 9, 5, 6, 3, 3, 6, 9, 5, 6, 5, 7, 10, 6, 7, 3, 6, 9, 7, 7, 9
Offset: 1

Views

Author

N. J. A. Sloane, Sep 17 2015

Keywords

Crossrefs

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

A261644 Distance of A260273(n) to next power of 2.

Original entry on oeis.org

1, 1, 3, 8, 5, 1, 15, 12, 9, 5, 1, 31, 28, 25, 20, 13, 8, 3, 63, 60, 57, 52, 47, 44, 41, 37, 33, 29, 24, 17, 13, 8, 3, 127, 124, 121, 116, 111, 108, 105, 99, 91, 88, 85, 81, 77, 70, 66, 62, 57, 52, 47, 40, 33, 29, 24, 15, 10, 6, 2, 254, 251, 248, 245, 239
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 30 2015

Keywords

Comments

This sequence, as well as A261712, is suggested by A261396 and A261416.

Examples

			.  1: 1
.  2: 1
.  3: 3
.  4: 8,5,1
.  5: 15,12,9,5,1
.  6: 31,28,25,20,13,8,3
.  7: 63,60,57,52,47,44,41,37,33,29,24,17,13,8,3
.  8: 127,124,121,116,111,108,105,99,91,88,85,81,77,70,... (27 terms)
.  9: 254,251,248,245,239,236,233,227,218,213,207,202,195,,... (49 terms)
		

Crossrefs

Cf. A260273, A062383, A261645 (first differences), A261712 (reversed), A261646 (row lengths).

Programs

  • Haskell
    a261644 n = a261644_list !! (n-1)
    a261644_list = zipWith (-)
                   (map a062383 a260273_list) $ map fromIntegral a260273_list
    a261644_tabf = [1] : f (tail $ zip a261645_list a261644_list) where
       f dxs = (map snd (dxs'' ++ [dx])) : f dxs' where
         (dxs'', dx:dxs') = span ((<= 0) . fst) dxs
    a261644_row n = a261644_tabf !! (n-1)

Formula

a(n) = A062383(A260273(n)) - A260273(n).

A262281 a(n) = smallest nonnegative number, not a power of 2, that is not a substring of n in its binary representation.

Original entry on oeis.org

3, 0, 3, 0, 3, 3, 5, 0, 3, 3, 3, 6, 5, 7, 5, 0, 3, 3, 3, 5, 3, 3, 7, 6, 5, 5, 7, 7, 5, 9, 5, 0, 3, 3, 3, 5, 3, 3, 5, 5, 3, 3, 3, 6, 7, 7, 9, 6, 5, 5, 5, 5, 7, 7, 7, 9, 5, 5, 9, 9, 5, 9, 5, 0, 3, 3, 3, 5, 3, 3, 5, 5, 3, 3, 3, 6, 5, 7, 5, 5, 3, 3, 3, 6, 3, 3, 7
Offset: 0

Views

Author

N. J. A. Sloane, Sep 17 2015

Keywords

Comments

Similar to A261922, but if the smallest missing number is a power of 2, ignore it and look at the next-smallest missing number.
This is like applying A261922 not to n itself but to n plus a very large power of 2. Suggested by considering A261416.

Examples

			For n = 13 = 1101_2, we can see 0, 11 (3), 101 (5), 110 (6), but not 111 (7), so a(13)=7.
		

Crossrefs

See A262289 for the "positive" version.

Extensions

a(23)-a(86) from Hiroaki Yamanouchi, Sep 20 2015

A262289 a(n) = smallest positive number, not a power of 2, that is not a substring of n in its binary representation.

Original entry on oeis.org

3, 3, 3, 5, 3, 3, 5, 5, 3, 3, 3, 6, 5, 7, 5, 5, 3, 3, 3, 5, 3, 3, 7, 6, 5, 5, 7, 7, 5, 9, 5, 5, 3, 3, 3, 5, 3, 3, 5, 5, 3, 3, 3, 6, 7, 7, 9, 6, 5, 5, 5, 5, 7, 7, 7, 9, 5, 5, 9, 9, 5, 9, 5, 5, 3, 3, 3, 5, 3, 3, 5, 5, 3, 3, 3, 6, 5, 7, 5, 5, 3, 3, 3, 6, 3, 3, 7
Offset: 0

Views

Author

N. J. A. Sloane, Sep 19 2015

Keywords

Comments

Similar to A261461, but if the smallest missing number is a power of 2, ignore it and look at the next-smallest missing number.

Crossrefs

See A262281 for the "nonnegative" version.

Programs

  • Mathematica
    fQ[m_, n_] := Block[{g}, g[x_] := ToString@FromDigits@IntegerDigits[x, 2]; StringContainsQ[g@ n, g@ m]]; Table[k = 3; While[Or[fQ[k, n] && k < 2 n, IntegerQ@ Log[2, k]], k++]; k, {n, 0, 86}] (* Michael De Vlieger, Sep 21 2015 *)

Extensions

a(23)-a(86) from Hiroaki Yamanouchi, Sep 20 2015

A261727 Length of longest prefix of n-th row in A261712 coinciding with row n+1.

Original entry on oeis.org

1, 0, 0, 2, 0, 3, 0, 0, 0, 25, 46, 90, 172, 141, 275, 601, 1102, 2199, 4150
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 31 2015

Keywords

Comments

A261712(n+1,k) = A261712(n,k) for k = 1 .. a(n).

Crossrefs

Programs

  • Haskell
    a261727 n = a261727_list !! (n-1)
    a261727_list = map (length . takeWhile (== 0)) $
                       zipWith (zipWith (-)) a261712_tabf $ tail a261712_tabf

A262290 a(0)=0; thereafter, add the smallest nonzero binary number, not a power of 2, that is not a substring of the binary expansion of a(n).

Original entry on oeis.org

0, 3, 8, 11, 17, 20, 23, 29, 38, 43, 49, 54, 61, 70, 75, 81, 84, 87, 93, 102, 107, 114, 119, 128, 131, 136, 139, 145, 148, 151, 157, 167, 173, 180, 187, 196, 201, 206, 211, 218, 225, 230, 235, 244, 253, 262, 267, 273, 276, 279, 285, 294, 299, 305, 310, 317, 327, 333, 340, 343, 349, 358, 365, 372, 381
Offset: 0

Views

Author

N. J. A. Sloane, Sep 19 2015

Keywords

Crossrefs

Identical to A261416 except for first two terms.

Formula

a(n+1) = a(n) + A262289(a(n)).
Showing 1-7 of 7 results.