View Single Post
Old 2017-04-17, 12:02   #4
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

8,369 Posts
Default

Quote:
Originally Posted by WhoCares View Post
Hey there. I will ask my question directly.
n= some 1523 digits number. I want to check 10^n+7 is prime or not. I have used BigInteger class of c#, and I found that one factor of n is 11, that remains a 1522 digits number. However it seems it will be very long like a lifetime with a standard isPrime() function. Is there any way to do that quickly? (I am open to rent a super computer or something like that)

Code:
n= 39639600000000033079722130334105193516374462454515382070790605358914985114125041349652662917631491895468078068144227588488256698643731392656301687065828647039364869335097585180284485610320873304664240820377108832285808799206086668871981475355607012901091630830301025471386040357260999007608336089976844194508766126364538537876281839232550446576248759510420112471055243135957657955673172345352299040688058220310949388025140588819053919947072444591465431690373800860072775388686735031425736023817399933840555739331789612967251075090969235858418789282170029771749917300694674164737016209063843863711544823023486602712537214687396625868342705921270261329804829639431028779358253390671518359245782335428382401587826662256037049288785974197816738339397949057227919285478001984783327820046311610982467747270922924247436321534899106847502480979159775057889513728084684088653655309295401918623883559378101223949718822361892160105855110817069136619252398279854449222626529937148527952365200132318888521336420774065497849818061528283162421435659940456500165398610651670525967581872312272576910353953026794574925570625206748263314588157459477340390340721137942441283493218656963281508435329143235196824346675487925901422428051604366523321204101885544161429043996030433344359907376778035064505458154151505127356930201786304995038041680449884220972543830631822692689381409196162752232881243797552100562355276215679788289778365861726761495203440291101554746940125702944095269599735362222957327158451869004300363876943433675157128680119087
modular exponentiation may help. Keeping in mind, you can mod the exponent by euler's totient function for the modulus. in you example 10^n+7 for mod 11 we get (-1)^n+7 as (-1)^n is either 1 or -1 we get a remainder of 6 or 8 and never 0.
science_man_88 is offline   Reply With Quote