OFFSET
1,1
COMMENTS
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
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
Robert Israel, May 11 2020
STATUS
approved