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 A030102 #46 Aug 06 2024 09:56:00 %S A030102 0,1,2,1,4,7,2,5,8,1,10,19,4,13,22,7,16,25,2,11,20,5,14,23,8,17,26,1, %T A030102 28,55,10,37,64,19,46,73,4,31,58,13,40,67,22,49,76,7,34,61,16,43,70, %U A030102 25,52,79,2,29,56,11,38,65,20,47,74,5,32,59,14,41,68,23,50,77,8,35,62,17,44,71 %N A030102 Base-3 reversal of n (written in base 10). %H A030102 Reinhard Zumkeller, <a href="/A030102/b030102.txt">Table of n, a(n) for n = 0..10000</a> %H A030102 Michael Gilleland, <a href="/selfsimilar.html">Some Self-Similar Integer Sequences</a> %H A030102 Lukas Spiegelhofer, <a href="https://arxiv.org/abs/1709.05651">A digit reversal property for an analogue of Stern's sequence</a>, arXiv:1709.05651 [math.NT], 2017. See Theorem 1.1. %F A030102 a(n) = t(n,0) with t(n,r) = if n=0 then r else t(floor(n/3),r*3+(n mod 3)). - _Reinhard Zumkeller_, Mar 04 2010 %F A030102 G.f. G(x) satisfies: G(x) = (1+x+x^2)*G(x^3) - (1+2*x)*(x + 2*Sum_{m>=0} 3^m*x^(3^(m+1)+1)/(x^3-1). - _Robert Israel_, Dec 24 2015 %e A030102 a(17) = 25 because 17 in base 3 is 122, and backwards that is 221, which is 25 in base 10. %e A030102 a(18) = 2 because 18 in base 3 is 200, and backwards that is 2. %p A030102 a030102:= proc(n) option remember; %p A030102 local y; %p A030102 y:= n mod 3; %p A030102 3^ilog[3](n)*y + procname((n-y)/3) %p A030102 end proc: %p A030102 for i from 0 to 2 do a030102(i):= i od: %p A030102 seq(a030102(i),i=0..100); # _Robert Israel_, Dec 24 2015 %p A030102 # alternative %p A030102 A030102 := proc(n) %p A030102 local r ; %p A030102 r := ListTools[Reverse](convert(n,base,3)) ; %p A030102 add(op(i,r)*3^(i-1),i=1..nops(r)) ; %p A030102 end proc: # _R. J. Mathar_, May 28 2016 %t A030102 A030102[n_] := FromDigits[Reverse@IntegerDigits[n, 3], 3] (* _JungHwan Min_, Dec 23 2015 *) %t A030102 FromDigits[#,3]&/@(Reverse/@IntegerDigits[Range[0,80],3]) (* _Harvey P. Dale_, Feb 05 2020 *) %o A030102 (PARI) a(n,b=3)=subst(Polrev(base(n,b)),x,b) /* where */ %o A030102 base(n,b)={my(a=[n%b]);while(0<n\=b,a=concat(n%b,a));a} \\ _M. F. Hasler_, Nov 04 2011 %o A030102 (PARI) a(n) = fromdigits(Vecrev(digits(n, 3)), 3); \\ _Michel Marcus_, Oct 10 2017 %o A030102 (Haskell) %o A030102 a030102 = foldl (\v d -> 3 * v + d) 0 . a030341_row %o A030102 -- _Reinhard Zumkeller_, Dec 16 2013 %Y A030102 Cf. A134028, A030101 - A030108, A004086, A134028. %Y A030102 Cf. A030341. %Y A030102 Cf. A263273 for a bijective variant. %K A030102 nonn,base,look,easy %O A030102 0,3 %A A030102 _David W. Wilson_