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 A179888 #23 Feb 16 2025 08:33:12 %S A179888 2,9,10,37,38,41,42,149,150,153,154,165,166,169,170,597,598,601,602, %T A179888 613,614,617,618,661,662,665,666,677,678,681,682,2389,2390,2393,2394, %U A179888 2405,2406,2409,2410,2453,2454,2457,2458,2469,2470,2473,2474,2645,2646,2649 %N A179888 Starting with a(1)=2: if m is a term then also 4*m+1 and 4*m+2. %C A179888 0 -> 01 and 1 -> 10 in binary representation of n; %C A179888 intersection of A032925 and A053754; %C A179888 subsequence of A063037; %C A179888 A000120(a(n))=A023416(a(n))=A070939(n); A070939(a(n))=2*A070939(n). %H A179888 Reinhard Zumkeller, <a href="/A179888/b179888.txt">Table of n, a(n) for n = 1..10000</a> %H A179888 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Quaternary.html">Quaternary</a> %H A179888 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a> %F A179888 a(n) = 4*a(floor(n/2)) + n mod 2 + 1 for n>1; %F A179888 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). %e A179888 __ n | __ bin(n) || ___ bin(a(n)) | base-4(a(n)) | __ a(n) %e A179888 -----|-----------||---------------|--------------|--------- %e A179888 .. 1 | ....... 1 || .......... 10 | .......... 2 | ..... 2; %e A179888 .. 2 | ...... 10 || ........ 1001 | ......... 21 | ..... 9; %e A179888 .. 3 | ...... 11 || ........ 1010 | ......... 22 | .... 10; %e A179888 .. 4 | ..... 100 || ...... 100101 | ........ 211 | .... 37; %e A179888 .. 5 | ..... 101 || ...... 100110 | ........ 212 | .... 38; %e A179888 .. 6 | ..... 110 || ...... 101001 | ........ 221 | .... 41; %e A179888 .. 7 | ..... 111 || ...... 101010 | ........ 222 | .... 42; %e A179888 .. 8 | .... 1000 || .... 10010101 | ....... 2111 | ... 149; %e A179888 .. 9 | .... 1001 || .... 10010110 | ....... 2112 | ... 150; %e A179888 . 10 | .... 1010 || .... 10011001 | ....... 2121 | ... 153; %e A179888 . 11 | .... 1011 || .... 10011010 | ....... 2122 | ... 154; %e A179888 . 12 | .... 1100 || .... 10100101 | ....... 2211 | ... 165; %e A179888 . 13 | .... 1101 || .... 10100110 | ....... 2212 | ... 166; %e A179888 . 14 | .... 1110 || .... 10101001 | ....... 2221 | ... 169; %e A179888 . 15 | .... 1111 || .... 10101010 | ....... 2222 | ... 170; %e A179888 . 16 | ... 10000 || .. 1001010101 | ...... 21111 | ... 597; %e A179888 . 17 | ... 10001 || .. 1001010110 | ...... 21112 | ... 598; %e A179888 . 18 | ... 10010 || .. 1001011001 | ...... 21121 | ... 601; %e A179888 . 19 | ... 10011 || .. 1001011010 | ...... 21122 | ... 602; %e A179888 . 20 | ... 10100 || .. 1001100101 | ...... 21211 | ... 613. %p A179888 a:= n-> 1+(n mod 2)+`if`(n<2, 0, 4*a(iquo(n, 2))): %p A179888 seq(a(n), n=1..50); # _Alois P. Heinz_, Jul 15 2024 %t A179888 Union@ Flatten@ NestList[ {4 # + 1, 4 # + 2} &, 2, 5] (* _Robert G. Wilson v_, Aug 16 2011 *) %o A179888 (Haskell) %o A179888 a179888 n = a179888_list !! (n-1) %o A179888 a179888_list = 2 : f a179888_list where %o A179888 f (x:xs) = x' : x'' : f (xs ++ [x',x'']) where x' = 4*x+1; x'' = x' + 1 %o A179888 -- _Reinhard Zumkeller_, Oct 29 2011 %o A179888 (Python) %o A179888 def A179888(n): return ((1<<(n.bit_length()<<1))-1)//3+int(bin(n)[2:],4) # _Chai Wah Wu_, Jul 16 2024 %Y A179888 Cf. A132679, A196168. %K A179888 nonn %O A179888 1,1 %A A179888 _Reinhard Zumkeller_, Jul 31 2010