OFFSET
1,2
COMMENTS
All terms are odd.
EXAMPLE
a(3) = 15 is a term because 15 = 1111_2 and 1111 == 1 (mod 15).
MAPLE
filter:= t -> convert(t, binary) mod t = 1: filter(1):= true:
select(filter, [seq(i, i=1..10^7, 2)]);
MATHEMATICA
Block[{a = {1}, k}, Do[If[Mod[FromDigits@ IntegerDigits[i, 2], i] == 1, AppendTo[a, i]], {i, 2, 10^7}]; a] (* Michael De Vlieger, Dec 12 2020 *)
PROG
(PARI) isok(n) = Mod(fromdigits(binary(n)), n) == 1;
forstep(k=1, 10^7, 2, if(isok(k), print1(k, ", "))); \\ Daniel Suteu, Dec 12 2020
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert Israel, Dec 09 2020
EXTENSIONS
a(30)-a(34) from Daniel Suteu, Dec 12 2020
STATUS
approved