3 ms·
Normal people don't have the tools to check the math on a formula that involves 500-digit numbers. Sure we do, for flexible values of "normal": from decimal
by orangecat 16y ago
Normal people don't have the tools to check the math on a formula that involves 500-digit numbers.
Sure we do, for flexible values of "normal":
from decimal import getcontext, Decimal
getcontext().prec = 600
n = Decimal(960939379918958884971672962127852754715004339660129306651505519271702802395266424689642842174350718121267153782770623355993237280874144307891325963941337723487857735749823926629715517173716995165232890538221612403238855866184013235585136048828693337902491454229288667081096184496091705183454067827731551705405381627380967602565625016981482083418783163849115590225610003652351370343874461848378737238198224849863465033159410054974700593138339226497249461751545728366702369745461014655997933798537483143786841806593422227898388722980000748404719)
# ignore floors, just using integer arguments
f = lambda x,y: (y/17 * Decimal(2)**(-17*x - (y%17))) % 2
results = {}
dhalf = Decimal('0.5')
for x in xrange(106):
for y in xrange(17):
# this takes a while
results[x,y] = '*' if f(Decimal(x), Decimal(y+n))>dhalf else ' '
# this prints reversed for some reason unless we reverse the x iteration
for y in xrange(17):
print(''.join(results[x,y]+' ' for x in xrange(105,-1,-1)))
- eru 16y agoIndeed. And lots of computers come with Python or something equally capable of arithmetic installed nowadays. (And if you don't have the means to check it, it's probably better to remain agnostic, instead of starting to believe random things.)