Hi:
My math dept had a math open house (to try to attract new
undergrad math majors), with a poster including a photo of a
google hiring billboard It read
"{first 10-digit prime found in consecutive digits of e}.com".
In case anyone is interested, here is the Sage code.
sage: RR2000 = RealField(prec=2000)
sage: a = RR2000(exp(1))
sage: [[is_prime(ZZ(s[2+i:12+i])),i] for i in range(100) if
s[2+i]<>"0" if is_prime(ZZ(s[2+i:12+i]))]
[[True, 98]]
sage: ZZ(s[100:110])
7427466391
sage: is_prime(ZZ(s[100:110]))
True
(BTW, 7427466391.com is now dead.)
Does anyone know of a faster way to do this?
- David
--
You received this message because you are subscribed to the Google Groups
"sage-edu" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-edu?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.