OFFSET
1,3
COMMENTS
If n>1, then from Wilson's theorem (i=1) and a simple corollary to it (i=prime(n)-2) we have a(n)>=2.
Conjecture: There are infinitely many n for which a(n)=2 (the sequence of corresponding primes is A238460).
LINKS
Peter J. C. Moses, Table of n, a(n) for n = 1..1000
EXAMPLE
Let n=4, prime(n)=7. Consider integers i!+6!/i!, i=1,2,3,4,5: 721,362,126,54,126. Among them 721,126,126 are divisible by 7. So a(4)=3.
MAPLE
A238444 := proc(n)
local p, a, i ;
p := ithprime(n) ;
a := 0 ;
for i from 1 to p-2 do
if modp( i!+(p-1)!/i!, p)= 0 then
a := a+1 ;
end if;
end do;
a ;
end proc:
seq(A238444(n), n=1..20) ; # R. J. Mathar, Mar 06 2014
MATHEMATICA
a[n_] := Module[{p, r}, p = Prime[n]; r = Range[p-2]; Count[r!+(p-1)!/r!, k_ /; Divisible[k, p]]]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Feb 27 2014 *)
PROG
(PARI) a(n) = sum(i=1, prime(n)-2, ((i!+(prime(n)-1)!/i!) % prime(n)) == 0); \\ Michel Marcus, Feb 27 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, Feb 26 2014
EXTENSIONS
More terms from Peter J. C. Moses, Feb 26 2014
STATUS
approved