login
A376089
Positive numbers k such that the decimal expansions of k and 1/k have the same nonzero digits.
2
1, 3, 10, 30, 33, 100, 300, 303, 330, 333, 1000, 3000, 3003, 3030, 3300, 3330, 3333, 10000, 30000, 30003, 30030, 30300, 30303, 33000, 33300, 33330, 33333, 100000, 108911, 300000, 300003, 300030, 300300, 303000, 303030, 330000, 330033, 333000, 333300, 333330, 333333, 467125
OFFSET
1,2
COMMENTS
A digit d > 0 appears in the decimal expansion of a term iff it appears in the decimal expansion of its reciprocal and vice versa.
This sequence is infinite: if m is a term, then 10*m is also a term.
EXAMPLE
The first terms, alongside their reciprocal (with the repeating part between parentheses), are:
n a(n) 1/a(n)
-- ---- ----------
1 1 1.(0)
2 3 0.(3)
3 10 0.1(0)
4 30 0.0(3)
5 33 0.(03)
6 100 0.01(0)
7 300 0.00(3)
8 303 0.(0033)
9 330 0.0(03)
10 333 0.(003)
11 1000 0.001(0)
12 3000 0.000(3)
13 3003 0.(000333)
14 3030 0.0(0033)
15 3300 0.00(03)
PROG
(C++) // See Links section.
(Python)
from itertools import count, islice
from sympy import multiplicity, n_order
def A376089_gen(startvalue=1): # generator of terms >= startvalue
for a in count(max(startvalue, 1)):
m2, m5 = (~a & a-1).bit_length(), multiplicity(5, a)
b = min(m2, m5)
a2 = a//10**b
m2 -= b
m5 -= b
r = max(m2, m5)
k, m = 10**r, 10**(t := n_order(10, (a2>>m2)//5**m5))-1
c = k//a2
if set(d for d in str(c) if d!='0')|set(d for d in str(m*k//a2-c*m) if d!='0')==set(d for d in str(a2) if d!='0'):
yield a
A376089_list = list(islice(A376089_gen(), 20)) # Chai Wah Wu, Sep 14 2024
CROSSREFS
Cf. A376090.
Sequence in context: A293155 A146384 A166174 * A365224 A365748 A006484
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Sep 09 2024
STATUS
approved