cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A358071 Numbers k that can be written as the sum of a perfect square and a factorial in at least 2 distinct ways.

This page as a plain text file.
%I A358071 #33 Aug 09 2025 09:56:49
%S A358071 2,6,10,124,145,220,649,745,1081,1249,1345,2929,3601,3745,5065,5076,
%T A358071 5161,5209,5481,6049,6196,6265,6804,7249,7945,8289,9529,11124,14644,
%U A358071 15649,17361,17809,21169,22921,30649,35316,40321,40384,40720,40761,43456,43569,43801
%N A358071 Numbers k that can be written as the sum of a perfect square and a factorial in at least 2 distinct ways.
%C A358071 This does not count x^2 and (-x)^2 as distinct, nor does it count 0! and 1! as distinct.
%C A358071 For any two factorials a > b, where a-b = m*n where m > n and (m and n are both even or m and n are both odd), (((m-n)/2)^2 + a) will appear in this sequence.
%H A358071 Robert Israel, <a href="/A358071/b358071.txt">Table of n, a(n) for n = 1..3661</a>
%e A358071 145 = 5^2 + 5! = 11^2 + 4! = 12^2 + 1!.
%p A358071 Nf:= 15: # for terms <= (Nf) + 1!
%p A358071 Facts:= [seq(i!, i=1..Nf)]:
%p A358071 N:= Facts[-1]+1:
%p A358071 R:= 'R':
%p A358071 for i from 0 to isqrt(N) do
%p A358071   for j from 1 to Nf do
%p A358071     v:= Facts[j]+i^2;
%p A358071     if v > N then break fi;
%p A358071     if not assigned(R[v]) then R[v]:= [i,j]
%p A358071     else R[v]:= R[v],[i,j]
%p A358071     fi
%p A358071 od od:
%p A358071 J:= [indices(R)]:
%p A358071 sort(map(op, select(t -> nops([R[op(t)]])>=2, J))); # _Robert Israel_, Aug 08 2025
%t A358071 With[{f = Range[8]!}, c[n_] := Count[f, _?(IntegerQ @ Sqrt[n - #] &)]; Select[Range[f[[-1]]], c[#] > 1 &]] (* _Amiram Eldar_, Oct 30 2022 *)
%Y A358071 Cf. A000142, A000290.
%K A358071 nonn
%O A358071 1,1
%A A358071 _Walter Robinson_, Oct 30 2022