|
|
A334798
|
|
Numbers k such that the binary digits of k*(k-1) and k*(k+1) have the same numbers of 0's and the same number of 1's.
|
|
2
|
|
|
7, 15, 25, 31, 43, 48, 54, 63, 80, 84, 87, 110, 113, 127, 142, 144, 147, 162, 171, 172, 177, 183, 185, 197, 199, 203, 216, 217, 221, 226, 227, 232, 234, 238, 243, 255, 275, 281, 290, 301, 303, 308, 317, 322, 323, 329, 340, 343, 349, 355, 367, 370, 377, 389, 391, 402, 411, 418, 423, 426, 427, 432
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
|
|
LINKS
|
|
|
EXAMPLE
|
a(3)=25 is in the sequence because 25*24=600=1001011000_2 and 25*26=650=1010001010_2 both have 6 binary digits 0 and 4 binary digits 1.
|
|
MAPLE
|
filter:= proc(n) local A, B;
A:= convert(n*(n-1), base, 2);
B:= convert(n*(n+1), base, 2);
nops(A)=nops(B) and convert(A, `+`)=convert(B, `+`)
end proc:
select(filter, [$1..1000]);
|
|
MATHEMATICA
|
sn01Q[k_]:=DigitCount[k(k-1), 2, 0]==DigitCount[k(k+1), 2, 0]&&DigitCount[k(k-1), 2, 1] == DigitCount[ k(k+1), 2, 1]; Select[Range[500], sn01Q] (* Harvey P. Dale, May 27 2023 *)
|
|
PROG
|
(PARI) isok(k) = vecsort(binary(k*(k+1))) == vecsort(binary(k*(k-1))); \\ Michel Marcus, May 12 2020
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|