%I #25 Apr 29 2019 20:49:00
%S 385,21,93,235,2899,903,1771,3619,651,11935,2667,48895,11811,27559,
%T 415555,848995,172011,3153535,761763,1777447,2752491,7281799,11010027,
%U 28442407,48758691,113770279,199753347,466091143,677207307,2064117919,3220807683,7515217927
%N a(n) is the least composite x such that sigma(x) divides (x-1)^n but not (x-1)^(n-1), for n >= 2.
%e sigma(385) = 576; (385 - 1)^2 = 21743271936 and 21743271936 / 576 = 37748736.
%e sigma(21) = 32; (21 - 1)^3 = 8000 and 8000 / 32 = 250.
%e sigma(93) = 128; (93 - 1)^4 = 71639296 and 71639296 / 128 = 559682.
%p with(numtheory):P:=proc(q) local a,j,k,n; for k from 2 to q do
%p for n from 1 to q do if not isprime(n) then
%p if type((n-1)^k/sigma(n),integer) then
%p if not type((n-1)^(k-1)/sigma(n),integer) then lprint(k,n);
%p break; fi; fi; fi; od; od;end: P(10^9);
%t a[n_] := Module[{k=4, s=7}, While[PrimeQ[k] || !(PowerMod[k-1, n, s] == 0 && PowerMod[k-1, n-1, s] > 0), k++; s=DivisorSigma[1, k]]; k]; Array[a, 11, 2] (* _Amiram Eldar_, Apr 08 2019 *)
%o (PARI) a(n) = {x = 4; sx = sigma(x); while(! (((x-1)^(n-1) % sx) && !((x-1)^n % sx)), x++; while (isprime(x), x++); sx = sigma(x)); x;} \\ _Michel Marcus_, Jan 30 2015
%o (PARI) isok(x, n) = my(sx=sigma(x)); (((x-1)^(n-1) % sx) && !((x-1)^n % sx));
%o a(n) = forcomposite(x=4, , if (isok(x, n), return(x))); \\ _Michel Marcus_, Apr 08 2019
%Y Cf. A000203, A234936, A254409.
%K nonn
%O 2,1
%A _Paolo P. Lava_, Jan 30 2015
%E a(22)-a(33) from _Amiram Eldar_, Apr 08 2019