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.

A381494 Smallest number with reciprocal of period length n in base 7.

This page as a plain text file.
%I A381494 #17 Mar 03 2025 09:32:16
%S A381494 1,2,4,9,5,2801,36,29,64,27,11,1123,13,16148168401,113,31,17,14009,
%T A381494 108,419,55,261,23,47,73,2551,53,81,145,59,99,311,256,3631,56036,
%U A381494 81229,135,223,1676,486643,41,83,1017,166003607842448777,115,837,188,13722816749522711,153,3529,10204
%N A381494 Smallest number with reciprocal of period length n in base 7.
%C A381494 For n > 1, a(n) is the smallest positive d such that d divides 7^n - 1 and does not divide any of 7^k - 1 for 0 < k < n.
%D A381494 J. Brillhart et al., Factorizations of b^n +- 1. Contemporary Mathematics, Vol. 22, Amer. Math. Soc., Providence, RI, 2nd edition, 1985; and later supplements.
%F A381494 Conjecture: a(n) = A218358(n) for n>=2. - _R. J. Mathar_, Mar 03 2025
%e A381494 a(3)=9 since 1/9 has period 3 in base 7 (.053053053...) and no smaller number has this property.
%p A381494 f:= proc(n) local d,k;
%p A381494       for d in sort(convert(numtheory:-divisors(7^n-1),list)) do
%p A381494         if andmap(k -> 7^k-1 mod d <> 0, [$1 .. n-1]) then return d fi
%p A381494       od
%p A381494 end proc:
%p A381494 f(0):= 1: f(1):= 2:
%p A381494 map(f, [$0..80]); # _Robert Israel_, Feb 28 2025
%t A381494 a[n_] := First[Select[Divisors[7^n - 1], MultiplicativeOrder[7, #] == n &, 1]];
%t A381494 a[0] = 1; a[1] = 2; Table[a[n], {n, 0, 50}]
%o A381494 (Python)
%o A381494 from sympy import divisors
%o A381494 def A381494(n): return next(d for d in divisors(7**n-1) if d>1 and all(pow(7,k,d)!=1 for k in range(1,n))) if n else 1 # _Chai Wah Wu_, Feb 28 2025
%Y A381494 Cf. A003060, A379640.
%K A381494 nonn,base
%O A381494 0,2
%A A381494 _Erich Friedman_, Feb 25 2025