|
|
A340161
|
|
a(n) is the smallest number k for which the set {k + 1, k + 2, ..., k + k} contains exactly n elements with exactly three 1-bits (A014311).
|
|
0
|
|
|
1, 4, 6, 7, 10, 11, 13, 18, 19, 21, 25, 34, 35, 37, 41, 49, 66, 67, 69, 73, 81, 97, 130, 131, 133, 137, 145, 161, 193, 258, 259, 261, 265, 273, 289, 321, 385, 514, 515, 517, 521, 529, 545, 577, 641, 769, 1026, 1027, 1029, 1033, 1041, 1057, 1089, 1153, 1281, 1537
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
When n = m*(m-1)/2 + 1, m >= 2 (A000124 \ {1}), then a(n) = k = 2^m+2, m >= 2 (A052548 \ {3, 4}), and only for these values of k, there exists only one set, {k+1, k+2, ..., 2k}, that contains exactly n elements whose binary representation has exactly three 1's (see A340068). - Bernard Schott, Jan 03 2021
Proof: Let T(k) be the number of values in {k+1, k+2, ..., k+k} that have exactly 3 ones in their binary expansion. Let h(k) be 1 if k has exactly 3 ones in its binary expansion and 0 otherwise and let w(k) be the binary weight of k (cf. A000120). Then T(k + 1) = T(k) + h(2*k + 1) + h(2*k + 2) - h(k + 1) = T(k) + h(2*k + 1) + h(2*(k + 1)) - h(k + 1) but as h(2^m * k) = h(k) two terms cancel and we have T(k + 1) = T(k) + h(2*k + 1). If w(2*k + 1) = w(k) + 1 = 3 then w(k) = 2 which holds for k in A018900. (End)
|
|
LINKS
|
|
|
FORMULA
|
a(m*(m-1)/2 + 1) = 2^m + 2 for m >= 2.
a(m*(m-1)/2 + 2) = 2^m + 3 for m >= 2.
|
|
EXAMPLE
|
For k in {1, 2, 3}, the sets are {1, 2}, {3, 4} and {4, 5, 6}, which do not contain numbers in A014311, so a(0) = 1.
For k = 4, the set is {5, 6, 7, 8} with 7 = A014311(1), so a(1) = 4.
For k = 6, the set {7, 8, 9, 10, 11, 12} contains the elements 7 = A014311(1) and 11 = A014311(2), so a(2) = 6.
|
|
PROG
|
(Magma) fb:=func<n|(Multiplicity(Intseq(n, 2), 1)) eq 3>; a:=[]; for n in [0..64] do k:=1; while #[s:s in [k+1..2*k]|fb(s)] ne n do k:=k+1; end while; Append(~a, k); end for; a;
(PARI) first(n) = {my(res = vector(n), t = 1); res[1] = 1; for(i = 2, oo, if(hammingweight(2*i-1) == 3, t++; if(t > n, return(res)); res[t] = i))} \\ David A. Corneth, Jan 03 2021
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|