%I M2251 #57 Aug 04 2023 01:40:54
%S 0,1,3,2,6,7,5,4,13,12,14,15,11,10,8,9,24,25,27,26,30,31,29,28,21,20,
%T 22,23,19,18,16,17,52,53,55,54,50,51,49,48,57,56,58,59,63,62,60,61,44,
%U 45,47,46,42,43,41,40,33,32,34,35,39,38,36,37,103,102,100,101,97,96,98,99
%N The nim-square of n.
%C This is a permutation of the natural numbers; A160679 is the inverse permutation. - _Jianing Song_, Aug 10 2022
%D J. H. Conway, On Numbers and Games. Academic Press, NY, 1976, pp. 51-53.
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H R. J. Mathar, <a href="/A006042/b006042.txt">Table of n, a(n) for n = 0..1000</a>
%H G. P. Michon, <a href="http://www.numericana.com/answer/fields.htm#on2">Discussion of Conway's On2</a> [From _John W. Layman_, Nov 05 2010]
%H <a href="/index/Ni#Nimmult">Index entries for sequences related to Nim-multiplication</a>
%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F a(n) = A051775(n,n).
%F From _Jianing Song_, Aug 10 2022: (Start)
%F If n = Sum_j 2^e(j), then a(n) is the XOR of A006017(e(j))'s. Proof: let N+ = XOR and N* denote the nim addition and the nim multiplication, then n N* n = (Sum_j 2^e(j)) N* (Sum_j 2^e(j)) = (Nim-sum_j 2^e(j)) N* (Nim-sum_j 2^e(j)) = (Nim-sum_j (2^e(j) N* 2^e(j))) N+ (Nim-sum_{i<j} ((2^e(i) N* 2^e(j)) N+ (2^e(j) N* 2^e(i)))) = (Nim-sum_j (2^e(j) N* 2^e(j))) N+ (Nim-sum_{i<j} 0) = Nim-sum_j (2^e(j) N* 2^e(j)).
%F For example, for n = 11 = 2^0 + 2^1 + 2^3, a(11) = A006017(0) XOR A006017(1) XOR A006017(3) = 1 XOR 3 XOR 13 = 15.
%F More generally, if n = Sum_j 2^e(j), k is a power of 2, then the nim k-th power of n is the XOR of (nim k-th power of 2^e(j))'s. (End)
%p read("transforms") ;
%p # insert source of nimprodP2() and A051775() from the b-file at A051776 here...
%p A006042 := proc(n)
%p A051775(n,n) ;
%p end proc:
%p L := [seq( A006042(n),n=1..1000) ]; # _R. J. Mathar_, May 28 2011
%Y Diagonal of A051775. Without 0, diagonal of A051776.
%Y Column 2 of array in A335162.
%Y Other nim k-th powers: A051917 (k=-1), A160679 (k=1/2), A335170 (k=3), A335535 (k=4), A335171 (k=5), A335172 (k=6), A335173 (k=7), A335536 (k=8).
%Y Cf. A212200, A006017.
%K nonn,nice,easy,look
%O 0,3
%A _N. J. A. Sloane_
%E a(1)-a(49) confirmed, a(50)-a(71) added by _John W. Layman_, Nov 05 2010
%E a(0) prepended by _Jianing Song_, Aug 10 2022