login
A109942
Largest k-digit number coprime to n, where k is the number of digits in n.
1
9, 9, 8, 9, 9, 7, 9, 9, 8, 99, 98, 97, 99, 99, 98, 99, 99, 97, 99, 99, 97, 97, 99, 97, 99, 99, 98, 99, 99, 97, 99, 99, 98, 99, 99, 97, 99, 99, 98, 99, 99, 97, 99, 97, 98, 99, 99, 97, 99, 99, 98, 99, 99, 97, 98, 99, 98, 99, 99, 97, 99, 99, 97, 99, 99, 97, 99, 99, 98, 99, 99, 97
OFFSET
1,1
LINKS
FORMULA
a(n) >= n+1 unless n is in A002283, in which case a(n)=n-1. - Robert Israel, Jan 30 2017
MAPLE
f:= proc(n) local k;
for k from 10^(1+ilog10(n))-1 by -1 do
if igcd(n, k) = 1 then return k fi
od
end proc:
map(f, [$1..100]); # Robert Israel, Jan 30 2017
CROSSREFS
Sequence in context: A050812 A139345 A231470 * A339745 A346929 A346927
KEYWORD
base,easy,nonn
AUTHOR
Amarnath Murthy, Jul 19 2005
EXTENSIONS
More terms from David Wasserman, Jul 19 2005
STATUS
approved