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!)
A331990 Balanced ternary expansion of e. 2
1, 0, -1, 0, 1, 1, 1, -1, -1, 0, -1, 0, -1, 1, 1, 1, -1, 0, 1, 1, 1, -1, 0, 0, 0, -1, 1, 1, -1, 0, 1, 1, 1, 0, -1, 0, 0, 0, -1, 1, -1, -1, 1, 0, 0, 0, 0, -1, 1, 1, 0, -1, 0, 0, -1, -1, 1, -1, 1, -1, -1, 0, -1, -1, 0, 0, -1, 1, 1, 1, 0, 0, 1, -1, -1, 1, 0, 0, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
2
COMMENTS
For the first n digits of the sequence, take the smallest substring with n or more digits of the standard ternary expansion of e (A004594) such that it does not end with 1 and prepend a 0. For n = 15, this would be:
0, 2, 2, 0, 1, 1, 0, 1, 1, 2, 1, 2, 2, 1, 1, 0.
Wherever there is a 2, change it to -1 and add 1 to the previous term:
1, 0, -1, 0, 1, 1, 0, 1, 2, -1, 2, 0, -1, 1, 1, 0.
Repeat until no 2's remain:
1, 0, -1, 0, 1, 1, 0, 2, -1, 0, -1, 0, -1, 1, 1, 0.
1, 0, -1, 0, 1, 1, 1, -1, -1, 0, -1, 0, -1, 1, 1, 0.
Remove all but the first n digits:
1, 0, -1, 0, 1, 1, 1, -1, -1, 0, -1, 0, -1, 1, 1.
LINKS
Wikipedia, Balanced ternary
EXAMPLE
e = 2.7182818284... = 1 * 3^1 + 0 * 3^0 - 1 * 3^(-1) + 0 * 3^(-2) + 1 * 3^(-3) + ... = 10.T0111TT0T0..._bal3
PROG
(PARI) first(n) = {default(realprecision, 10000); for(x=-1, +oo, v=concat([0], digits(floor(exp(1)*3^(n+x)), 3)); if(v[#v]!=1, break())); while(vecmax(v)==2, for(x=1, #v, if(v[x]==2, v[x]=-1; v[x-1]++))); vecextract(v, 2^n-1)} \\ (adjust realprecision as needed)
CROSSREFS
Pi in balanced ternary: A331313.
Expansion of e in base b: A004593 (b = 2), A004594 (b = 3), A004595 (b = 4), A004596 (b = 5), A004597 (b = 6), A004598 (b = 7), A004599 (b = 8), A004600 (b = 9), A001113 (b = 10), A170873 (b = 16).
Sequence in context: A244527 A243566 A266112 * A301849 A074332 A152065
KEYWORD
base,easy,sign
AUTHOR
Iain Fox, Feb 03 2020
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 June 22 21:17 EDT 2024. Contains 373609 sequences. (Running on oeis4.)