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
Robert Israel, Table of n, a(n) for n = 0..126
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
KEYWORD
nonn,base
AUTHOR
Erich Friedman, Feb 25 2025
STATUS
approved
