OFFSET
0,4
COMMENTS
This sequence could be called the Heraclitus transform of the factorials. For other examples of Heraclitus transforms, see A377090, A377091, A377092, A379719.
It is conjectured that every integer appears in this sequence. (It appears that the proof in A379719 can be modified to apply here. The start is somewhat irregular, but beginning at n = 25, the positive terms appear in blocks of consecutive numbers, where block B(k), k >= 4, has length k*k!/2, starts at n = k!/2 + 1 and ends at n = (k+1)!/2. The structure of the negative blocks is less clear.)
LINKS
Paolo Xausa, Table of n, a(n) for n = 0..9000 (terms 0..4000 from N. J. A. Sloane).
MATHEMATICA
A393434list[nmax_] := Module[{s, a, u = 1, factQ},
factQ[n_] := factQ[n] = Module[{d = 2, x = n}, While[Divisible[x, d], x /= d++]; x == 1];
s[_] := False; s[0] = True;
NestList[(While[s[u] && s[-u], u++]; a = u; While[s[a] || !factQ[Abs[# - a]], a = Boole[a < 0] - a]; s[a] = True; a) &, 0, nmax]];
A393434list[100] (* Paolo Xausa, Feb 17 2026 *)
Module[{F=Table[k!, {k, 1, 10}]}, FoldList[Function[a, Append[a, First@SortBy[Select[Flatten[{Last[a]+F, Last[a]-F}], FreeQ[a, #]&], {Abs[#]&, -#&}]]], {0}, Range[200]][[-1]]] (* Vincenzo Librandi, Feb 18 2026 *)
PROG
(Magma) Nmax := 200; a := [ Integers() | 0 ]; used := { 0 }; F := [ Factorial(n) : n in [1..10] ]; for n in [1..Nmax] do S := { a[#a] + f : f in F } join { a[#a] - f : f in F }; S := { x : x in S | not x in used }; t := Minimum({ <Abs(x), -x, x> : x in S }); m := t[3]; Append(~a, m); Include(~used, m); end for; a; // Vincenzo Librandi, Feb 18 2026
CROSSREFS
KEYWORD
sign
AUTHOR
N. J. A. Sloane, Feb 17 2026
STATUS
approved
