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

A261416 Let b(k) denote A260273(k). It appears that for k >= 200, whenever b(k) just passes a power of 2, 2^m say, the successive differences b(k)-2^m converge to this sequence.

Original entry on oeis.org

2, 5, 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, Aug 25 2015

Keywords

Comments

It would be nice to have an independent characterization of this sequence.
A partial answer: set a(0)=2, and for n>0, a(n) = A261281(a(n-1)). - N. J. A. Sloane, Sep 17 2015

Examples

			At k=200, b(k)=b(200)=1026 has just passed 2^10. The successive differences b(200+i)-2^10 (i>=0) beyond this point are 2, 5, 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, [165, ...], which are the first 31 terms of the present sequence.
At k=371, b(371)=2050, and the successive differences b(371+i)-2^11 are 2, 5, ..., 279, 285, ... giving the first 51 terms of the present sequence.
		

Crossrefs

Cf. A260273, A261281. For when A260273 just passes a power of 2, see A261396.

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
    

A261396 a(n) = smallest k such that A260273(k) >= 2^n.

Original entry on oeis.org

1, 2, 3, 4, 7, 12, 19, 34, 61, 110, 200, 371, 697, 1310, 2484, 4739, 9072, 17458, 33671, 65128, 126225, 244802, 475124, 922891, 1793461, 3487348, 6784691, 13208038, 25731600, 50166771, 97873783, 191089176, 373349780, 729972649, 1428257200, 2796453078, 5478981032, 10741710906, 21072415837
Offset: 0

Views

Author

N. J. A. Sloane, Aug 17 2015

Keywords

Comments

The sequence indicates the first time a term in A260273 has binary length n+1.
A261646 = first differences = row lengths of tables A261644 and A261712. - Reinhard Zumkeller, Aug 30 2015

Crossrefs

Programs

  • Haskell
    a261396 n = a261396_list !! (n-1)
    a261396_list = f 1 1 a260273_list where
       f z k (x:xs) | x >= z    = k : f (2 * z) (k + 1) xs
                    | otherwise = f z (k + 1) xs
    -- Reinhard Zumkeller, Aug 30 2015

Extensions

a(18)-a(23) from Alois P. Heinz, Aug 19 2015
a(24)-a(34) from Chai Wah Wu, Aug 26 2015
a(35)-a(38) from Chai Wah Wu, Aug 31 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).

A261461 a(n) is the smallest nonzero number that is not a substring of n in its binary representation.

Original entry on oeis.org

1, 2, 3, 2, 3, 3, 4, 2, 3, 3, 3, 4, 5, 4, 4, 2, 3, 3, 3, 5, 3, 3, 4, 4, 5, 5, 4, 4, 5, 4, 4, 2, 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, 2, 3, 3, 3, 5, 3, 3, 5, 5, 3, 3, 3, 6, 5, 7, 5, 5, 3, 3, 3, 6, 3, 3
Offset: 0

Views

Author

Reinhard Zumkeller, Aug 30 2015

Keywords

Comments

A261018(n) = a(A260273(n)).
Is a(n) = A091460(n) for n>1? - R. J. Mathar, Sep 02 2015. The lowest counterexample occurs at a(121) = 5 < 6 = A091460(121). - Álvar Ibeas, Sep 08 2020
a(A062289(n))=A261922(A062289(n)); a(A126646(n))!=A261922(A126646(n)). - Reinhard Zumkeller, Sep 17 2015

Crossrefs

Cf. A007088, A030308, A260273, A261018; record values and where they occur: A261466, A261467.
See A261922 for a variant.

Programs

  • Haskell
    import Data.List (isInfixOf)
    a261461 x = f $ tail a030308_tabf where
       f (cs:css) = if isInfixOf cs (a030308_row x)
                       then f css else foldr (\d v -> 2 * v + d) 0 cs
    
  • Mathematica
    fQ[m_, n_] := Block[{g}, g[x_] := ToString@ FromDigits@ IntegerDigits[x, 2]; StringContainsQ[g@ n, g@ m]]; Table[k = 1; While[fQ[k, n] && k < n, k++]; k, {n, 85}] (* Michael De Vlieger, Sep 21 2015 *)
  • Python
    from itertools import count
    def a(n):
        b, k = bin(n)[2:], 1
        return next(k for k in count(1) if bin(k)[2:] not in b)
    print([a(n) for n in range(86)]) # Michael S. Branicky, Feb 26 2023

