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.
%I A320261 #19 Apr 26 2019 08:46:32 %S A320261 3,14,7,28,59,30,15,56,115,238,119,60,123,62,31,112,227,462,231,476, %T A320261 955,478,239,120,243,494,247,124,251,126,63,224,451,910,455,924,1851, %U A320261 926,463,952,1907,3822,1911,956,1915,958,479,240,483,974,487,988,1979,990 %N A320261 Write n in binary, then modify each run of 0's and each run of 1's by prepending a 1. a(n) is the decimal equivalent of the result. %C A320261 A variation of A175046. Indices of record values are given by A319423. %C A320261 From _Chai Wah Wu_, Nov 25 2018 : (Start) %C A320261 Let f(k) = Sum_{i=2^k..2^(k+1)-1} a(i), i.e., the sum ranges over all numbers with a (k+1)-bit binary expansion. Thus f(0) = a(1) = 3 and f(1) = a(2) + a(3) = 21, and f(2) = a(4)+a(5)+a(6)+a(7) = 132. %C A320261 Then f(k) = 135*6^(k-2) - 3*2^(k-2) for k >= 0. %C A320261 Proof: the formula is true for k = 0. Looking at the last 2 bits of n, it is easy to see that a(4n) = 2*a(2n), a(4n+1) = 4*a(2n)+3, a(4n+2) = 4*a(2n+1)+2 and a(4n+3) = 2*a(2n+1)+1. By summing over the recurrence relations for a(n), we get f(k+2) = Sum_{i=2^k..2^(k+1)-1} (f(4i) + f(4i+1) + f(4i+2) + f(4i+3)) = Sum_{i=2^k..2^(k+1)-1} (6a(2i) + 6a(2i+1) + 6) = 6*f(k+1) + 3*2^(k+1). Solving this first-order recurrence relation with the initial condition f(1) = 21 shows that f(k) = 135*6^(k-2) - 3*2^(k-2) for k > 0. %C A320261 (End) %H A320261 Chai Wah Wu, <a href="/A320261/b320261.txt">Table of n, a(n) for n = 1..10000</a> %H A320261 Chai Wah Wu, <a href="https://arxiv.org/abs/1810.02293">Record values in appending and prepending bitstrings to runs of binary digits</a>, arXiv:1810.02293 [math.NT], 2018. %F A320261 a(4n) = 2*a(2n), a(4n+1) = 4*a(2n)+3, a(4n+2) = 4*a(2n+1)+2 and a(4n+3) = 2*a(2n+1)+1. - _Chai Wah Wu_, Nov 25 2018 %e A320261 6 in binary is 110. Modify each run by prepending a 1 to get 11110, which is 30 in decimal. So a(6) = 30. %t A320261 Table[FromDigits[Flatten[Join[{1},#]&/@Split[IntegerDigits[n,2]]],2],{n,60}] (* _Harvey P. Dale_, Apr 26 2019 *) %o A320261 (Python) %o A320261 from re import split %o A320261 def A320261(n): %o A320261 return int(''.join('1'+d for d in split('(0+)|(1+)',bin(n)[2:]) if d != '' and d != None),2) %Y A320261 Cf. A175046, A319423, A320037, A320038, A320039. %K A320261 nonn,base %O A320261 1,1 %A A320261 _Chai Wah Wu_, Oct 08 2018