login
Distinct nonnegative values of A393422, in order of appearance and with offset 0.
3

%I #12 Feb 16 2026 16:19:39

%S 0,1,5,3,14,12,6,4,30,28,22,20,10,2,55,53,47,45,37,35,29,27,23,21,15,

%T 13,91,89,83,81,73,71,65,63,59,57,51,49,41,39,33,31,9,7,19,17,11,140,

%U 138,132,130,122,120,114,112,108,106,100,98,90,88,82,80,72,70

%N Distinct nonnegative values of A393422, in order of appearance and with offset 0.

%C A permutation of the nonnegative integers.

%H Rémy Sigrist, <a href="/A393423/b393423.txt">Table of n, a(n) for n = 0..9874</a>

%H Michael De Vlieger, <a href="/A393423/a393423.png">Log log scatterplot of a(n)</a>, 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.

%H Rémy Sigrist, <a href="/A393423/a393423.txt">C++ program</a>.

%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>

%e Sequence A393422 begins: 0, 1, -1, 5, 3, -3, -5, 14, 12, 6, 4, -4, -6, -12, -14, 30.

%e Present sequence begins: 0, 1, 5, 3, 14, 12, 6, 4, 30.

%t 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 *)

%o (C++) // See Links section.

%Y Cf. A393422.

%K nonn

%O 0,3

%A _Rémy Sigrist_, Feb 14 2026