%I #12 Oct 18 2020 22:33:03
%S 0,1,3,2,4,9,8,10,6,5,7,12,11,13,27,26,28,24,23,25,30,29,31,18,17,19,
%T 15,14,16,21,20,22,36,35,37,33,32,34,39,38,40,81,80,82,78,77,79,84,83,
%U 85,72,71,73,69,68,70,75,74,76,90,89,91,87,86,88,93,92,94
%N Nonpositive values in A117966, in order of appearance and negated.
%C This sequence is a self-inverse permutation of the nonnegative integers (the offset has been set to 0 so as to get a permutation).
%H Rémy Sigrist, <a href="/A338246/b338246.txt">Table of n, a(n) for n = 0..9841</a>
%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F a(0) = 0.
%F a(n) = -A117966(A157671(n)) for any n > 0.
%F a(n) = n iff n belongs to A003462.
%e A117966 = 0, 1, -1, 3, 4, 2, -3, -2, -4, 9, 10, 8, 12, 13, 11, 6, 7, 5, -9, ...
%e We keep: 0, 1, 3, 2, 4, 9, ...
%o (PARI) A117966(n) = subst(Pol(apply(x->if(x == 2, -1, x), digits(n, 3)), 'x), 'x, 3)
%o print (-select(v -> v<=0, apply(A117966, [0..188])))
%Y Cf. A003462 (fixed points), A117966, A157671, A338245.
%K nonn,base
%O 0,3
%A _Rémy Sigrist_, Oct 18 2020
|