OFFSET
1,1
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
G. E. Hardy and M. V. Subbarao, A modified problem of Pillai and some related questions, Amer. Math. Monthly 109:6 (2002), pp. 554-559.
FORMULA
19 <= a(n) <= p-7 for n > 11, where p = A063980(n).
PROG
(PARI) last(p)=if(p==23, 18, my(t=Mod(1/120, p)); forstep(m=p-6, 8, -1, t/=m; if(t==-1, return(m-1))))
Pillai(p)=my(t=Mod(5040, p)); for(m=8, p-2, t*=m; if(t==-1 && p%m!=1, return(1))); 0
apply(last, select(Pillai, primes(300)))
CROSSREFS
KEYWORD
nonn
AUTHOR
Charles R Greathouse IV, Feb 10 2013
STATUS
approved