A048678
Binary expansion of nonnegative integers expanded to "Zeckendorffian format" with rewrite rules 0->0, 1->01.
Original entry on oeis.org
0, 1, 2, 5, 4, 9, 10, 21, 8, 17, 18, 37, 20, 41, 42, 85, 16, 33, 34, 69, 36, 73, 74, 149, 40, 81, 82, 165, 84, 169, 170, 341, 32, 65, 66, 133, 68, 137, 138, 277, 72, 145, 146, 293, 148, 297, 298, 597, 80, 161, 162, 325, 164, 329, 330, 661, 168, 337, 338, 677, 340
Offset: 0
11=1011 in binary, thus is rewritten as 100101 = 37 in decimal.
-
a048678 0 = 0
a048678 x = 2 * (b + 1) * a048678 x' + b
where (x', b) = divMod x 2
-- Reinhard Zumkeller, Mar 31 2015
-
rewrite_0to0_1to01 := proc(n) option remember; if(n < 2) then RETURN(n); else RETURN(((2^(1+(n mod 2))) * rewrite_0to0_1to01(floor(n/2))) + (n mod 2)); fi; end;
-
f[n_] := FromDigits[ Flatten[IntegerDigits[n, 2] /. {1 -> {0, 1}}], 2]; Table[f@n, {n, 0, 60}] (* Robert G. Wilson v, Dec 11 2009 *)
-
a(n)=if(n<1,0,(3-(-1)^n)*a(floor(n/2))+(1-(-1)^n)/2)
-
a(n) = if(n == 0, 0, my(A = -2); sum(i = 0, logint(n, 2), A++; if(bittest(n, i), 1 << (A++)))) \\ Mikhail Kurkov, Mar 14 2024
-
def a(n):
return 0 if n==0 else (3 - (-1)**n)*a(n//2) + (1 - (-1)**n)//2
print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 30 2017
-
def A048678(n): return int(bin(n)[2:].replace('1','01'),2) # Chai Wah Wu, Mar 18 2024
A175047
Write n in binary, then increase each run of 0's by one 0. a(n) is the decimal equivalent of the result.
Original entry on oeis.org
1, 4, 3, 8, 9, 12, 7, 16, 17, 36, 19, 24, 25, 28, 15, 32, 33, 68, 35, 72, 73, 76, 39, 48, 49, 100, 51, 56, 57, 60, 31, 64, 65, 132, 67, 136, 137, 140, 71, 144, 145, 292, 147, 152, 153, 156, 79, 96, 97, 196, 99, 200, 201, 204, 103, 112, 113, 228, 115, 120, 121, 124, 63, 128
Offset: 1
12 in binary is 1100. Increase each run of 0 by one digit to get 11000, which is 24 in decimal. So a(12) = 24.
-
import Data.List (group)
a175047 = foldr (\b v -> 2 * v + b) 0 . concatMap
(\bs@(b:_) -> if b == 0 then 0 : bs else bs) . group . a030308_row
-- Reinhard Zumkeller, Jul 05 2013
-
f[n_] := Block[{s = Split@ IntegerDigits[n, 2]}, FromDigits[ Flatten@ Insert[s, {0}, Table[{2 i}, {i, Floor[ Length@s/2]} ]], 2]]; Array[ f, 64] (* Robert G. Wilson v, Dec 11 2009 *)
-
from re import split
def A175047(n):
return int(''.join(d+'0' if '0' in d else d for d in split('(0+)|(1+)',bin(n)[2:]) if d != '' and d != None),2) # Chai Wah Wu, Nov 21 2018
A088698
Replace 1 with 11 in binary representation of n.
Original entry on oeis.org
0, 3, 6, 15, 12, 27, 30, 63, 24, 51, 54, 111, 60, 123, 126, 255, 48, 99, 102, 207, 108, 219, 222, 447, 120, 243, 246, 495, 252, 507, 510, 1023, 96, 195, 198, 399, 204, 411, 414, 831, 216, 435, 438, 879, 444, 891, 894, 1791, 240, 483, 486, 975, 492, 987, 990
Offset: 0
n=9: 1001 -> 110011 = 51, so a(9) = 51.
Ordered terms plus one are in
A048297.
Same sequence sorted into ascending order:
A277335,
A290258 (without 0).
-
a(n)=if(n<1,0,if(n%2==0,2*a(n/2),4*a((n-1)/2)+3))
-
def a(n): return int(bin(n)[2:].replace('1', '11'), 2)
print([a(n) for n in range(55)]) # Michael S. Branicky, Feb 20 2021
A353654
Numbers whose binary expansion has the same number of trailing 0 bits as other 0 bits.
Original entry on oeis.org
1, 3, 7, 10, 15, 22, 26, 31, 36, 46, 54, 58, 63, 76, 84, 94, 100, 110, 118, 122, 127, 136, 156, 172, 180, 190, 204, 212, 222, 228, 238, 246, 250, 255, 280, 296, 316, 328, 348, 364, 372, 382, 392, 412, 428, 436, 446, 460, 468, 478, 484, 494, 502, 506, 511, 528, 568
Offset: 1
Cf.
A000045,
A000120,
A000523,
A007814,
A010056,
A025480,
A030109,
A054429,
A060142,
A072649,
A084471,
A086784,
A091892,
A132665,
A133512,
A200650,
A213911,
A232559,
A280514,
A343152,
A348366.
-
N:= 10: # for terms <= 2^N
S:= {1};
for d from 1 to N do
for k from 0 to d/2-1 do
B:= combinat:-choose([$k+1..d-2],k);
S:= S union convert(map(proc(t) local s; 2^d - 2^k - add(2^(s),s=t) end proc,B),set);
od od:
sort(convert(S,list)); # Robert Israel, Sep 21 2023
-
Join[{1}, Select[Range[2, 600], IntegerExponent[#, 2] == Floor[Log2[# - 1]] - DigitCount[# - 1, 2, 1] &]] (* Amiram Eldar, Jul 16 2022 *)
-
isok(k) = if (k==1, 1, (logint(k-1, 2)-hammingweight(k-1) == valuation(k, 2))); \\ Michel Marcus, Jul 16 2022
-
from itertools import islice, count
def A353654_gen(startvalue=1): # generator of terms >= startvalue
return filter(lambda n:(m:=(~n & n-1).bit_length()) == bin(n>>m)[2:].count('0'),count(max(startvalue,1)))
A353654_list = list(islice(A353654_gen(),30)) # Chai Wah Wu, Oct 14 2022
A340666
A(n,k) is derived from n by replacing each 0 in its binary representation with a string of k 0's; square array A(n,k), n>=0, k>=0, read by antidiagonals.
Original entry on oeis.org
0, 0, 1, 0, 1, 1, 0, 1, 2, 3, 0, 1, 4, 3, 1, 0, 1, 8, 3, 4, 3, 0, 1, 16, 3, 16, 5, 3, 0, 1, 32, 3, 64, 9, 6, 7, 0, 1, 64, 3, 256, 17, 12, 7, 1, 0, 1, 128, 3, 1024, 33, 24, 7, 8, 3, 0, 1, 256, 3, 4096, 65, 48, 7, 64, 9, 3, 0, 1, 512, 3, 16384, 129, 96, 7, 512, 33, 10, 7
Offset: 0
Square array A(n,k) begins:
0, 0, 0, 0, 0, 0, 0, 0, 0, ...
1, 1, 1, 1, 1, 1, 1, 1, 1, ...
1, 2, 4, 8, 16, 32, 64, 128, 256, ...
3, 3, 3, 3, 3, 3, 3, 3, 3, ...
1, 4, 16, 64, 256, 1024, 4096, 16384, 65536, ...
3, 5, 9, 17, 33, 65, 129, 257, 513, ...
3, 6, 12, 24, 48, 96, 192, 384, 768, ...
7, 7, 7, 7, 7, 7, 7, 7, 7, ...
1, 8, 64, 512, 4096, 32768, 262144, 2097152, 16777216, ...
...
Rows n=0..17, 19 give:
A000004,
A000012,
A000079,
A010701,
A000302,
A000051(k+1),
A007283,
A010727,
A001018,
A087289,
A007582(k+1),
A062709(k+2),
A164346,
A181565(k+1),
A005009,
A181404(k+3),
A001025,
A199493,
A253208(k+1).
-
A:= (n, k)-> Bits[Join](subs(0=[0$k][], Bits[Split](n))):
seq(seq(A(n, d-n), n=0..d), d=0..12);
# second Maple program:
A:= proc(n, k) option remember; `if`(n<2, n,
`if`(irem(n, 2, 'r')=1, A(r, k)*2+1, A(r, k)*2^k))
end:
seq(seq(A(n, d-n), n=0..d), d=0..12);
-
A[n_, k_] := FromDigits[IntegerDigits[n, 2] /. 0 -> Sequence @@ Table[0, {k}], 2];
Table[A[n, d-n], {d, 0, 12}, {n, 0, d}] // Flatten (* Jean-François Alcover, Feb 02 2021 *)
A084473
Replace 0 with 0000 in binary representation of n.
Original entry on oeis.org
1, 16, 3, 256, 33, 48, 7, 4096, 513, 528, 67, 768, 97, 112, 15, 65536, 8193, 8208, 1027, 8448, 1057, 1072, 135, 12288, 1537, 1552, 195, 1792, 225, 240, 31, 1048576, 131073, 131088, 16387, 131328, 16417, 16432, 2055, 135168, 16897, 16912, 2115, 17152, 2145
Offset: 1
-
a084473 1 = 1
a084473 x = 2 * (if b == 1 then 1 else 8) * a084473 x' + b
where (x', b) = divMod x 2
-- Reinhard Zumkeller, Mar 31 2015
-
a:= n-> Bits[Join](subs(0=[0$4][], Bits[Split](n))):
seq(a(n), n=1..49); # Alois P. Heinz, Jan 15 2021
-
a[n_] := FromDigits[IntegerDigits[n, 2] /. 0 -> Sequence@@{0,0,0,0}, 2];
Array[a, 50] (* Jean-François Alcover, Dec 16 2021 *)
-
def a(n): return int(bin(n)[2:].replace('0', '0000'), 2)
print([a(n) for n in range(1, 46)]) # Michael S. Branicky, Jan 15 2021
A088697
Replace 0 with 10 in binary representation of n.
Original entry on oeis.org
0, 1, 6, 3, 26, 13, 14, 7, 106, 53, 54, 27, 58, 29, 30, 15, 426, 213, 214, 107, 218, 109, 110, 55, 234, 117, 118, 59, 122, 61, 62, 31, 1706, 853, 854, 427, 858, 429, 430, 215, 874, 437, 438, 219, 442, 221, 222, 111, 938, 469, 470, 235, 474, 237
Offset: 0
n=9: 1001 -> 110101 = 53, so a(9) = 53.
-
Join[{0},Table[FromDigits[Flatten[IntegerDigits[n,2]/.(0->{1,0})],2],{n,80}]] (* Harvey P. Dale, Dec 05 2023 *)
-
a(n)=if(n<1,0,if(n%2==0,4*a(n/2)+2,2*a((n-1)/2)+1))
A229180
Expansion of (chi(-x) * chi(-x^3))^-3 in powers of x where chi() is a Ramanujan theta function.
Original entry on oeis.org
1, 3, 6, 16, 33, 60, 118, 210, 354, 612, 1008, 1608, 2583, 4035, 6174, 9448, 14196, 21024, 31054, 45282, 65322, 93884, 133638, 188640, 265225, 370086, 512934, 708136, 971628, 1325724, 1802134, 2437200, 3280452, 4400132, 5876184, 7815288, 10360890, 13683525
Offset: 0
G.f. = 1 + 3*x + 6*x^2 + 16*x^3 + 33*x^4 + 60*x^5 + 118*x^6 + 210*x^7 + ...
G.f. = q + 3*q^3 + 6*q^5 + 16*q^7 + 33*q^9 + 60*q^11 + 118*q^13 + 210*q^15 + ...
- H. Verrill, Some Congruences related to modular forms, Max Planck Institute, 1999.
-
a[ n_] := SeriesCoefficient[ 1 / (QPochhammer[ x, x^2] QPochhammer[x^3, x^6])^3, {x, 0, n}];
nmax = 40; CoefficientList[Series[Product[1/((1 - x^(2*k - 1)) * (1 - x^(6*k - 3)))^3, {k, 1, nmax}], {x, 0, nmax}], x] (* Vaclav Kotesovec, Sep 07 2015 *)
-
{a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( (eta(x^2 + A) * eta(x^6 + A) / (eta(x + A) * eta(x^3 + A)))^3, n))};
A084472
Write n in binary and replace 0 with 00.
Original entry on oeis.org
1, 100, 11, 10000, 1001, 1100, 111, 1000000, 100001, 100100, 10011, 110000, 11001, 11100, 1111, 100000000, 10000001, 10000100, 1000011, 10010000, 1001001, 1001100, 100111, 11000000, 1100001, 1100100, 110011, 1110000
Offset: 1
-
Table[FromDigits[Flatten[IntegerDigits[n,2]/.(0->{0,0})]],{n,30}] (* Harvey P. Dale, Aug 27 2019 *)
Showing 1-9 of 9 results.
Comments