Formula

a(n) = A144016(n) + 1 for any n > 0. - Rémy Sigrist, Mar 10 2018

A261015 Irregular triangle read by rows: T(n,k) (0 <= k <= 2^n-1) = number of binary strings of length n such that the smallest number whose binary representation is not visible in the string is k.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 0, 0, 0, 1, 1, 3, 6, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 4, 11, 10, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 5, 19, 21, 15, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

N. J. A. Sloane, Aug 16 2015

Keywords

Comments

Suggested by A260273.

Examples

			Triangle begins:
  1,1,
  1,1,1,1,
  1,1,2,3,1,0,0,0,
  1,1,3,6,4,1,0,0,0,0,0,0,0,0,0,0,
...
For row 3, here are the 8 strings of length 3 and for each one, the smallest missing number k:
 000 1
 001 2
 010 3
 011 2
 100 3
 101 3
 110 4
 111 0
		

Crossrefs

See A261019 for a more compact version (which has further information about the columns).

Programs

  • Mathematica
    notVis[bits_] := For[i = 0, True, i++, If[SequencePosition[bits, IntegerDigits[i, 2]] == {}, Return[i]]];
    T[n_, k_] := Select[Rest[IntegerDigits[#, 2]]& /@ Range[2^n, 2^(n+1)-1], notVis[#] == k&] // Length;
    Table[T[n, k], {n, 1, 6}, {k, 0, 2^n-1}] // Flatten (* Jean-François Alcover, Aug 02 2018 *)

Extensions

More terms from Alois P. Heinz, Aug 17 2015

A261016 a(n) = Sum_{k=0..2^n-1} k*A261015(n,k).

Original entry on oeis.org

1, 6, 18, 46, 107, 241, 535, 1178, 2569, 5546, 11859, 25156, 53058, 111379, 232966, 486023, 1012185, 2104729, 4370644, 9064924, 18778766, 38856079, 80307630, 165790125, 341872016, 704171185, 1448812630, 2977673003, 6113469501, 12538958895, 25693167881, 52598980642
Offset: 1

Views

Author

N. J. A. Sloane, Aug 16 2015

Keywords

Comments

The scaled values a(n)/2^n are (to nine decimal places) 0.5000000000, 1.500000000, 2.250000000, 2.875000000, 3.343750000, 3.765625000, 4.179687500, 4.601562500, 5.017578125, 5.416015625, 5.790527344, 6.141601562, 6.476806641, 6.798034668, 7.109558105, 7.416122437, 7.722358704, 8.028903961, 8.336341858, 8.644985199, 8.954413414, 9.264011145, 9.573415518, 9.881861508, 10.18858004, 10.49296834, 10.79449527, 11.09269635, 11.38722431, 11.67781548, 11.96431363, 12.24665452, ...

Crossrefs

Programs

  • Haskell
    a261016 = sum . zipWith (*) [0..] . a261019_row'
    -- Reinhard Zumkeller, Aug 18 2015
  • Mathematica
    (* This program is not suitable to compute more than a dozen terms. *)
    notVis[bits_] := For[i = 0, True, i++, If[SequencePosition[bits, IntegerDigits[i, 2]] == {}, Return[i]]];
    T[n_, k_] := Select[Rest[IntegerDigits[#, 2]] & /@ Range[2^n, 2^(n+1) - 1], notVis[#] == k &] // Length;
    a[n_] := Sum[k*T[n, k], {k, 0, 2^n - 1}];
    Table[an = a[n]; Print["a(", n, ") = ", an]; an, {n, 1, 12}] (* Jean-François Alcover, Aug 02 2018 *)

Extensions

a(5)-a(16) from Alois P. Heinz, Aug 17 2015
a(17)-a(25) from Reinhard Zumkeller, Aug 18 2015
a(26)-a(32) from Alois P. Heinz, Aug 19 2015

A261017 a(n) = max k such that A261015(n,k) is not zero.

Original entry on oeis.org

1, 3, 4, 5, 5, 7, 8, 9, 9, 9, 11, 11, 13, 15, 16, 17, 17, 17, 17, 19, 19, 19, 21, 21, 23, 23, 23, 27, 29, 31, 32, 33, 33, 33, 33, 33, 35, 35, 35, 35, 37, 37, 37, 39, 39, 39, 39, 41, 41, 43, 43, 45, 45, 45, 47, 47, 47, 47
Offset: 1

Views

Author

N. J. A. Sloane, Aug 17 2015

Keywords

Crossrefs

Programs

  • Haskell
    a261017 = subtract 1 . length . a261019_row
    -- Reinhard Zumkeller, Aug 18 2015
  • Mathematica
    (* This program is not suitable to compute more than a dozen terms. *)
    notVis[bits_] := For[i = 0, True, i++, If[SequencePosition[bits, IntegerDigits[i, 2]] == {}, Return[i]]];
    T[n_, k_] := Select[Rest[IntegerDigits[#, 2]] & /@ Range[2^n, 2^(n+1) - 1], notVis[#] == k &] // Length;
    a[n_] := Do[If[T[n, k] > 0, Return[k]], {k, 2^n - 1, 0, -1}];
    Table[an = a[n]; Print["a(", n, ") = ", an]; an, {n, 1, 12}] (* Jean-François Alcover, Aug 02 2018 *)

Extensions

a(5)-a(17) from Alois P. Heinz, Aug 17 2015
a(18)-a(25) from Reinhard Zumkeller, Aug 18 2015
a(26)-a(36) from Alois P. Heinz, Aug 19 2015
a(37)-a(58) from Hiroaki Yamanouchi, Aug 23 2015

A261786 Successively add the smallest ternary number that is not a substring.

Original entry on oeis.org

1, 3, 5, 8, 9, 11, 15, 18, 19, 22, 25, 28, 30, 32, 36, 38, 43, 46, 49, 52, 55, 58, 61, 64, 68, 71, 74, 75, 79, 82, 84, 86, 90, 92, 96, 100, 104, 108, 110, 115, 120, 122, 125, 128, 131, 134, 137, 140, 143, 146, 150, 153, 156, 160, 163, 166, 169, 172, 176, 179
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 01 2015

Keywords

Crossrefs

Cf. A007089, A261787, A261789 (first differences), A261788, A260273, A261793.

Programs

  • Haskell
    a261786 n = a261786_list !! (n-1)
    a261786_list = iterate (\x -> x + a261787 x) 1
    
  • PARI
    ts(n) = Str(fromdigits(digits(n, 3))); \\ A007089
    f(n) = my(s=ts(n), k=1); while (#strsplit(s, ts(k)) != 1, k++); k; \\ A261787
    lista(nn) = my(v = vector(nn)); v[1] = 1; for (n=2, nn, v[n] = v[n-1] + f(v[n-1]);); v; \\ Michel Marcus, Feb 06 2022

A261793 Successively add the smallest number that is not a substring in decimal representation.

Original entry on oeis.org

1, 3, 4, 5, 6, 7, 8, 9, 10, 12, 15, 17, 19, 21, 24, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 40, 41, 43, 44, 45, 46, 47, 48, 49, 50, 51, 53, 54, 55, 56, 57, 58, 59, 60, 61, 63, 64, 65, 66, 67, 68, 69, 70, 71, 73, 74, 75, 76, 77, 78, 79, 80, 81
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 01 2015

Keywords

Crossrefs

Cf. A031298, A261794, A261795 (first differences), A261806, A260273, A261786

Programs

  • Haskell
    a261793 n = a261793_list !! (n-1)
    a261793_list = iterate (\x -> x + a261794 x) 1
Showing 1-10 of 13 results. Next