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
Iain Fox, Table of n, a(n) for n = 2..20000
Wikipedia, Balanced ternary
FORMULA
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.
KEYWORD
sign,base,easy
AUTHOR
Thomas König, Jan 13 2020
STATUS
approved