login

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”).

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
OFFSET
1,1
COMMENTS
k such that A023416(k*(k-1)) = A023416(k*(k+1)) and A000120(k*(k-1))=A000120(k*(k+1)).
Either of A023416 and A000120 could be replaced by A070939 in this condition.
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
Includes terms >= 7 of A000225.
Sequence in context: A056119 A329383 A284758 * A211430 A082111 A323483
KEYWORD
nonn,base
AUTHOR
Robert Israel, May 11 2020
STATUS
approved