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 A137305 #8 Jun 20 2016 10:16:26 %S A137305 0,2,1,2,8,5,1,7,4,2,20,11,8,26,17,5,23,14,1,19,10,7,25,16,4,22,13,2, %T A137305 56,29,20,74,47,11,65,38,8,62,35,26,80,53,17,71,44,5,59,32,23,77,50, %U A137305 14,68,41,1,55,28,19,73,46,10 %N A137305 Write n in base 3, change twos in ones and ones in twos, reverse. %C A137305 This is not to A036044 as A007089 is to A007088: despite similarity here the operation performed is not a base 3 complement. Fixed points begin: 5, 7, 11, 19, 29, 44, 50, 55. %H A137305 Alois P. Heinz, <a href="/A137305/b137305.txt">Table of n, a(n) for n = 0..6561</a> %F A137305 a(3^n) = 2. a(2*3^n) = 1. %e A137305 53 -> 1222 -> 2111 -> 1112 -> 41. %p A137305 a:= proc(n) local m, r; m, r:= n, 0; while m>0 %p A137305 do r:=r*3+[0, 2, 1][1+irem(m, 3, 'm')] od; r %p A137305 end: %p A137305 seq(a(n), n=0..100); # _Alois P. Heinz_, Jun 20 2016 %t A137305 a[n_] := FromDigits[ Reverse[ IntegerDigits[n, 3] /. {1 -> 2, 2 -> 1}], 3] (* _Giovanni Resta_, Jun 20 2016 *) %Y A137305 Cf. A007089, A036044. %K A137305 base,easy,nonn %O A137305 0,2 %A A137305 _Jonathan Vos Post_, Apr 20 2008 %E A137305 Edited and corrected by _Giovanni Resta_, Jun 20 2016