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 A004468 #40 Mar 07 2023 16:22:28 %S A004468 0,3,1,2,12,15,13,14,4,7,5,6,8,11,9,10,48,51,49,50,60,63,61,62,52,55, %T A004468 53,54,56,59,57,58,16,19,17,18,28,31,29,30,20,23,21,22,24,27,25,26,32, %U A004468 35,33,34,44,47,45,46,36,39,37,38,40,43,41,42,192,195,193,194,204,207,205 %N A004468 a(n) = Nim product 3 * n. %C A004468 From _Jianing Song_, Aug 10 2022: (Start) %C A004468 Write n in quaternary (base 4), then replace each 1,2,3 by 3,1,2. %C A004468 This is a permutation of the natural numbers; A006015 is the inverse permutation (since the nim product of 2 and 3 is 1). (End) %D A004468 J. H. Conway, On Numbers and Games. Academic Press, NY, 1976, pp. 51-53. %H A004468 Alois P. Heinz, <a href="/A004468/b004468.txt">Table of n, a(n) for n = 0..16383</a> (first 1001 terms from R. J. Mathar) %H A004468 <a href="/index/Ni#Nimmult">Index entries for sequences related to Nim-multiplication</a> %H A004468 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A004468 a(n) = A051775(3,n). %F A004468 From _Jianing Song_, Aug 10 2022: (Start) %F A004468 a(n) = 3*n if n has only digits 0 or 1 in quaternary (n is in A000695). Otherwise, a(n) < 3*n. %F A004468 a(n) = n/2 if n has only digits 0 or 2 in quaternary (n is in A062880). Otherwise, a(n) > n/2. %F A004468 a(n) = 2*n/3 if and only if n has only digits 0 or 3 in quaternary (n is in A001196). Proof: let n = Sum_i d_i*4^i, d(i) = 0,1,2,3. Write A = Sum_{d_i=1} 4^i, B = Sum_{d_i=2} 4^i, then a(n) = 2*n/3 if and only if 3*A + B = 2/3*(A + 2*B), or B = 7*A. If A != 0, then A is of the form (4*s+1)*4^t, but 7*A is not of this form. So the only possible case is A = B = 0, namely n has only digits 0 or 3. (End) %p A004468 read("transforms") ; %p A004468 # insert Maple procedures nimprodP2() and A051775() of the b-file in A051775 here. %p A004468 A004468 := proc(n) %p A004468 A051775(3,n) ; %p A004468 end proc: %p A004468 L := [seq(A004468(n),n=0..1000)] ; # _R. J. Mathar_, May 28 2011 %p A004468 # second Maple program: %p A004468 a:= proc(n) option remember; `if`(n=0, 0, %p A004468 a(iquo(n, 4, 'r'))*4+[0, 3, 1, 2][r+1]) %p A004468 end: %p A004468 seq(a(n), n=0..70); # _Alois P. Heinz_, Jan 25 2022 %t A004468 a[n_] := a[n] = If[n == 0, 0, {q, r} = QuotientRemainder[n, 4]; a[q]*4 + {0, 3, 1, 2}[[r + 1]]]; %t A004468 Table[a[n], {n, 0, 70}] (* _Jean-François Alcover_, May 20 2022, after _Alois P. Heinz_ *) %o A004468 (PARI) a(n) = my(v=digits(n, 4), w=[0,3,1,2]); for(i=1, #v, v[i] = w[v[i]+1]); fromdigits(v, 4) \\ _Jianing Song_, Aug 10 2022 %o A004468 (Python) %o A004468 def a(n, D=[0, 3, 1, 2]): %o A004468 r, k = 0, 0 %o A004468 while n>0: r+=D[n%4]*4**k; n//=4; k+=1 %o A004468 return r %o A004468 # _Onur Ozkan_, Mar 07 2023 %Y A004468 Row 3 of array in A051775. %Y A004468 Cf. A006015, A004469-A004480, A000695, A062880, A001196. %K A004468 nonn,easy,look %O A004468 0,2 %A A004468 _N. J. A. Sloane_ %E A004468 More terms from _Erich Friedman_