︠321cd228-37ba-4f0e-98bb-b8edd2b8bd89i︠ %md # An interesting prime number *especially for users of base-ten notation* I saw the following number, allegedly prime, in the [twitter stream of Cliff Pickover](https://twitter.com/pickover/status/456534816335216640): The number consists of 252 `9`'s, then a single digit `8`, then 253 `9`'s' This file is a Sage worksheet with a brief calculation to confirm the number's primality. \- Hal Snyder ︡5eafd530-5657-414e-9207-01a4c5bc6959︡{"done":true,"md":"\n# An interesting prime number\n\n*especially for users of base-ten notation*\n\nI saw the following number, allegedly prime, in the [twitter stream of Cliff Pickover](https://twitter.com/pickover/status/456534816335216640):\n\n\n\nThe number consists of 252 `9`'s, then a single digit `8`, then 253 `9`'s'\n\nThis file is a Sage worksheet with a brief calculation to confirm the number's primality.\n\n \\- Hal Snyder"} ︠aade49b2-3fee-4532-82da-888d35d3e6f1s︠ prefix_len = 3 * 74 + 30 suffix_len = 43 + 2 * 74 + 62 ︡bd0fa15a-a43c-475f-8c0e-2f51d050fa45︡{"done":true} ︠3a6ce6f2-9ba9-436f-9762-f3fe1c9ee788s︠ seg_len = [prefix_len, 1, suffix_len] seg_len sum(seg_len) ︡3ceb2f9f-7e20-4532-8571-9d337b86db7f︡{"stdout":"[252, 1, 253]\n"}︡{"stdout":"506\n"}︡{"done":true} ︠cd2101d9-f6f0-4ac8-91c6-091b9db44cb7s︠ digits = ['9', '8', '9'] xstrs = [seg_len[k]*digits[k] for k in range(len(digs))] xstr = ''.join(xstrs) ︡0e491742-45d0-4c4e-a6ea-ba06edc91fba︡{"done":true} ︠4459a7b1-4f54-491e-bce2-8b8464261a8d︠ xi = int(xstr) factor(xi) ︡81f99408-3708-48b3-b1c7-dea4fd26b32c︡{"stdout":"99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999989999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999"}︡{"stdout":"\n"}︡{"done":true} ︠6b0978dc-521f-435b-998b-784180058130s︠ # how long does it take Sage to check that the number is prime? %time is_prime(xi) ︡a6957fc3-053f-4af2-bd1f-c32f9584097a︡{"stdout":"True"}︡{"stdout":"\n"}︡{"stdout":"\nCPU time: 18.91 s, Wall time: 20.28 s\n"}︡{"done":true} ︠030ceaa8-bb94-43be-b9e7-2db76b19640e︠