login
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

%I #38 May 12 2023 12:21:12

%S 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,

%T 19,23,29,29,23,31,29,23,29,23,37,29,19,37,31,31,17,43,41,43,47,37,47,

%U 47,41,49,53,53,47,53,49,47,59,47,61,59,59,47,61,61,67,59,61,59

%N 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.

%C Terminating expansions, in any base, are considered to have a cycle period of length 0.

%C It appears by observation that all terms in the sequence are either primes or powers of primes.

%e 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.

%e 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.

%Y Cf. A362865 (corresponding cycle lengths).

%Y Cf. A051626.

%K nonn,base

%O 3,1

%A _Itamar Zamir_, May 05 2023