%I #30 Mar 17 2020 14:37:57
%S 2,31,757,65537,19531,3154757,2767631689,9857737155463,
%T 926510094425921,440334654777631,50544702849929377,
%U 3335672988472972523,846041103974872866961,459715689149916492091,92978587355640205970336221,78919881726271091143763623681,26552618219228090162977481,1338029376807245057016053427001,11951068054199383402102234839038071
%N a(n) is the least prime p such that n <= ord(n, p)^n < p, where ord(n, p) is the multiplicative order of n modulo p, or 1, if there is no such p.
%p f:= proc(n) local k, pmin, p;
%p pmin:= infinity;
%p for k from n while k^n < pmin do
%p for p in numtheory:-factorset(n^k-1) do
%p if p < pmin and p > k^n then pmin:= p fi
%p od
%p od;
%p pmin
%p end proc:
%p f(1):= 2:
%p seq(f(n),n=1..18); # _Robert Israel_, Mar 17 2020
%Y Inspired by A333245.
%K nonn,hard
%O 1,1
%A _Peter Luschny_, Mar 17 2020
%E More terms from _Robert Israel_, Mar 17 2020