login
A362840
a(n) is the smallest number x between 1 and n-1 for which the number 1/x achieves the longest cycle of repeating digits in its expansion in base n.
1
2, 3, 3, 5, 5, 5, 7, 7, 9, 7, 11, 9, 13, 11, 11, 11, 13, 17, 19, 19, 17, 17, 23, 23, 25, 23, 19, 23, 29, 29, 23, 31, 29, 23, 29, 23, 37, 29, 19, 37, 31, 31, 17, 43, 41, 43, 47, 37, 47, 47, 41, 49, 53, 53, 47, 53, 49, 47, 59, 47, 61, 59, 59, 47, 61, 61, 67, 59, 61, 59
OFFSET
3,1
COMMENTS
Terminating expansions, in any base, are considered to have a cycle period of length 0.
It appears by observation that all terms in the sequence are either primes or powers of primes.
EXAMPLE
a(3)=2 since in base 3, 1/2 is represented by 0.111... with a cycle of 1 repeating digit, which is the longest cycle among 1/x for x = 1..2.
a(10)=7 since in base 10, 1/7 is represented by 0.142857... with a cycle of 6 repeating digits, which is the longest cycle among 1/x for x = 1..9.
CROSSREFS
Cf. A362865 (corresponding cycle lengths).
Cf. A051626.
Sequence in context: A280740 A156350 A076367 * A302607 A098567 A086162
KEYWORD
nonn,base
AUTHOR
Itamar Zamir, May 05 2023
STATUS
approved