This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A006042 M2251 #62 Aug 20 2025 11:13:20 %S A006042 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 A006042 22,23,19,18,16,17,52,53,55,54,50,51,49,48,57,56,58,59,63,62,60,61,44, %U A006042 45,47,46,42,43,41,40,33,32,34,35,39,38,36,37,103,102,100,101,97,96,98,99 %N A006042 The nim-square of n. %C A006042 This is a permutation of the natural numbers; A160679 is the inverse permutation. - _Jianing Song_, Aug 10 2022 %D A006042 J. H. Conway, On Numbers and Games. Academic Press, NY, 1976, pp. 51-53. %D A006042 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). %H A006042 R. J. Mathar, <a href="/A006042/b006042.txt">Table of n, a(n) for n = 0..1000</a> %H A006042 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 A006042 <a href="/index/Ni#Nimmult">Index entries for sequences related to Nim-multiplication</a> %H A006042 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A006042 a(n) = A051775(n,n). %F A006042 From _Jianing Song_, Aug 10 2022: (Start) %F A006042 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 A006042 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 A006042 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 A006042 read("transforms") ; %p A006042 # insert source of nimprodP2() and A051775() from the b-file at A051776 here... %p A006042 A006042 := proc(n) %p A006042 A051775(n,n) ; %p A006042 end proc: %p A006042 L := [seq( A006042(n),n=1..1000) ]; # _R. J. Mathar_, May 28 2011 %Y A006042 Diagonal of A051775. Without 0, diagonal of A051776. %Y A006042 Column 2 of array in A335162. %Y A006042 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 A006042 Cf. A212200, A006017. %K A006042 nonn,nice,easy,look %O A006042 0,3 %A A006042 _N. J. A. Sloane_ %E A006042 a(1)-a(49) confirmed, a(50)-a(71) added by _John W. Layman_, Nov 05 2010 %E A006042 a(0) prepended by _Jianing Song_, Aug 10 2022