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

A357522 Reverse run lengths in binary expansions of terms of A063037: for n >= 0, a(n) is the unique k such that A063037(1+k) = A056539(A063037(1+n)).

Original entry on oeis.org

0, 1, 2, 3, 6, 5, 4, 7, 8, 11, 10, 9, 16, 17, 18, 15, 12, 13, 14, 19, 32, 23, 22, 21, 24, 31, 28, 27, 26, 29, 30, 25, 20, 33, 42, 49, 48, 43, 44, 47, 50, 41, 34, 37, 38, 53, 52, 39, 36, 35, 40, 51, 46, 45, 74, 75, 84, 65, 58, 59, 64, 85, 86, 63, 60, 57, 66, 83
Offset: 0

Views

Author

Rémy Sigrist, Oct 02 2022

Keywords

Comments

This sequence is a self-inverse permutation of the nonnegative integers.

Examples

			For n = 42:
- A063037(1+42) = 86,
- the binary expansion of 86 is "1010110",
- reversing run lengths yields "1001010",
- this corresponds to 74 = A063037(1+34),
- hence a(42) = 34.
		

Crossrefs

See A357523 for a similar sequence.

Programs

  • PARI
    See Links section.

Formula

a(n) = n iff n = 0 or A044813(1+n) belongs to A044918.

A003726 Numbers with no 3 adjacent 1's in binary expansion.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 20, 21, 22, 24, 25, 26, 27, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 43, 44, 45, 48, 49, 50, 51, 52, 53, 54, 64, 65, 66, 67, 68, 69, 70, 72, 73, 74, 75, 76, 77, 80, 81, 82
Offset: 1

Views

Author

Keywords

Comments

Positions of zeros in A014082. Could be called "tribbinary numbers" by analogy with A003714. - John Keith, Mar 07 2022
The sequence of Tribbinary numbers can be constructed by writing out the Tribonacci representations of nonnegative integers and then evaluating the result in binary. These numbers are similar to Fibbinary numbers A003714, Fibternary numbers A003726, and Tribternary numbers A356823. The number of Tribbinary numbers less than any power of two is a Tribonacci number. We can generate Tribbinary numbers recursively: Start by adding 0 and 1 to the sequence. Then, if x is a number in the sequence add 2x, 4x+1, and 8x+3 to the sequence. The n-th Tribbinary number is even if the n-th term of the Tribonacci word is a. Respectively, the n-th Tribbinary number is of the form 4x+1 if the n-th term of the Tribonacci word is b, and the n-th Tribbinary number is of the form 8x+3 if the n-th term of the Tribonacci word is c. Every nonnegative integer can be written as the sum of two Tribbinary numbers. Every number has a Tribbinary multiple. - Tanya Khovanova and PRIMES STEP Senior, Aug 30 2022

Crossrefs

Cf. A278038 (binary), A063037, A000073, A014082 (number of 111).
Cf. A004781 (complement).
Cf. A007088; A003796 (no 000), A004745 (no 001), A004746 (no 010), A004744 (no 011), A003754 (no 100), A004742 (no 101), A004743 (no 110).

