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.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
Rémy Sigrist, C++ program
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
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Sep 09 2024
STATUS
approved