%I #28 Nov 02 2023 14:18:18
%S 14,18,15,8,18,9,23,13,86,16,16,50,102,61,64,210,97,31,9,93,40,45,63,
%T 220,91,122,35,85,198,93,128,316,366,74,300,151,290,15,400,282,22,188,
%U 167,191,360,426,274,271,456,278,229,324,135,498,189
%N Smallest m associated with n-th Pillai prime (A063980).
%H Charles R Greathouse IV, <a href="/A063828/b063828.txt">Table of n, a(n) for n = 1..10000</a> (first 1000 terms from T. D. Noe)
%H G. E. Hardy and M. V. Subbarao, <a href="https://www.jstor.org/stable/2695445">A modified problem of Pillai and some related questions</a>, Amer. Math. Monthly 109 (2002), no. 6, 554-559.
%e 14! + 1 == 0 (mod 23), while 23 != 1 (mod 14), where 23=A063980(1) so a(1)=14.
%t nn=1000; fact=1+Rest[FoldList[Times,1,Range[nn]]]; t={}; Do[p=Prime[i]; m=2; While[m<p && !(Mod[p,m]!=1 && Mod[fact[[m]],p]==0), m++]; If[m<p, AppendTo[t,m]], {i,2,PrimePi[nn]}]; t (* _T. D. Noe_, Apr 22 2011 *)
%o (PARI) first(p)=my(t=Mod(5040, p)); for(m=8, p, t*=m; if(t==-1 && p%m!=1, return(m))); 0
%o Pillai(p)=my(t=Mod(5040, p)); for(m=8, p-2, t*=m; if(t==-1 && p%m!=1, return(1))); 0
%o apply(first, select(Pillai, primes(300))) \\ _Charles R Greathouse IV_, Feb 10 2013
%Y Cf. A063980, A211411.
%K nonn
%O 1,1
%A _N. J. A. Sloane_, Sep 23 2001
%E More terms from _Vladeta Jovovic_, Sep 27 2001
|