login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A350692 Smallest number with exactly n zeros in its digits both in decimal and binary representation. 2
0, 1003, 130007, 1003007, 50200030, 100007900, 1000300030, 102000001007, 1080007000030, 30090004000500, 100004000300030, 1020070000000500, 9000050000003000, 1000000800080003007, 4003700000000300000, 100000070002000003007, 1000006000000010027000 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
Scott R. Shannon, Table of n, a(n) for n = 1..40 (terms 1..23 from Michael S. Branicky)
EXAMPLE
a(2) = 1003 which in binary is 1111101011. Both representations contain exactly 2 zeros. And there is no smaller number satisfying this constraint.
MATHEMATICA
Join[{0}, Table[
t=0; While[!IntegerQ[k=Min@Flatten[Select[FromDigits/@ Select[Permutations[#], First@#!=0&], Count[IntegerDigits[#, 2], 0]==n&]&/@(Join[Table[0, n], #]&/@Tuples[Range@9, ++t])]]]; k, {n, 2, 7}]] (* Giorgos Kalogeropoulos, Jan 13 2022 *)
PROG
(Python)
from itertools import count
def A350692_helper(n, m): # generator in order of numbers with n decimal digits and m 0's. Leading zeros are allowed.
if n >= m:
if n == 1:
if m == 1:
yield 0
else:
yield from range(1, 10)
elif n == m:
yield 0
else:
for b in A350692_helper(n-1, m-1):
yield b
r = 10**(n-1)
for a in range(1, 10):
k = a*r
for b in A350692_helper(n-1, m):
yield k+b
def A350692(n):
if n == 1:
return 0
for l in count(n):
r = 10**(l-1)
for a in range(1, 10):
k = a*r
for s in A350692_helper(l-1, n):
m = k+s
if bin(m)[2:].count('0') == n:
return m # Chai Wah Wu, Jan 13 2022
CROSSREFS
Sequence in context: A151956 A111349 A182935 * A013686 A153226 A202147
KEYWORD
nonn,base
AUTHOR
Ruediger Jehn, Jan 12 2022
EXTENSIONS
a(8)-a(17) from Michael S. Branicky, Jan 12 2022
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 17 23:23 EDT 2024. Contains 371767 sequences. (Running on oeis4.)