︠08642eb3-4f14-428e-9861-4a6e539f9838i︠ %md http://weijr-note.blogspot.com/2017/01/2017-is-not-just-another-prime-number.html ︡ad54b0e2-ffdb-4eae-818c-8a23b4fd1af9︡{"done":true,"md":"http://weijr-note.blogspot.com/2017/01/2017-is-not-just-another-prime-number.html"} ︠bf64676c-25d1-4381-80a0-918c8414b8a6s︠ is_prime(2017) ︡41d2bb21-9aaf-4984-835f-6571ed00362b︡{"stdout":"True\n"}︡{"done":true}︡ ︠3c9f2ef0-7c8b-41a5-8d35-be8ad07019f2s︠ # The sum of all odd primes up to 2017 is a prime number, i.e., # 3+5+7+11+...+2017 is a prime number. n = sum(primes(3,2018)); n is_prime(n) ︡b5fcdf62-00e1-40c0-8cd0-19dd8e9cc617︡{"stdout":"283079\n"}︡{"stdout":"True\n"}︡{"done":true}︡ ︠2e280c99-9216-4c1e-9f47-a3b9eeade652s︠ # 2017π (rounds to nearest integer) is a prime n = round(2017*pi); n is_prime(n) ︡e5e97e3f-95ca-41d5-b3fd-83a192a3d79e︡{"stdout":"6337\n"}︡{"stdout":"True\n"}︡{"done":true}︡ ︠2ee4b52f-27ec-4ff3-8003-40c452d11005s︠ # 2017e (rounds to nearest integer ) is a prime. n = round(2017*e); n is_prime(n) ︡3ee722a7-7569-4f8b-9b22-baed3faeab68︡{"stdout":"5483\n"}︡{"stdout":"True\n"}︡{"done":true}︡ ︠d4746de4-98cb-4206-b5e7-3326bbc56820s︠ # The sum of the cubes of gaps of primes up to 2017 is a prime number. v = prime_range(2018) n = sum([(v[i+1]-v[i])^3 for i in range(len(v)-1)]); n is_prime(n) ︡a0e25131-bf4b-4ad7-8311-3e659e860472︡{"stdout":"258569\n"}︡{"stdout":"True\n"}︡{"done":true}︡ ︠15b2aab6-f66f-4edc-a0c9-f5bf97b66b87s︠ # The prime number before 2017 is 2017+(2-0-1-7), which makes it a # sexy prime, and the prime after 2017 is 2017+(2+0+1+7). 2017 itself # is of course equal to 2017+(2*0*1*7) 2017+(2-0-1-7) == previous_prime(2017) 2017+(2+0+1+7) == next_prime(2017) ︡2575fdd9-fbe2-4124-a371-5894ee97b744︡{"stdout":"True\n"}︡{"stdout":"True\n"}︡{"done":true}︡ ︠378dc4d1-354b-4d8c-9eea-5fd2567e1b1as︠ # Insert 7 into any two digits of 2017, it is still a prime number, # i.e. 27017, 20717, 20177 are all primes. for n in [27017, 20717, 20177]: is_prime(n) ︡84a6c454-7fff-4e0d-a163-2aab761ef3cf︡{"stdout":"True\nTrue\nTrue\n"}︡{"done":true}︡ ︠11ab6eff-1545-4241-8f5e-62583576c2ebs︠ # Since all digits of 2017 is less than 8, it can be viewed as an octal. # 2017 is still a prime number as an octal. n = int('2017',8); n is_prime(n) ︡693ef303-05f0-4367-ae48-3046c94961c1︡{"stdout":"1039\n"}︡{"stdout":"True\n"}︡{"done":true}︡ ︠d7a9eea5-f011-49fc-975a-72297ed3e9ces︠ # 2017 can be written as a sum of three cubes of primes, i.e., # p^3 +q^3 +r^3 for some primes p, q, r k = int(2017^(1/3)) for p in [1..k]: for q in [1..k]: for r in [1..k]: if p^3 + q^3 + r^3 == 2017: print p, q, r 7^3 + 7^3 + 11^3 == 2017 ︡612e8e1f-4c64-46bb-90c8-e69cd114df93︡ ︠fa86a4df-e142-4f24-9e79-190a8915f4c7s︠ # can be written as a sum of cubes of five distinct integers. k = int(2017^(1/3)) n = 0 for p in [1..k]: for q in [1..k]: for r in [1..k]: for s in [1..k]: for t in [1..k]: if p^3 + q^3 + r^3 + s^3 + t^3 == 2017: n += 1 print "%s ways"%n ︡8ccd3491-79c8-450b-9e6b-f97d234d21b2︡{"stdout":"270 ways ︠69b22249-050d-4689-b526-68f540e3df79s︠ # 2017 can be written as # x^2+y^2, x^2+2y^2, x^2+3y^2, x^2+4y^2 x^2+6y^2, x^2+7y^2, x^2+8y^2, x^2+9y^2 # (for positive integers x, y) R. =ZZ[] B = int(sqrt(2017)) for f in [x^2+y^2, x^2+2*y^2, x^2+3*y^2, x^2+4*y^2, x^2+6*y^2, x^2+7*y^2, x^2+8*y^2, x^2+9*y^2]: done = False for a in [1..B]: for b in [1..B]: if f(a,b) == 2017: print str(f).replace('x', str(a)).replace('y', str(b)) + ' == 2017' done = True break if done: break ︡31616485-911d-48c2-842a-7df1038f37ec︡{"stdout":"9^2 + 44^2 == 2017\n37^2 + 2*18^2 == 2017"}︡{"stdout":"\n17^2 + 3*24^2 == 2017"}︡{"stdout":"\n9^2 + 4*22^2 == 2017\n29^2 + 6*14^2 == 2017"}︡{"stdout":"\n15^2 + 7*16^2 == 2017\n37^2 + 8*9^2 == 2017"}︡{"stdout":"\n44^2 + 9*3^2 == 2017"}︡{"stdout":"\n"}︡{"done":true}︡ ︠cd14159b-1d48-4751-b143-f81d74a02d1es︠ # 20170123456789 is also a prime is_prime(20170123456789) ︡49920f48-a14a-40f2-b2af-1fc0925e3006︡{"stdout":"True\n"}︡{"done":true}︡ ︠aed6d337-07c4-4393-a13f-4bf07d404482s︠ # the 2017th prime number is 17539 and 201717539 is also a prime. nth_prime(2017) is_prime(201717539) ︡ed5e19e3-586e-4cdb-aa25-636f5ee21164︡{"stdout":"17539\n"}︡{"stdout":"True\n"}︡{"done":true}︡ ︠aa40924c-8423-4694-8cb8-ea21192b6049s︠ # Let p=2017, then both (p+1)/2 and (p+2)/3 are prime numbers. p = 2017 is_prime((p+1)//2) is_prime((p+2)//3) ︡8cf368e6-3648-44b0-9f13-12460c4219f8︡{"stdout":"True\n"}︡{"stdout":"True\n"}︡{"done":true}︡ ︠9eb55564-070e-4405-a3e2-f3217aef01eds︠ # The first ten digits of the decimal expansion of the cubic root of # 2017 contains all different digits 0~9. N(2017^(1/3),digits=15) len(set(str(N(2017^(1/3),digits=15)).replace('.','')[:10])) # 2017 is the least integer that has this property. print "check who has this property" for n in [1..2017]: if len(set(str(N(n^(1/3),digits=15)).replace('.','')[:10])) == 10: print "n =", n, " has this property" ︡213983fe-d24a-4e9c-b1ee-e9c0714c72b8︡{"stdout":"12.6348075933001\n"}︡{"stdout":"10\n"}︡{"stdout":"check who has this property\n"}︡{"stdout":"n ="}︡{"stdout":" 2017 has this property\n"}︡{"done":true}︡ ︠6d4c5383-08f7-403d-9110-2564762d562ds︠ N(10^(1/3), digits=15) len(set(str(N(10^(1/3),digits=15)).replace('.','')[:10])) ︡c68a7dad-aed1-4329-8803-9486bfd1d85a︡{"stdout":"2.15443469003188\n"}︡{"stdout":"8\n"}︡{"done":true}︡ ︠f26e8350-2592-44f6-be42-88ea6dd6e92as︠ # 2017 = 2^11 - 11th prime 2017 == 2^11 - nth_prime(11) ︡75336bab-3d9f-42f0-acb7-110f8a203ab7︡{"stdout":"True\n"}︡{"done":true}︡ ︠8ec9a947-5838-4377-a457-a067f63668c9i︠ %md Plus stuff I care about... ︡29c5bb3d-0412-47a6-8378-7d0b73763c2d︡{"done":true,"md":"Plus stuff I care about..."} ︠6f9fd453-16b0-4b27-a691-3c4a84fe8c97s︠ sum_of_k_squares(2, 2017) ︡e26b1be3-40e6-4601-b3cf-680ac63c1086︡{"stdout":"(9, 44)\n"}︡{"done":true}︡ ︠a8482c49-f530-47c1-a8c7-4e051ecd7cccs︠ E = EllipticCurve('2017a'); show(E) ︡d7ff4edd-d63e-4f02-807d-296bc2a09c52︡{"html":"
$\\displaystyle y^2 + x y = x^{3} + x^{2} - 10 x + 9 $
"}︡{"done":true}︡ ︠0b2f5196-25aa-4711-ae5c-c555752bc5dcs︠ E.rank() ︡afcb711c-ea25-4ae8-b273-632838dbc697︡{"stdout":"1\n"}︡{"done":true}︡ ︠ad53f597-793c-4f58-8ef4-ba6cf0a84d03s︠ ModularSymbols(2017, 2,sign=1).decomposition() ︡410a0daf-bec7-4a35-ae57-7425f3718150︡{"stdout":"[\nModular Symbols subspace of dimension 1 of Modular Symbols space of dimension 168 for Gamma_0(2017) of weight 2 with sign 1 over Rational Field,\nModular Symbols subspace of dimension 1 of Modular Symbols space of dimension 168 for Gamma_0(2017) of weight 2 with sign 1 over Rational Field,\nModular Symbols subspace of dimension 80 of Modular Symbols space of dimension 168 for Gamma_0(2017) of weight 2 with sign 1 over Rational Field,\nModular Symbols subspace of dimension 86 of Modular Symbols space of dimension 168 for Gamma_0(2017) of weight 2 with sign 1 over Rational Field\n]"}︡{"stdout":"\n"}︡{"done":true}︡ ︠8e3e09fe-ce03-47da-a988-f5873dc313fd︠