OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(3) = 7 is a term because 2*7 = 14 has one 1 while 7 has none.
a(107) = 551 is the first term that contains a 1; it is a term because 2 * 551 = 1102 has two 1's while 551 has one.
MAPLE
select(t -> numboccur(1, convert(2*t, base, 10)) = 1 + numboccur(1, convert(t, base, 10)), [$1..1000]);
MATHEMATICA
Select[Range[410], Count[IntegerDigits[2#], 1]-Count[IntegerDigits[#], 1]==1 &] (* Stefano Spezia, Oct 22 2024 *)
PROG
(Python)
from gmpy2 import digits
def ok(n): return digits(2*n).count("1") - digits(n).count("1") == 1
print([k for k in range(410) if ok(k)]) # Michael S. Branicky, Oct 22 2024
CROSSREFS
KEYWORD
AUTHOR
Robert Israel, Oct 22 2024
STATUS
approved