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 A323909 #6 Feb 10 2019 23:07:24 %S A323909 0,1,2,5,1,0,7,3,2,5,0,1,5,2,6,4,1,0,7,3,0,1,2,5,7,3,1,0,3,7,8,17,2,5, %T A323909 0,1,5,2,6,4,0,1,2,5,1,0,7,3,5,2,6,4,2,5,0,1,6,4,5,2,4,6,22,15,1,0,7, %U A323909 3,0,1,2,5,7,3,1,0,3,7,8,17,0,1,2,5,1,0,7,3,2,5,0,1,5,2,6,4,7,3,1,0,3,7,8,17,1,0 %N A323909 Balanced ternary representation of A004718, Per Nørgård's "infinity sequence". %C A323909 The composer Per Nørgård's name is also written in the OEIS as Per Noergaard. %H A323909 Antti Karttunen, <a href="/A323909/b323909.txt">Table of n, a(n) for n = 0..65536</a> %F A323909 If A004718(n) >= 0, then a(n) = A117967(A004718(n)), otherwise a(n) = A117968(-A004718(n)). %F A323909 For all n >= 1, A117966(a(n)) = A004718(n). %o A323909 (PARI) %o A323909 up_to = 65536; %o A323909 A004718list(up_to) = { my(v=vector(up_to)); v[1]=1; v[2]=-1; for(n=3, up_to, v[n] = if(n%2, 1+v[n>>1], -v[n/2])); (v); }; \\ After code in A004718. %o A323909 v004718 = A004718list(up_to); %o A323909 A004718(n) = if(!n,n,v004718[n]); %o A323909 A117967(n) = if(n<=1,n,if(!(n%3),3*A117967(n/3),if(1==(n%3),1+3*A117967((n-1)/3),2+3*A117967((n+1)/3)))); %o A323909 A117968(n) = if(1==n,2,if(!(n%3),3*A117968(n/3),if(1==(n%3),2+3*A117968((n-1)/3),1+3*A117968((n+1)/3)))); %o A323909 A323909(n) = { my(x = A004718(n)); if(x >= 0,A117967(x),A117968(-x)); }; %Y A323909 Cf. A004718, A083866 (positions of zeros), A117966, A117967, A117968, A323907 (rgs-transform), A323908. %K A323909 nonn %O A323909 0,3 %A A323909 _Antti Karttunen_, Feb 10 2019