login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A014597 Numbers k such that k^2 is a sum of distinct factorials. 7
1, 3, 5, 11, 12, 27, 29, 71, 72, 213, 215, 603, 635, 1917, 1183893 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

a(16)^2 > 48! (about 1.24139*10^61), if it exists. - Jon E. Schoenfield, Aug 04 2006

A197183(a(n)) = 1. - Reinhard Zumkeller, Dec 04 2011

a(16) > 4.3*10^55 if it exists. - Bert Dobbelaere, Sep 16 2020

REFERENCES

Posting by Dan Hoey to math-fun mailing list.

LINKS

Table of n, a(n) for n=1..15.

Eric Weisstein's World of Mathematics, Factorial

EXAMPLE

1183893^2 = 1! + 2! + 3! + 7! + 8! + 9! + 10! + 11! + 12! + 13! + 14! + 15!.

2 is not a member since 4 is not a sum of distinct factorials.

MATHEMATICA

ok[n_] := (k=1; ff={}; While[k! < n^2, AppendTo[ff, k!]; k++]; xx = Array[x, Length[ff]]; Reduce[And @@ (0 <= # <= 1 & /@ xx) && n^2 == xx.ff, xx, Integers] =!= False); ok[1] = True; Reap[Do[If[ok[n], Print[n]; Sow[n]], {n, 1, 2*10^6}]][[2, 1]] (* Jean-Fran├žois Alcover, Jul 16 2012 *)

PROG

(Haskell)

import Data.List (elemIndices)

a014597 n = a014597_list !! (n-1)

a014597_list = tail $ elemIndices 1 $ map a197183 [0..]

-- Reinhard Zumkeller, Dec 04 2011

(Python)

from math import factorial, isqrt

from itertools import chain, combinations

from sympy.ntheory.primetest import is_square

fac =[factorial(n) for n in range(1, 16)] # raise 16 to search higher

def powerset(s): # skipping empty set

  return chain.from_iterable(combinations(s, r) for r in range(1, len(s)+1))

gen = (isqrt(sum(s)) for s in powerset(fac) if is_square(sum(s)))

print(sorted(set(gen))) # Michael S. Branicky, Jan 03 2021

CROSSREFS

Cf. A025494, A051761, A059589.

Sequence in context: A242269 A309426 A115398 * A130603 A069977 A284795

Adjacent sequences:  A014594 A014595 A014596 * A014598 A014599 A014600

KEYWORD

nonn,more,hard,nice

AUTHOR

Eric W. Weisstein

EXTENSIONS

15th term from Jud McCranie, who remarks that there no others involving terms < 21!.

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 14 17:12 EDT 2022. Contains 356122 sequences. (Running on oeis4.)