login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A108908
Largest n-digit number coprime to n.
0
9, 99, 998, 9999, 99999, 999997, 9999999, 99999999, 999999998, 9999999999, 99999999999, 999999999997, 9999999999999, 99999999999999, 999999999999998, 9999999999999999, 99999999999999999, 999999999999999997
OFFSET
1,1
COMMENTS
a(286) = 10^286 - 5 is the first term with a(n) < 10^n - 3. - Rick L. Shepherd
MATHEMATICA
f[n_] := Block[{k=10^n-1}, While[ GCD[n, k]>1, k-- ]; k]; Table[ f[n], {n, 18}] (* Robert G. Wilson v *)
PROG
(PARI) for(n=1, 300, m=10^n-1; while(gcd(m, n)>1, m--); print1(m, ", ")) (Rick L. Shepherd)
CROSSREFS
Sequence in context: A070843 A261512 A242809 * A116260 A103456 A002283
KEYWORD
base,easy,nonn
AUTHOR
Amarnath Murthy, Jul 19 2005
EXTENSIONS
More terms from Rick L. Shepherd and Robert G. Wilson v, Jul 21 2005
STATUS
approved