login
A381494
Smallest number with reciprocal of period length n in base 7.
1
1, 2, 4, 9, 5, 2801, 36, 29, 64, 27, 11, 1123, 13, 16148168401, 113, 31, 17, 14009, 108, 419, 55, 261, 23, 47, 73, 2551, 53, 81, 145, 59, 99, 311, 256, 3631, 56036, 81229, 135, 223, 1676, 486643, 41, 83, 1017, 166003607842448777, 115, 837, 188, 13722816749522711, 153, 3529, 10204
OFFSET
0,2
COMMENTS
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.
REFERENCES
J. Brillhart et al., Factorizations of b^n +- 1. Contemporary Mathematics, Vol. 22, Amer. Math. Soc., Providence, RI, 2nd edition, 1985; and later supplements.
LINKS
FORMULA
Conjecture: a(n) = A218358(n) for n>=2. - R. J. Mathar, Mar 03 2025
EXAMPLE
a(3)=9 since 1/9 has period 3 in base 7 (.053053053...) and no smaller number has this property.
MAPLE
f:= proc(n) uses priqueue; local F, nF, pq, i, j, t, d;
F:= ifactors(7^n-1)[2]; nF:= nops(F);
initialize(pq);
for i from 1 to nF do insert([-F[i, 1], subsop(i=1, [0$nF]), NumberTheory:-MultiplicativeOrder(7, F[i, 1])], pq) od;
do
t:= extract(pq);
d:= -t[1];
if t[3] = n then return d fi;
for i from nF to 1 by -1 while t[2][i] = 0 do od:
if t[2][i] < F[i, 2] then
insert([t[1]*F[i, 1], subsop(i=t[2][i]+1, t[2]), ilcm(NumberTheory:-MultiplicativeOrder(7, F[i, 1]^(t[2][i]+1)), t[3])], pq)
fi;
for j from i+1 to nF do
insert([t[1]*F[j, 1], subsop(j = 1, t[2]), ilcm(NumberTheory:-MultiplicativeOrder(7, F[j, 1]), t[3])], pq)
od;
od;
FAIL
end proc:
f(0):= 1: f(1):= 2:
map(f, [$0..60]); # Robert Israel, Mar 01 2026
MATHEMATICA
a[n_] := First[Select[Divisors[7^n - 1], MultiplicativeOrder[7, #] == n &, 1]];
a[0] = 1; a[1] = 2; Table[a[n], {n, 0, 50}]
PROG
(Python)
from sympy import divisors
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
CROSSREFS
Sequence in context: A161360 A230242 A104654 * A011182 A392802 A304753
KEYWORD
nonn,base
AUTHOR
Erich Friedman, Feb 25 2025
STATUS
approved