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!)
A331313 Expansion of Pi in balanced ternary. 4
1, 0, 0, 1, 1, -1, 1, 1, 1, -1, 0, 0, 0, -1, 0, 1, 1, -1, 1, 1, 0, 1, -1, 1, 1, 1, 1, 1, 1, 0, 0, -1, 0, 0, 0, 0, -1, 1, -1, -1, -1, -1, 1, -1, 0, -1, 0, -1, 0, -1, -1, 0, 1, -1, -1, 1, 1, 0, 0, 1, 0, 0, 1, 1, -1, 0, 0, -1, 1, 0, 0, 0, -1, -1, 1, -1, -1, 1, -1 (list; graph; refs; listen; history; text; internal format)
OFFSET
2
COMMENTS
The correspondence to A004602 (see Formula section) can be seen by comparing the leading terms of each sequence from right to left and adding a carry when A004602 is 2:
A004602: 1, 0, 0, 1, 0, 2, 1, 1, 0, 1, 2, 2, 2, 2, 0, 1, 0, 2, 1, 1, 0, 0, 2, 1
a(n) : 1, 0, 0, 1, 1,-1, 1, 1, 1,-1, 0, 0, 0,-1, 0, 1, 1,-1, 1, 1, 0, 1,-1, 1
LINKS
Wikipedia, Balanced ternary
FORMULA
Calculation can be done from A004602:
Choose n so that A004602(n) does not equal 2
Initialize {f(n)} from A004602 up to index n
Let i loop from n down to 2
while f(i) is larger than 1
set f(i) to f(i) - 3
set f(i - 1) to f(i - 1) + 1
Set {a(n)} to {f(n)}
EXAMPLE
10.011T111T000T011T1101T11111100T0000T...
PROG
(C) See link by Thomas König
(PARI) \\ (adjust realprecision as needed)
first(n) = {default(realprecision, 10000); for(x=-1, +oo, v=digits(floor(Pi*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)} \\ Iain Fox, Feb 03 2020
CROSSREFS
Pi in base b: A004601 (b=2), A004602 (b=3), A004603 (b=4), A004604 (b=5), A004605 (b=6), A004606 (b=7), A006941 (b=8), A004608 (b=9), A000796 (b=10), A068436 (b=11), A068437 (b=12), A068438 (b=13), A068439 (b=14), A068440 (b=15), A062964 (b=16), A060707 (b=60).
Expansion of e in balanced ternary: A331990.
Sequence in context: A285427 A285621 A204435 * A267155 A204445 A179184
KEYWORD
sign,base,easy
AUTHOR
Thomas König, Jan 13 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 April 24 22:17 EDT 2024. Contains 371964 sequences. (Running on oeis4.)