Programs

  • Haskell
    a003726 n = a003726_list !! (n - 1)
    a003726_list = filter f [0..] where
       f x = x < 7 || (x `mod` 8) < 7 && f (x `div` 2)
    -- Reinhard Zumkeller, Jun 03 2012
    
  • Mathematica
    Select[Range[0, 82], SequenceCount[IntegerDigits[#, 2], {1, 1, 1}] == 0 &] (* Michael De Vlieger, Dec 23 2019 *)
  • PARI
    is(n)=!bitand(bitand(n, n<<1), n<<2) \\ Charles R Greathouse IV, Feb 11 2017

Formula

There are A000073(n+3) terms of this sequence with at most n bits. In particular, a(A000073(n+3)+1) = 2^n. - Charles R Greathouse IV, Oct 22 2021
Sum_{n>=2} 1/a(n) = 9.516857810319139410424631558212354346868048230248717360943194590798113163384... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Feb 13 2022

A003796 Numbers with no 3 adjacent 0's in binary expansion.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63, 73, 74, 75, 76, 77, 78, 79, 82, 83, 84, 85, 86, 87, 89, 90, 91, 92
Offset: 1

Views

Author

Keywords

Crossrefs

Complement of A004779.
Cf. A004745 (no 001), A004746 (no 010), A004744 (no 011), A003754 (no 100), A004742 (no 101), A004743 (no 110), A003726 (no 111).

Programs

  • Haskell
    a003796 n = a003796_list !! (n-1)
    a003796_list = filter f [0..] where
       f x  = x < 4 || x `mod` 8 /= 0 && f (x `div` 2)
    -- Reinhard Zumkeller, Jul 01 2013
    
  • Mathematica
    Select[Range[0,100],SequenceCount[IntegerDigits[#,2],{0,0,0}]==0&] (* The program uses the SequenceCount function from Mathematica version 10 *) (* Harvey P. Dale, Sep 12 2015 *)
  • PARI
    is(n)=while(n>7,if(bitand(n,7)==0,return(0));n>>=1); 1 \\ Charles R Greathouse IV, Feb 11 2017

Formula

Sum_{n>=2} 1/a(n) = 9.829256652701616366441622119246549956902006567009112470631751387637507184399... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Feb 13 2022

A179888 Starting with a(1)=2: if m is a term then also 4*m+1 and 4*m+2.

Original entry on oeis.org

2, 9, 10, 37, 38, 41, 42, 149, 150, 153, 154, 165, 166, 169, 170, 597, 598, 601, 602, 613, 614, 617, 618, 661, 662, 665, 666, 677, 678, 681, 682, 2389, 2390, 2393, 2394, 2405, 2406, 2409, 2410, 2453, 2454, 2457, 2458, 2469, 2470, 2473, 2474, 2645, 2646, 2649
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 31 2010

Keywords

Comments

0 -> 01 and 1 -> 10 in binary representation of n;
intersection of A032925 and A053754;
subsequence of A063037;
A000120(a(n))=A023416(a(n))=A070939(n); A070939(a(n))=2*A070939(n).

Examples

			__ n | __ bin(n) || ___ bin(a(n)) | base-4(a(n)) | __ a(n)
-----|-----------||---------------|--------------|---------
.. 1 | ....... 1 || .......... 10 | .......... 2 | ..... 2;
.. 2 | ...... 10 || ........ 1001 | ......... 21 | ..... 9;
.. 3 | ...... 11 || ........ 1010 | ......... 22 | .... 10;
.. 4 | ..... 100 || ...... 100101 | ........ 211 | .... 37;
.. 5 | ..... 101 || ...... 100110 | ........ 212 | .... 38;
.. 6 | ..... 110 || ...... 101001 | ........ 221 | .... 41;
.. 7 | ..... 111 || ...... 101010 | ........ 222 | .... 42;
.. 8 | .... 1000 || .... 10010101 | ....... 2111 | ... 149;
.. 9 | .... 1001 || .... 10010110 | ....... 2112 | ... 150;
. 10 | .... 1010 || .... 10011001 | ....... 2121 | ... 153;
. 11 | .... 1011 || .... 10011010 | ....... 2122 | ... 154;
. 12 | .... 1100 || .... 10100101 | ....... 2211 | ... 165;
. 13 | .... 1101 || .... 10100110 | ....... 2212 | ... 166;
. 14 | .... 1110 || .... 10101001 | ....... 2221 | ... 169;
. 15 | .... 1111 || .... 10101010 | ....... 2222 | ... 170;
. 16 | ... 10000 || .. 1001010101 | ...... 21111 | ... 597;
. 17 | ... 10001 || .. 1001010110 | ...... 21112 | ... 598;
. 18 | ... 10010 || .. 1001011001 | ...... 21121 | ... 601;
. 19 | ... 10011 || .. 1001011010 | ...... 21122 | ... 602;
. 20 | ... 10100 || .. 1001100101 | ...... 21211 | ... 613.
		

Crossrefs

Programs

  • Haskell
    a179888 n = a179888_list !! (n-1)
    a179888_list = 2 : f a179888_list where
      f (x:xs) = x' : x'' : f (xs ++ [x',x'']) where x' = 4*x+1; x'' = x' + 1
    -- Reinhard Zumkeller, Oct 29 2011
    
  • Maple
    a:= n-> 1+(n mod 2)+`if`(n<2, 0, 4*a(iquo(n, 2))):
    seq(a(n), n=1..50);  # Alois P. Heinz, Jul 15 2024
  • Mathematica
    Union@ Flatten@ NestList[ {4 # + 1, 4 # + 2} &, 2, 5] (* Robert G. Wilson v, Aug 16 2011 *)
  • Python
    def A179888(n): return ((1<<(n.bit_length()<<1))-1)//3+int(bin(n)[2:],4) # Chai Wah Wu, Jul 16 2024

Formula

a(n) = 4*a(floor(n/2)) + n mod 2 + 1 for n>1;
a(n) = SUM((bit(k)+1)*4^k: 0<=k<=L), where bit() and L such that n=SUM(bit(k)*2^k: 0<=k<=L).

A286262 Numbers whose binary expansion is a cubefree string.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 9, 10, 11, 12, 13, 18, 19, 20, 21, 22, 25, 26, 27, 36, 37, 38, 41, 43, 44, 45, 50, 51, 52, 53, 54, 73, 74, 75, 76, 77, 82, 83, 86, 89, 90, 91, 100, 101, 102, 105, 107, 108, 109, 146, 147, 148, 150, 153, 154, 155, 164, 165, 166, 172, 173, 178, 179, 180, 181, 182
Offset: 1

Views

Author

M. F. Hasler, May 05 2017

Keywords

Comments

Cubefree means that there is no substring which is the repetition of three identical nonempty strings, see examples.
If n is not in the sequence, no number of the form n*2^k + m with 0 <= m < 2^k can be in the sequence, nor any number of the form m*2^k + n with 2^k > n, m >= 0.

Examples

			7 is not in the sequence, because 7 = 111[2] contains three consecutive "1"s.
8 is not in the sequence, because 8 = 1000[2] contains three consecutive "0"s.
More generally, no number congruent to 7 or congruent to 0 (mod 8) may be in the sequence.
Even more generally, no number of the form m*2^(k+3) +- n, n < 2^k, can be in this sequence.
42 is not in the sequence, because 42 = 101010[2] contains three consecutive "10"s.
From the comment follows that no number of the form 7*2^k, 8*2^k or 42*2^k may be in the sequence, for any k>=0. More generally, no number of the form 7*2^k + m, 8*2^k + m or 42*2^k + m may be in the sequence, for any 2^k > m >= 0.
		

Crossrefs

Cf. A028445, A063037, A286261 (complement of this sequence).

Programs

  • Maple
    isCubeFree:=proc(v) local n, L;
    for n from 3 to nops(v) do for L to n/3 do
    if v[n-L*2+1 .. n] = v[n-L*3+1 .. n-L] then RETURN(false) fi od od; true end;
    a:=[];
    for n from 1 to 512 do
    if isCubeFree(convert(n, base, 2)) then a:=[op(a), n]; fi; od;
    a;
  • Python
    from _future_ import division
    def is_cubefree(s):
        l = len(s)
        for i in range(l-2):
            for j in range(1,(l-i)//3+1):
                if s[i:i+2*j] == s[i+j:i+3*j]:
                    return False
        return True
    A286262_list = [n for n in range(10**4) if is_cubefree(bin(n)[2:])] # Chai Wah Wu, May 06 2017

Formula

lim a(n)/n = infinity: sequence has asymptotic density 0.

A136037 Numbers with at least three adjacent equal digits in binary representation.

Original entry on oeis.org

7, 8, 14, 15, 16, 17, 23, 24, 28, 29, 30, 31, 32, 33, 34, 35, 39, 40, 46, 47, 48, 49, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 78, 79, 80, 81, 87, 88, 92, 93, 94, 95, 96, 97, 98, 99, 103, 104, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 11 2007

Keywords

Crossrefs

Cf. A007088.
Complement of A063037; union of A004779 and A004781.
Supersequence of A037970.

Programs

  • Mathematica
    Select[Range[150],SequenceCount[IntegerDigits[#,2],{x_,x_,x_}]>0&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Sep 04 2020 *)
  • Python
    def ok(n): b = bin(n)[2:]; return "000" in b or "111" in b
    print(list(filter(ok, range(120)))) # Michael S. Branicky, Jul 08 2021

A166535 Positive integers whose binary representation does not contain a run of more than three consecutive 0's or 1's.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90
Offset: 1

Views

Author

John W. Layman, Oct 16 2009

Keywords

Comments

A179970 is a subsequence. - Reinhard Zumkeller, Aug 04 2010
There are A000073(n+2) terms with binary length n. - Rémy Sigrist, Sep 30 2022

Crossrefs

Programs

  • Mathematica
    Select[Range[100],Max[Length/@Split[IntegerDigits[#,2]]]<4&] (* Harvey P. Dale, Aug 01 2020 *)
  • PARI
    tribonacci(n) = ([0,1,0; 0,0,1; 1,1,1]^n)[2,1]
    a(n) = { if (n<=4, return (n), my (s=1); for (i=1, oo, my (f=tribonacci(i+2)); i
    f (nRémy Sigrist, Sep 30 2022

Formula

It appears (but has not yet been proved) that the terms of a(n) can be computed recursively as follows. Let {c(i)} be defined for i >= 5 by c(i)=2c(i-1)+1 if i is congruent to 2 mod 4, else c(i)=2c(i-1)-1. I.e., {c(i)}={1,3,5,9,17,35,...} for i=5,6,7,... . Let a(n)=n for n=1,2,...,7. For n>7, choose k so that s(k) < n < s(k+1), where s(k) = Sum_{j=3..k} t(j) with t(j) being the j-th term of the tribonacci sequence A000073 (with initial terms t(0)=0, t(1)=0, t(2)=1). Then a(n) = c(k) + 2a(s(k)) - a(2s(k)+1). This has been verified for n up to 2400.
{i: A043276(i) <= 3}. - R. J. Mathar, Jun 04 2021

A178905 Numbers without 3 consecutive equal digits in any base b >= 2.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 9, 10, 11, 12, 18, 19, 20, 22, 25, 36, 37, 38, 44, 45, 50, 51, 52, 74, 75, 76, 77, 89, 90, 100, 101, 102, 105, 109, 147, 150, 153, 154, 165, 166, 173, 178, 179, 180, 181, 204, 205, 210, 212, 214, 217, 293, 294, 299, 300, 301, 306, 308, 309, 329
Offset: 1

Views

Author

Joonas Pohjonen, Jun 22 2010

Keywords

Crossrefs

Cf. A063037.

Programs

  • Mathematica
    Prepend[Cases[Range[329], n_ /; NoneTrue[Range[2, (Sqrt[4 n - 3] - 1)/2], MatchQ[IntegerDigits[n, #], {_, d_, d_, d_, _}] &]], 0] (* Vladimir Reshetnikov, Mar 20 2022 *)
  • Python
    from sympy.ntheory.digits import digits
    def three_in_a_row(s):
        return any(s[i] == s[i+1] == s[i+2] for i in range(len(s) - 2))
    def ok(n):
        if n < 7: return True
        b = 2
        d = digits(n, b)[1:]
        while len(d) >= 3:
            if three_in_a_row(d): return False
            b += 1
            d = digits(n, b)[1:]
        return True
    print([k for k in range(331) if ok(k)]) # Michael S. Branicky, Mar 27 2022

A371944 The binary expansion of a(n) corresponds to the ordinal transform (reduced modulo 2) of the binary expansion of n.

Original entry on oeis.org

0, 1, 3, 2, 6, 6, 5, 5, 13, 12, 12, 13, 10, 11, 11, 10, 26, 26, 25, 25, 25, 25, 26, 26, 21, 21, 22, 22, 22, 22, 21, 21, 53, 52, 52, 53, 50, 51, 51, 50, 50, 51, 51, 50, 53, 52, 52, 53, 42, 43, 43, 42, 45, 44, 44, 45, 45, 44, 44, 45, 42, 43, 43, 42, 106, 106
Offset: 0

Views

Author

Rémy Sigrist, Apr 13 2024

Keywords

Comments

Leading zeros are ignored.
All terms belong to A063037.

Examples

			For n = 43: the binary expansion of 43 is "101011", the corresponding ordinal transform is "1, 1, 2, 2, 3, 4", reducing modulo 2 yields "110010", the binary expansion of a(43), so a(43) = 50.
		

Crossrefs

Programs

  • Mathematica
    {0}~Join~Array[(c[0] = 1; c[1] = 1; FromDigits[Map[Mod[c[#]++, 2] &, IntegerDigits[#, 2] ], 2]) &, 120] (* Michael De Vlieger, Apr 16 2024 *)
  • PARI
    a(n) = { my (b = binary(n), f = vector(2)); for (i = 1, #b, b[i] = f[1+b[i]]++;); fromdigits(b % 2, 2); }

Formula

A070939(a(n)) = A070939(n).
a(floor(n/2)) = floor(a(n)/2).

A201992 Numbers whose binary representations are found in the Thue-Morse sequence.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 9, 10, 11, 12, 13, 18, 19, 20, 22, 25, 26, 37, 38, 41, 44, 45, 50, 51, 52, 75, 76, 77, 82, 83, 89, 90, 101, 102, 105, 150, 153, 154, 165, 166, 179, 180, 203, 205, 210, 211, 300, 301, 306, 308, 331, 332, 358, 361, 406, 410, 421, 422, 601
Offset: 0

Views

Author

Walt Rorie-Baety, Dec 07 2011

Keywords

Comments

Interpreting A010060 as a bit string, this sequence contains the decimal equivalents of the subsequences, in order.

Examples

			The binary representation of 21 (10101) has an overlapping square sequence (1X1X1, where X is any binary sequence, in this case, X = 0), and so is not in the sequence. Compare to A063037.
		

Crossrefs

Programs

  • Haskell
    a201992 = 0: concatMap (\n -> Set.toList . Set.fromList . map binRep . filter ((==[1]).take 1) . window n . take (n*2^n) $ a010060) [1..] where
      {window n = takeWhile (full . drop (n-1)) . map (take n) .  tails; binRep = foldl' (\a b -> 2*a+b) 0}; full = not . null
  • Mathematica
    Module[{nn=10000,tm},tm=Table[ThueMorse[n],{n,0,nn}];Join[{0},Position[ Table[ If[SequenceCount[tm,IntegerDigits[k,2]]>0,1,0],{k,1000}], 1]]]// Flatten (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Apr 03 2018 *)

Extensions

Helper function added and name of value in program changed for better understanding by Walt Rorie-Baety, Mar 25 2012
Showing 1-10 of 11 results. Next