OFFSET
1,1
LINKS
Felix Fröhlich, Table of n, a(n) for n = 1..4000
Wikipedia, Knödel number.
MATHEMATICA
Table[SelectFirst[Range[n + 1, 10^3], Function[c, CompositeQ@ c && AllTrue[Range[1, c - 1] /. x_ /; ! CoprimeQ[x, c] -> Nothing, Mod[#^(c - n), c] == 1 &]]], {n, 65}] (* Michael De Vlieger, Apr 06 2016, Version 10 *)
PROG
(PARI) a(n) = forcomposite(c=n+1, , my(i=0, j=0); for(b=1, c-1, if(gcd(b, c)==1, i++; if(Mod(b, c)^(c-n)==1, j++))); if(i==j, return(c)))
CROSSREFS
KEYWORD
nonn
AUTHOR
Felix Fröhlich, Apr 06 2016
STATUS
approved