The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A173687 Numbers m such that the sum of factorial of the decimal digits of m is square. 3
0, 1, 14, 15, 17, 22, 40, 41, 45, 50, 51, 54, 70, 71, 102, 112, 120, 121, 123, 132, 144, 156, 165, 200, 201, 203, 210, 211, 213, 230, 231, 302, 312, 320, 321, 334, 343, 404, 414, 433, 440, 441, 457, 475, 506, 516, 547, 560, 561, 574, 605, 615, 650, 651, 745, 754, 1000 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
Let the decimal expansion of n = d(0)d(1)...d(p). Numbers such that Sum_{k=0..p} d(k)! is square.
Same as A130687 except for the additional 0. - Georg Fischer, Oct 12 2018
LINKS
EXAMPLE
17 is in the sequence because 1! + 7! = 1 + 5040 = 71^2.
MAPLE
with(numtheory):for n from 0 to 1000 do:l:=length(n):n0:=n:s:=0:for m from
1 to l do:q:=n0:u:=irem(q, 10):v:=iquo(q, 10):n0:=v :s:=s+u!:od: q:=sqrt(s):if
floor(q)= q then printf(`%d, `, n):else fi:od:~
MATHEMATICA
Select[Range[0, 1000], IntegerQ[Sqrt[Total[IntegerDigits[#]!]]]&] (* Jinyuan Wang, Feb 26 2020 *)
PROG
(Magma) [ n: n in [0..1000] | n eq 0 or IsSquare(&+[ Factorial(d): d in Intseq(n) ]) ];
(Python)
from itertools import count, islice, combinations_with_replacement
from math import factorial
from sympy.ntheory.primetest import is_square
from sympy.utilities.iterables import multiset_permutations
def A173687_gen(): # generator of terms
yield 0
for l in count(0):
for i in range(1, 10):
fi = factorial(i)
yield from sorted(int(str(i)+''.join(map(str, k))) for j in combinations_with_replacement(range(10), l) for k in multiset_permutations(j) if is_square(fi+sum(map(factorial, j))))
A173687_list = list(islice(A173687_gen(), 50)) # Chai Wah Wu, Feb 23 2023
CROSSREFS
Sequence in context: A293792 A308974 A130687 * A114962 A278979 A220671
KEYWORD
nonn,base
AUTHOR
Michel Lagneau, Nov 25 2010
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 June 6 03:51 EDT 2024. Contains 373110 sequences. (Running on oeis4.)