OFFSET
3,1
COMMENTS
Sequence is similar to A126800 but differs for the first time at n = 30 and thereafter at n = 30k, where k = 3, 5, 7, 9, 11, 13, 14, 15 ... The generating function for k is not known.
The sequence starts at n = 3 as there are no qualifying divisors for n = 1 or n = 2.
LINKS
K. Spage, Table of n, a(n) for n = 3..1000
FORMULA
a(n) = n if n is an odd prime.
EXAMPLE
For n = 30 the smallest prime not dividing n is 7 and the smallest divisor of 30 that is greater than 7 is 10, so a(30) = 10.
MAPLE
a:= proc(n)
uses numtheory;
local F, p;
if n::odd then p:= 2
else
F:= map(pi, factorset(n));
p:= ithprime(min(map(`+`, F, 1) minus F));
fi;
min(select(`>`, divisors(n), p));
end proc:
seq(a(n), n=3..100); # Robert Israel, Jul 31 2014
MATHEMATICA
A053669[n_] := Module[{p}, For[p = 2, True, p = NextPrime[p], If[CoprimeQ[n, p], Return[p]]]];
Table[A245689[n], {n, 3, 100}] (* Jean-François Alcover, May 15 2023 *)
PROG
CROSSREFS
KEYWORD
nonn
AUTHOR
K. Spage, Jul 29 2014
STATUS
approved