|
|
A100083
|
|
Numbers n such that n divides Sum_{m=1..n} (m+1)!.
|
|
2
|
|
|
1, 2, 4, 8, 31, 62, 124, 248, 373, 746, 1492, 2984, 11563, 23126, 46252, 92504
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
n | Sum_{m=1..n} (m+1)! => n | Sum_{m=2..n+1} m! => n | Sum_{m=2..n-1} m! for n>2 => Sum_{m=2..n-1+k} m! == 0 (mod n) for all k>=0. If n is present and even, then n/2 is present. - Robert G. Wilson v, Nov 11 2004
The terms occur in groups of 4, in a series of n, 2n, 4n, and 8n. Is there any way of calculating the next term in the reduced series: 1, 31, 373, 11563? - Harvey P. Dale, Jun 11 2013
If n is in the sequence and k|n, then k is also in the sequence. In the other direction, if s and t is in the sequence and gcd(s,t)=1, then n=s*t is also in the sequence. Therefore, we need to check only the prime powers, after which we can easily build the rest of the sequence. The prime powers in the sequence begin with 2, 4, 8, 31, 373, ... - Robert Gerbicz, Jun 11 2013
For any terms in this sequence, their LCM also belongs to this sequence. If a(17) exists, it is prime. - Max Alekseyev, Jun 11 2013
|
|
LINKS
|
R. Gerbicz (and others), Re: A100083, SeqFan list, Jun 11 2013
|
|
FORMULA
|
|
|
EXAMPLE
|
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.
|
|
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 *)
|
|
PROG
|
(PARI) s=0:for(n=1, 5000, s=s+(n+1)!: if(s%n==0, print(n)))
(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
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,more,changed
|
|
AUTHOR
|
Mark Hudson (mrmarkhudson(AT)hotmail.com), Nov 08 2004
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|