OFFSET
0,3
COMMENTS
A permutation of the nonnegative integers.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..9874
Michael De Vlieger, Log log scatterplot of a(n), n = 0..4286, with a color function showing primes in red, proper prime powers in gold, squarefree composites in green, powerful numbers that are not prime powers in purple, and numbers that are neither squarefree nor powerful in blue.
Rémy Sigrist, C++ program.
EXAMPLE
Sequence A393422 begins: 0, 1, -1, 5, 3, -3, -5, 14, 12, 6, 4, -4, -6, -12, -14, 30.
Present sequence begins: 0, 1, 5, 3, 14, 12, 6, 4, 30.
MATHEMATICA
Block[{w, c}, c[_] := True; w = {0}; c[0] = False; w~Join~Flatten@ Reap[Do[w = Join[w + n^2, w - n^2]; Map[If[And[# >= 0, c[#]], Sow[#]; c[#] = False] &, w], {n, 7}] ][[-1, 1]] ] (* Michael De Vlieger, Feb 16 2026 *)
PROG
(C++) // See Links section.
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Feb 14 2026
STATUS
approved
