login
A377265
Numbers n such that 2*n contains one more 1 than does n in its decimal representation.
1
5, 6, 7, 8, 9, 50, 52, 53, 54, 60, 62, 63, 64, 65, 66, 67, 68, 69, 70, 72, 73, 74, 75, 76, 77, 78, 79, 80, 82, 83, 84, 85, 86, 87, 88, 89, 90, 92, 93, 94, 95, 96, 97, 98, 99, 205, 206, 207, 208, 209, 255, 256, 257, 258, 259, 305, 306, 307, 308, 309, 355, 356, 357, 358, 359, 405, 406, 407, 408
OFFSET
1,1
LINKS
FORMULA
A376165(a(n)) = 2 * a(n).
A268643(2 * a(n)) = 1 + A268643(a(n)).
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
Sequence in context: A294239 A250050 A051052 * A119368 A088721 A325435
KEYWORD
nonn,base,look
AUTHOR
Robert Israel, Oct 22 2024
STATUS
approved