login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A322149 In the binary representation of n, replace each run of k 0's (or 1's) with k^2 0's (or 1's). 2
0, 1, 2, 15, 16, 5, 30, 511, 512, 33, 10, 47, 240, 61, 1022, 65535, 65536, 1025, 66, 271, 80, 21, 94, 1535, 7680, 481, 122, 495, 8176, 2045, 131070, 33554431, 33554432, 131073, 2050, 8207, 528, 133, 542, 8703, 2560, 161, 42, 175, 752, 189, 3070, 196607, 983040 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
This sequence has similarities with A001196: here we square the length of each run of consecutive equal bits, there we double it.
LINKS
FORMULA
a(n) = A322403(n, n).
a(n) >= n with equality iff n belongs to A000975.
a(2^n) = 2^(n^2) for any n >= 0.
a(2^n - 1) = 2^(n^2) - 1 for any n >= 0.
A005811(a(n)) = A005811(n).
MATHEMATICA
squareList[v_] := Flatten[ConstantArray[v, {Length[v]}]]; a[n_] := FromDigits[ Flatten[squareList /@ Split[IntegerDigits[n, 2]]], 2]; Array[a, 60, 0] (* Amiram Eldar, Dec 07 2018*)
PROG
(PARI) a(n) = if (n==0, 0, my (b=n%2, k=valuation(n+b, 2)); (a(n\2^k) + b) * 2^(k^2) - b)
CROSSREFS
Sequence in context: A077518 A196242 A102101 * A163480 A037312 A267711
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Nov 28 2018
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 8 00:02 EDT 2024. Contains 372317 sequences. (Running on oeis4.)