login
A079068
Largest prime less than greatest prime factor of n but not dividing n, or 1 if no such prime exists.
10
1, 1, 2, 1, 3, 1, 5, 1, 2, 3, 7, 1, 11, 5, 2, 1, 13, 1, 17, 3, 5, 7, 19, 1, 3, 11, 2, 5, 23, 1, 29, 1, 7, 13, 3, 1, 31, 17, 11, 3, 37, 5, 41, 7, 2, 19, 43, 1, 5, 3, 13, 11, 47, 1, 7, 5, 17, 23, 53, 1, 59, 29, 5, 1, 11, 7, 61, 13, 19, 3, 67, 1, 71, 31, 2, 17, 5, 11, 73, 3, 2, 37, 79, 5, 13, 41, 23
OFFSET
1,3
LINKS
MAPLE
a:= proc(n) local p, s; s:= numtheory[factorset](n);
if s={} then return 1
else p:= max(s);
do if p=2 then return 1 else p:= prevprime(p) fi;
if not p in s then return p fi
od
fi
end:
seq(a(n), n=1..100); # Alois P. Heinz, Sep 03 2019
MATHEMATICA
a[n_] := Module[{p}, For[p = NextPrime[FactorInteger[n][[-1, 1]], -1], p>1, p = NextPrime[p, -1], If[!Divisible[n, p], Return[p]]]; 1];
Array[a, 100] (* Jean-François Alcover, Nov 04 2020 *)
CROSSREFS
Sequence in context: A101387 A117365 A116212 * A133021 A131208 A353467
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Dec 20 2002
STATUS
approved