|
|
A004754
|
|
Numbers n whose binary expansion starts 10.
|
|
26
|
|
|
2, 4, 5, 8, 9, 10, 11, 16, 17, 18, 19, 20, 21, 22, 23, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 128, 129, 130, 131
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
A000120(a(n)) = A000120(n); A023416(a(n-1)) = A008687(n) for n > 1. - Reinhard Zumkeller, Dec 04 2015
|
|
LINKS
|
T. D. Noe, Table of n, a(n) for n = 1..1023
R. Stephan, Some divide-and-conquer sequences ...
R. Stephan, Table of generating functions
Index entries for sequences related to binary expansion of n
|
|
FORMULA
|
a(2n) = 2a(n), a(2n+1) = 2a(n) + 1 + [n==0].
a(n) = n + 2^floor(log_2(n)) = n + A053644(n).
a(2^m+k) = 2^(m+1) + k, m >= 0, 0 <= k < 2^m. - Yosu Yurramendi, Aug 08 2016
|
|
EXAMPLE
|
10 in binary is 1010, so 10 is in sequence.
|
|
MATHEMATICA
|
w = {1, 0}; Select[Range[2, 131], If[# < 2^(Length@ w - 1), True, Take[IntegerDigits[#, 2], Length@ w] == w] &] (* Michael De Vlieger, Aug 08 2016 *)
|
|
PROG
|
(PARI) a(n)=n+2^floor(log(n)/log(2))
(PARI) is(n)=n>1 && !binary(n)[2] \\ Charles R Greathouse IV, Sep 23 2012
(Haskell)
import Data.List (transpose)
a004754 n = a004754_list !! (n-1)
a004754_list = 2 : concat (transpose [zs, map (+ 1) zs])
where zs = map (* 2) a004754_list
-- Reinhard Zumkeller, Dec 04 2015
|
|
CROSSREFS
|
Cf. A123001 (binary version), A004755 (11), A004756 (100), A004757 (101), A004758 (110), A004759 (111).
Cf. A004760, A053644, A062050, A076877.
Apart from initial terms, same as A004761.
Cf. A000120, A023416, A008687.
Sequence in context: A072756 A325429 A004761 * A322014 A010450 A035231
Adjacent sequences: A004751 A004752 A004753 * A004755 A004756 A004757
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
N. J. A. Sloane
|
|
EXTENSIONS
|
Edited by Ralf Stephan, Oct 12 2003
|
|
STATUS
|
approved
|
|
|
|