login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A366794 Binary encoding of the twos (-1's) in the balanced ternary representation of Per Nørgård's "infinity sequence". 2
0, 0, 1, 1, 0, 0, 2, 0, 1, 1, 0, 0, 1, 1, 2, 0, 0, 0, 2, 0, 0, 0, 1, 1, 2, 0, 0, 0, 0, 2, 3, 3, 1, 1, 0, 0, 1, 1, 2, 0, 0, 0, 1, 1, 0, 0, 2, 0, 1, 1, 2, 0, 1, 1, 0, 0, 2, 0, 1, 1, 0, 2, 4, 2, 0, 0, 2, 0, 0, 0, 1, 1, 2, 0, 0, 0, 0, 2, 3, 3, 0, 0, 1, 1, 0, 0, 2, 0, 1, 1, 0, 0, 1, 1, 2, 0, 2, 0, 0, 0, 0, 2, 3, 3, 0, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,7
COMMENTS
The composer Per Nørgård's name is also written in the OEIS as Per Noergaard.
LINKS
FORMULA
a(n) = A289814(A323909(n)).
EXAMPLE
A004718(254) = -7. In balanced ternary representation (see A117966) this is represented as -1*9 + 1*3 + -1*1. Taking the negative coefficients, and converting them to a binary string gives "101", which in base-2 (A007088) is equal to 5, therefore a(254) = 5.
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); }; \\ From the 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)); };
A289814(n) = { my (d=digits(n, 3)); fromdigits(vector(#d, i, if (d[i]==2, 1, 0)), 2); };
CROSSREFS
Sequence in context: A325226 A261812 A077266 * A214302 A129561 A259895
KEYWORD
nonn
AUTHOR
Antti Karttunen, Oct 24 2023
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 8 17:17 EDT 2024. Contains 375023 sequences. (Running on oeis4.)