OFFSET
1,2
COMMENTS
If k is a term, then so is 10*k.
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..2692 (n = 1..1000 from Robert Israel)
EXAMPLE
a(8) = 12 is a term because 1/12 = 0.08333... does not contain the digit 5.
MAPLE
filter:= proc(n) local q;
q:= NumberTheory:-RepeatingDecimal(1/n);
not(member(5, RepeatingPart(q)) or member(5, NonRepeatingPart(q)))
end proc:
select(filter, [$1..300]);
MATHEMATICA
Select[Range[500], FreeQ[First[RealDigits[1/#]], 5] &] (* Paolo Xausa, Apr 23 2024 *)
PROG
(Python)
from itertools import count, islice
from sympy import multiplicity, n_order
def A362579_gen(startvalue=1): # generator of terms >= startvalue
for a in count(max(startvalue, 1)):
m2, m5 = (~a&a-1).bit_length(), multiplicity(5, a)
k, m = 10**max(m2, m5), 10**n_order(10, a//(1<<m2)//5**m5)-1
if not('5' in str(c:=k//a) or '5' in str(m*k//a-c*m)):
yield a
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert Israel, Apr 25 2023
STATUS
approved
