Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #20 Jan 29 2021 18:58:02
%S 0,1,4,3,256,65,192,7,16777216,524289,2098176,8195,50331648,49153,
%T 114688,15,18446744073709551616,4503599627370497,36028797019226112,
%U 1099511627779,2305844108725321728,17592190238721,70368756760576,67108871,14167099448608935641088
%N a(n) is derived from n by replacing each 0 in its binary representation with a string of n 0's.
%H Alois P. Heinz, <a href="/A340667/b340667.txt">Table of n, a(n) for n = 0..500</a>
%F a(n) = n <=> n in { A000225 }.
%F a(n) = n^n <=> n in { A000079 }.
%F A000120(a(n)) = A000120(n).
%F A023416(a(n)) = n * A023416(n) for n >= 1.
%p a:= n-> Bits[Join](subs(0=[0$n][], Bits[Split](n))):
%p seq(a(n), n=0..25);
%p # second Maple program:
%p b:= proc(n, k) option remember; `if`(n<2, n,
%p `if`(irem(n, 2, 'r')=1, b(r, k)*2+1, b(r, k)*2^k))
%p end:
%p a:= n-> b(n$2):
%p seq(a(n), n=0..25);
%o (Python)
%o def A340667(n):
%o return 0 if n == 0 else int(bin(n)[2:].replace('0','0'*n),2) # _Chai Wah Wu_, Jan 29 2021
%Y Main diagonal of A340666.
%Y Cf. A000079, A000120, A000225, A023416, A057156.
%K nonn,look,base
%O 0,3
%A _Alois P. Heinz_, Jan 15 2021