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.

Original entry on oeis.org

2, 6, 10, 124, 145, 220, 649, 745, 1081, 1249, 1345, 2929, 3601, 3745, 5065, 5076, 5161, 5209, 5481, 6049, 6196, 6265, 6804, 7249, 7945, 8289, 9529, 11124, 14644, 15649, 17361, 17809, 21169, 22921, 30649, 35316, 40321, 40384, 40720, 40761, 43456, 43569, 43801
Offset: 1

Views

Author

Walter Robinson, Oct 30 2022

Keywords

Comments

This does not count x^2 and (-x)^2 as distinct, nor does it count 0! and 1! as distinct.
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.

Examples

			145 = 5^2 + 5! = 11^2 + 4! = 12^2 + 1!.
		

Crossrefs

Programs

  • Maple
    Nf:= 15: # for terms <= (Nf) + 1!
    Facts:= [seq(i!, i=1..Nf)]:
    N:= Facts[-1]+1:
    R:= 'R':
    for i from 0 to isqrt(N) do
      for j from 1 to Nf do
        v:= Facts[j]+i^2;
        if v > N then break fi;
        if not assigned(R[v]) then R[v]:= [i,j]
        else R[v]:= R[v],[i,j]
        fi
    od od:
    J:= [indices(R)]:
    sort(map(op, select(t -> nops([R[op(t)]])>=2, J))); # Robert Israel, Aug 08 2025
  • Mathematica
    With[{f = Range[8]!}, c[n_] := Count[f, ?(IntegerQ @ Sqrt[n - #] &)]; Select[Range[f[[-1]]], c[#] > 1 &]] (* _Amiram Eldar, Oct 30 2022 *)