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!)
A096681 Least k such that decimal representation of k*n contains only digits 0 and 2. 18
2, 1, 74, 5, 4, 37, 286, 25, 24691358, 2, 2, 185, 154, 143, 148, 125, 1306, 12345679, 1158, 1, 962, 1, 9574, 925, 8, 77, 81563786, 715, 75938, 74, 7162, 625, 6734, 653, 572, 61728395, 6, 579, 518, 5, 542, 481, 51214, 5, 49382716, 4787, 426, 4625, 44898, 4 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
FORMULA
a(n) = A078241(n)/n.
PROG
(PARI) isok(n) = my(vd = vecsort(digits(n), , 8)); (vd == [0, 2]) || (vd == [2]);
a(n) = my(k=1); while(!isok(k*n), k++); k; \\ Michel Marcus, Sep 25 2016
(Python)
def next02(n):
s = str(n)
if s > '2'*len(s): return int('2' + '0'*len(s))
for i, c in enumerate(s):
if c == '1': return int(s[:i] + '2' + '0'*(len(s)-i-1))
elif s[i:] > '2'*(len(s)-i): return int(s[:i-1] + '2' + '0'*(len(s)-i))
def a(n):
k = 1
while set(str(k*n)) - set('02') != set(): k = max(k+1, next02(k*n)//n)
return k
print([a(n) for n in range(1, 51)]) # Michael S. Branicky, Feb 01 2021
CROSSREFS
Sequence in context: A233472 A284596 A216485 * A247793 A067276 A118580
KEYWORD
base,nonn
AUTHOR
Ray Chandler, Jul 12 2004
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 25 16:45 EDT 2024. Contains 371989 sequences. (Running on oeis4.)