login
A363212
Sums of distinct factorials that are of the form x^2 - 1.
0
0, 3, 8, 24, 120, 728, 840, 5040, 45368, 46224, 363608, 403224, 3674888, 1401602635448
OFFSET
1,2
COMMENTS
0! and 1! are not considered to be distinct.
a(15) > 40! if it exists. - Bert Dobbelaere, Jun 13 2023
From Jon E. Schoenfield, Jun 03 2023: (Start)
There exist only 9 residues (x^2 - 1) mod 7! that are sums of distinct factorials:
0 (the empty sum)
3 = 2! + 1!
8 = 3! + 2!
24 = 4!
120 = 5!
720 = 6!
728 = 6! + 3! + 2!
840 = 6! + 5!
864 = 6! + 5! + 4!
Thus, if an exhaustive search were to be performed for terms having any given set of factorial indices >= 7 (e.g., a search for terms of the form 10! + 8! + 7! + ..., where the ellipsis represents a sum of 0 or more distinct factorials from {1!, 2!, 3!, 4!, 5!, 6!}), rather than testing all 2^6 = 64 subset sums of those 6 smallest factorials, only the 9 residues listed above would need to be considered. E.g., for 10! + 8! + 7! = 3674160, only the 9 sums s = 3674160 + {0, 3, 8, ..., 864} would need to be checked to see whether s+1 is a square (x^2).
However, since 1916 < sqrt(3674160) < 1917, and 1918^2 > s + 864, the only possible solution is at x = 1917, which gives 1917^2 - 1 = 3674888 = 3674160 + 728, and 728 is one of the 9 possible residues mod 7!, so 3674888 is a term.
(End)
EXAMPLE
a(6) = 728 is a term because 728 = 2! + 3! + 6! = 27^2 - 1.
MAPLE
filter:= proc(n) local m, x, i;
x:= n;
for m from 1 while m! < n do od:
for i from m to 1 by -1 do
if x >= i! then
x:= x - i!;
if x = 0 then return true fi;
fi
od;
false
end proc:
filter(0):= true:
select(filter, [seq(i^2-1, i=1..10^7)]);
CROSSREFS
Intersection of A005563 and A059590. Cf. A014597.
Sequence in context: A174662 A002104 A102919 * A102476 A348418 A302109
KEYWORD
nonn,more
AUTHOR
Robert Israel, May 30 2023
STATUS
approved