login
A358074
a(n) is the number of distinct ways n can be written as the sum of a perfect square and factorial.
0
1, 2, 1, 0, 1, 2, 1, 0, 0, 2, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
OFFSET
1,2
COMMENTS
This does not count x^2 and (-x)^2 as distinct, nor does it count 0! and 1! as distinct.
EXAMPLE
2 = 0^2 + 2! = 1^2 + 1!, so a(2) = 2.
MATHEMATICA
With[{f = Range[5]!}, a[n_] := Count[f, _?(IntegerQ @ Sqrt[n - #] &)]; Array[a, f[[-1]]]] (* Amiram Eldar, Oct 30 2022 *)
CROSSREFS
Sequence in context: A298247 A035148 A155077 * A170968 A114114 A090787
KEYWORD
nonn
AUTHOR
Walter Robinson, Oct 29 2022
STATUS
approved