A100083 Numbers n such that n divides Sum_{m=1..n} (m+1)!.
1, 2, 4, 8, 31, 62, 124, 248, 373, 746, 1492, 2984, 11563, 23126, 46252, 92504
Offset: 1
Examples
The first few partial sums of (m+1)!, starting with m=1 are 2, 8, 32, 152, 872, 5912, 46232, 409112. Of these, 2 is divisible by 1; 8 is divisible by 2; 152 is divisible by 4; but 32 is not divisible by 3. Therefore the first few terms of this sequence are 1, 2, 4.
Links
- R. Gerbicz (and others), Re: A100083, SeqFan list, Jun 11 2013
Programs
-
Mathematica
s = -1; Do[s = s + n!; If[ Mod[s, n] == 0, Print[n]], {n, 50000}] (* Robert G. Wilson v, Nov 15 2004 *) Take[Flatten[Select[MapIndexed[List,Accumulate[Range[2,24000]!]], Divisible[#[[1]],#[[2,1]]]&]],{2,-1,2}] (* Harvey P. Dale, Jun 11 2013 *)
-
PARI
s=0:for(n=1,5000,s=s+(n+1)!: if(s%n==0,print(n)))
-
PARI
is(n)=my(t=Mod(1,n));sum(m=2,n+1,t*=m)==0 \\ Charles R Greathouse IV, Jun 11 2013
-
Python
from itertools import count, islice def A100083_gen(startvalue=1): # generator of terms >= startvalue for n in count(max(startvalue,1)): a, c = 0, 1 for m in range(2,n): c = c*m%n if c==0: break a = (a+c)%n if not a: yield n A100083_list = list(islice(A100083_gen(),20)) # Chai Wah Wu, Apr 16 2024
Extensions
a(13)-a(14) from Robert G. Wilson v, Nov 15 2004
a(15) from Harvey P. Dale, Jun 11 2013
Edited by Max Alekseyev, Mar 27 2015
Comments