A020336
Numbers whose base-8 representation is the juxtaposition of two identical strings.
Original entry on oeis.org
9, 18, 27, 36, 45, 54, 63, 520, 585, 650, 715, 780, 845, 910, 975, 1040, 1105, 1170, 1235, 1300, 1365, 1430, 1495, 1560, 1625, 1690, 1755, 1820, 1885, 1950, 2015, 2080, 2145, 2210, 2275, 2340, 2405, 2470, 2535, 2600, 2665, 2730, 2795, 2860, 2925, 2990, 3055
Offset: 1
650_10 = 1212_8. - _Jon E. Schoenfield_, Feb 12 2021
A020337
Numbers whose base-9 representation is the juxtaposition of two identical strings.
Original entry on oeis.org
10, 20, 30, 40, 50, 60, 70, 80, 738, 820, 902, 984, 1066, 1148, 1230, 1312, 1394, 1476, 1558, 1640, 1722, 1804, 1886, 1968, 2050, 2132, 2214, 2296, 2378, 2460, 2542, 2624, 2706, 2788, 2870, 2952, 3034, 3116, 3198, 3280, 3362, 3444, 3526, 3608, 3690, 3772
Offset: 1
902_10 = 1212_9. - _Jon E. Schoenfield_, Feb 12 2021
A246830
T(n,k) is the concatenation of n-k and n+k in binary; triangle T(n,k), n>=0, 0<=k<=n, read by rows.
Original entry on oeis.org
0, 3, 2, 10, 7, 4, 15, 20, 13, 6, 36, 29, 22, 15, 8, 45, 38, 31, 40, 25, 10, 54, 47, 72, 57, 42, 27, 12, 63, 104, 89, 74, 59, 44, 29, 14, 136, 121, 106, 91, 76, 61, 46, 31, 16, 153, 138, 123, 108, 93, 78, 63, 80, 49, 18, 170, 155, 140, 125, 110, 95, 144, 113, 82, 51, 20
Offset: 0
Triangle T(n,k) begins:
0
3 2
10 7 4
15 20 13 6
36 29 22 15 8
45 38 31 40 25 10
54 47 72 57 42 27 12
Triangle T(n,k) written in binary (with | denoting the concat operation) begins:
|0
1|1 |10
10|10 1|11 |100
11|11 10|100 1|101 |110
100|100 11|101 10|110 1|111 |1000
101|101 100|110 11|111 10|1000 1|1001 |1010
110|110 101|111 100|1000 11|1001 10|1010 1|1011 |1100
-
import Data.Function (on)
a246830 n k = a246830_tabl !! n !! k
a246830_row n = a246830_tabl !! n
a246830_tabl = zipWith (zipWith f) a051162_tabl a025581_tabl where
f x y = foldr (\b v -> 2 * v + b) 0 $ x |+| y
(|+|) = (++) `on` a030308_row
-- Reinhard Zumkeller, Sep 04 2014
-
f:= proc(i, j) local r, h, k; r:=0; h:=0; k:=j;
while k>0 do r:=r+2^h*irem(k, 2, 'k'); h:=h+1 od; k:=i;
while k>0 do r:=r+2^h*irem(k, 2, 'k'); h:=h+1 od; r
end:
T:= (n, k)-> f(n-k, n+k):
seq(seq(T(n, k), k=0..n), n=0..14);
-
f[i_, j_] := Module[{r, h, k, m}, r=0; h=0; k=j; While[k>0, {k, m} = QuotientRemainder[k, 2]; r = r+2^h*m; h = h+1]; k=i; While[k>0, {k, m} = QuotientRemainder[k, 2]; r = r+2^h*m; h = h+1]; r]; T[n_, k_] := f[n-k, n+k]; Table[Table[T[n, k], {k, 0, n}], {n, 0, 14}] // Flatten (* Jean-François Alcover, Oct 03 2016, adapted from Maple *)
-
A246830 = []
for n in range(10**2):
for k in range(n):
A246830.append(int(bin(n-k)[2:]+bin(n+k)[2:],2))
A246830.append(2*n) # Chai Wah Wu, Sep 05 2014
A320441
Numbers whose binary expansion is quasiperiodic.
Original entry on oeis.org
3, 7, 10, 15, 21, 31, 36, 42, 45, 54, 63, 73, 85, 91, 109, 127, 136, 146, 153, 170, 173, 181, 182, 187, 204, 219, 221, 238, 255, 273, 292, 307, 341, 365, 375, 409, 438, 443, 477, 511, 528, 546, 561, 585, 594, 614, 627, 660, 682, 685, 693, 725, 726, 731, 750
Offset: 1
The first terms, alongside their binary representations and prefixes, are:
n a(n) bin(a(n)) prefix
-- ---- --------- ------
1 3 11 1
2 7 111 1
3 10 1010 10
4 15 1111 1
5 21 10101 101
6 31 11111 1
7 36 100100 100
8 42 101010 10
9 45 101101 101
10 54 110110 110
11 63 111111 1
12 73 1001001 1001
-
isok(w) = { my (tt=0); for (l=1, oo, my (t=w%(2^l)); if (t!=tt, if (t==w, return (0)); my (r=w, g=l); while (g-->=0 && r>=t, r \= 2; if (r%(2^l)==t, if (r==t, return (1), g=l))); tt = t)) }
-
def qp(w):
for i in range(1, len(w)):
prefix, covered = w[:i], set()
for j in range(len(w)-i+1):
if w[j:j+i] == prefix:
covered |= set(range(j, j+i))
if covered == set(range(len(w))):
return True
return False
def ok(n): return qp(bin(n)[2:])
print([k for k in range(751) if ok(k)]) # Michael S. Branicky, Mar 20 2022
A337222
a(n) is the least number that can be obtained by replacing some square XX in the binary expansion of n by X.
Original entry on oeis.org
0, 1, 2, 1, 2, 5, 2, 3, 4, 5, 2, 5, 4, 5, 6, 3, 4, 9, 10, 9, 4, 5, 10, 11, 8, 9, 6, 11, 12, 13, 6, 7, 8, 9, 18, 17, 4, 9, 18, 19, 8, 9, 10, 11, 20, 5, 22, 11, 12, 17, 18, 19, 12, 13, 6, 23, 24, 25, 14, 27, 12, 13, 14, 7, 8, 17, 18, 19, 34, 17, 34, 35, 8, 9, 18
Offset: 0
The first terms, in decimal and in binary, are:
n a(n) bin(n) bin(a(n))
-- ---- ------ ---------
0 0 0 0
1 1 1 1
2 2 10 10
3 1 11 1
4 2 100 10
5 5 101 101
6 2 110 10
7 3 111 11
8 4 1000 100
9 5 1001 101
10 2 1010 10
11 5 1011 101
12 4 1100 100
13 5 1101 101
14 6 1110 110
15 3 1111 11
16 4 10000 100
A246834
A(n,k) is the concatenation of n and k*n in binary; square array A(n,k), n>=0, k>=0, read by antidiagonals.
Original entry on oeis.org
0, 0, 1, 0, 3, 2, 0, 6, 10, 3, 0, 7, 20, 15, 4, 0, 12, 22, 30, 36, 5, 0, 13, 40, 57, 72, 45, 6, 0, 14, 42, 60, 76, 90, 54, 7, 0, 15, 44, 63, 144, 95, 108, 63, 8, 0, 24, 46, 114, 148, 180, 210, 126, 136, 9, 0, 25, 80, 117, 152, 185, 216, 245, 272, 153, 10
Offset: 0
Square array A(n,k) begins:
0, 0, 0, 0, 0, 0, 0, 0, 0, ...
1, 3, 6, 7, 12, 13, 14, 15, 24, ...
2, 10, 20, 22, 40, 42, 44, 46, 80, ...
3, 15, 30, 57, 60, 63, 114, 117, 120, ...
4, 36, 72, 76, 144, 148, 152, 156, 288, ...
5, 45, 90, 95, 180, 185, 190, 355, 360, ...
6, 54, 108, 210, 216, 222, 420, 426, 432, ...
7, 63, 126, 245, 252, 483, 490, 497, 504, ...
8, 136, 272, 280, 544, 552, 560, 568, 1088, ...
-
f:= proc(i, j) local r, h, k; r:=0; h:=0; k:=j;
while k>0 do r:=r+2^h*irem(k, 2, 'k'); h:=h+1 od; k:=i;
while k>0 do r:=r+2^h*irem(k, 2, 'k'); h:=h+1 od; r
end:
A:= (n, k)-> f(n, k*n):
seq(seq(A(n, d-n), n=0..d), d=0..14);
A297405
Binary "cubes"; numbers whose binary representation consists of three consecutive identical blocks.
Original entry on oeis.org
7, 42, 63, 292, 365, 438, 511, 2184, 2457, 2730, 3003, 3276, 3549, 3822, 4095, 16912, 17969, 19026, 20083, 21140, 22197, 23254, 24311, 25368, 26425, 27482, 28539, 29596, 30653, 31710, 32767, 133152, 137313, 141474, 145635, 149796, 153957, 158118, 162279, 166440, 170601, 174762, 178923, 183084, 187245
Offset: 1
42 in base 2 is 101010, which consists of three copies of the block "10".
Cf.
A020330, which is the corresponding sequence for squares.
-
a:= n-> (p-> n*(1+2^p+4^p))(1+ilog2(n)):
seq(a(n), n=1..50); # Alois P. Heinz, Dec 29 2017
-
bc[n_]:=FromDigits[Join[n,n,n],2]; Flatten[Table[bc/@Select[Tuples[ {1,0},n],#[[1]] == 1&],{n,6}]]//Union (* Harvey P. Dale, Oct 09 2021 *)
-
a(n) = n=binary(n); fromdigits(concat([n, n, n]) , 2) \\ Iain Fox, Jul 04 2022
-
def a(n): return int(bin(n)[2:]*3, 2)
print([a(n) for n in range(1, 46)]) # Michael S. Branicky, Jul 04 2022
# Alternative:
def A297405(n):
p = n.bit_length()
return n * (1 + 2**p + 4**p)
print([A297405(n) for n in range(1, 46)]) # Peter Luschny, Jul 05 2022
A267508
Smallest number "c-equivalent" to n.
Original entry on oeis.org
1, 2, 3, 4, 5, 5, 7, 8, 9, 10, 11, 9, 11, 11, 15, 16, 17, 18, 19, 18, 21, 21, 23, 17, 19, 21, 23, 19, 23, 23, 31, 32, 33, 34, 35, 36, 37, 37, 39, 34, 37, 42, 43, 37, 43, 43, 47, 33, 35, 37, 39, 37, 43, 43, 47, 35, 39, 43, 47, 39, 47, 47, 63, 64, 65, 66, 67, 68, 69, 69, 71, 68, 73
Offset: 1
The set of integers c-equivalent to 38 is {37,38,41,44,50,52} (with the binary representations 100101, 100110, 101001, 101100, 110010, and 110100, respectively). The smallest of these numbers is 37. Thus, a(38) = 37. Alternatively, the substrings of 100110_binary = 38 correspond to writing 6 as the sum of 3+1+2, which is a permutation of the partition 6 = 3+2+1, where the right hand side corresponds to 37. (On the other hand, only 41 and 52 may be achieved from 38 by cyclic permutations of the bits, whence A163382(38) = 38.)
A321226
Describe the binary representation of n in binary and convert back to decimal.
Original entry on oeis.org
2, 3, 14, 5, 28, 59, 22, 7, 30, 115, 238, 117, 44, 91, 30, 9, 56, 123, 462, 229, 476, 955, 470, 119, 46, 179, 366, 181, 60, 123, 38, 11, 58, 227, 494, 245, 924, 1851, 918, 231, 478, 1907, 3822, 1909, 940, 1883, 478, 233, 88, 187, 718, 357, 732, 1467, 726, 183
Offset: 0
For n = 67:
- the binary representation of 67 is "1000011",
- we see, in binary: "1" "1", "100" "0", "10" "1",
- hence the binary representation of a(67) is "111000101",
- and a(67) = 453 in decimal.
-
a(n, b=2) = if (n==0, return (b)); my (d=digits(b*n, b), v=0, w=0); d[#d] = -1; for (i=1, #d-1, w++; if (d[i]!=d[i+1], v = b*(v*b^#digits(w, b) + w) + d[i]; w = 0)); v
A344259
For any number n with binary expansion (b(1), ..., b(k)), the binary expansion of a(n) is (b(1), ..., b(ceiling(k/2))).
Original entry on oeis.org
0, 1, 1, 1, 2, 2, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10
Offset: 0
The first terms, alongside their binary expansion, are:
n a(n) bin(n) bin(a(n))
-- ---- ------ ---------
0 0 0 0
1 1 1 1
2 1 10 1
3 1 11 1
4 2 100 10
5 2 101 10
6 3 110 11
7 3 111 11
8 2 1000 10
9 2 1001 10
10 2 1010 10
11 2 1011 10
12 3 1100 11
13 3 1101 11
14 3 1110 11
15 3 1111 11
-
Array[FromDigits[First@Partition[l=IntegerDigits[#,2],Ceiling[Length@l/2]],2]&,100,0] (* Giorgos Kalogeropoulos, May 14 2021 *)
-
a(n) = n\2^(#binary(n)\2)
-
def a(n): b = bin(n)[2:]; return int(b[:(len(b)+1)//2], 2)
print([a(n) for n in range(85)]) # Michael S. Branicky, May 14 2021
Comments