The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 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 Iain Fox, Table of n, a(n) for n = 2..20000 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 Adjacent sequences:  A331987 A331988 A331989 * A331991 A331992 A331993 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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified September 21 15:50 EDT 2020. Contains 337272 sequences. (Running on oeis4.)