cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A381370 Smallest number with reciprocal of period length n in base 9.

This page as a plain text file.
%I A381370 #35 Feb 28 2025 15:13:50
%S A381370 1,2,5,7,32,11,35,547,17,19,25,23,224,398581,29,31,128,103,95,1597,
%T A381370 352,43,115,47,97,151,53,109,928,59,155,683,256,161,515,71,608,18427,
%U A381370 7985,79,187,83,203,431,89,181,235,1223,896,491,101
%N A381370 Smallest number with reciprocal of period length n in base 9.
%C A381370 For n > 1, a(n) is the smallest positive d such that d divides 9^n - 1 and does not divide any of 9^k - 1 for 0 < k < n.
%D A381370 J. Brillhart et al., Factorizations of b^n +- 1. Contemporary Mathematics, Vol. 22, Amer. Math. Soc., Providence, RI, 2nd edition, 1985; and later supplements.
%e A381370 a(3)=7 because 1/7 has period 3 in base 9 (.125125125...) and no smaller number has this property.
%t A381370 a[n_] := First[Select[Divisors[9^n - 1], MultiplicativeOrder[9, #] == n &, 1]];
%t A381370 a[0] = 1; a[1] = 2; Table[a[n], {n, 0, 50}]
%o A381370 (Python)
%o A381370 from sympy import divisors
%o A381370 def A381370(n): return next(d for d in divisors(9**n-1) if d>1 and all(pow(9,k,d)!=1 for k in range(1,n))) if n else 1 # _Chai Wah Wu_, Feb 28 2025
%Y A381370 Cf. A003060, A379642.
%K A381370 nonn,base
%O A381370 0,2
%A A381370 _Erich Friedman_, Feb 25 2025