login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A323909
Balanced ternary representation of A004718, Per Nørgård's "infinity sequence".
6
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, 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, 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
OFFSET
0,3
COMMENTS
The composer Per Nørgård's name is also written in the OEIS as Per Noergaard.
LINKS
FORMULA
If A004718(n) >= 0, then a(n) = A117967(A004718(n)), otherwise a(n) = A117968(-A004718(n)).
For all n >= 1, A117966(a(n)) = A004718(n).
PROG
(PARI)
up_to = 65536;
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.
v004718 = A004718list(up_to);
A004718(n) = if(!n, n, v004718[n]);
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))));
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))));
A323909(n) = { my(x = A004718(n)); if(x >= 0, A117967(x), A117968(-x)); };
CROSSREFS
Cf. A004718, A083866 (positions of zeros), A117966, A117967, A117968, A323907 (rgs-transform), A323908.
Sequence in context: A062627 A011217 A078506 * A124779 A284750 A092134
KEYWORD
nonn
AUTHOR
Antti Karttunen, Feb 10 2019
STATUS
approved