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 A374348 #35 Aug 01 2024 18:44:48 %S A374348 1,6,13,60,59,250,505,2040,1015,4086,8181,32756,32755,131058,262129, %T A374348 1048560,262127,1048558,2097133,8388588,8388587,33554410,67108841, %U A374348 268435432,134217703,536870886,1073741797,4294967268,4294967267,17179869154,34359738337,137438953440 %N A374348 a(n) = k where wt(k) = n and k + wt(k) = a power of two, where wt(n) = A000120(n) = binary weight of n. %C A374348 k is uniquely determined by finding the power of two for which k = 2^x - n has wt(k) = n. %C A374348 Terms are not always increasing, since the number of 0 bits in n-1 reduces k. %H A374348 Alois P. Heinz, <a href="/A374348/b374348.txt">Table of n, a(n) for n = 1..1000</a> %F A374348 a(n) = 2^A230300(n) - n. %F A374348 a(n) = 2^(n + A000120(n-1)) - n. %F A374348 a(n) = 2 * A129195(n-1) - n. %F A374348 a(n) == n (mod 2). %e A374348 For n = 4, 60 in binary is 111100, which has sum of digits of 4, and 60 + 4 = 64, a power of two. %e A374348 For n = 5, 59 in binary is 111011, which has sum of digits of 5, and 59 + 5 = 64. %p A374348 a:= n-> 2^(n+add(i, i=Bits[Split](n-1)))-n: %p A374348 seq(a(n), n=1..32); # _Alois P. Heinz_, Jul 05 2024 %o A374348 (Python) %o A374348 def a(n): %o A374348 return (1 << (n + (n-1).bit_count())) - n %Y A374348 Cf. A000079, A000120, A092391, A129195, A230300. %K A374348 nonn,base,easy %O A374348 1,2 %A A374348 _Steven Reyes_, Jul 05 2024