Nice Prime!
In a recent tweet, Cliff Pickover told the world that
727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727 is prime. That’s a nice looking prime and it took my laptop 1/100th of a second to confirm using Mathematica 8.
PrimeQ[727272727272727272727272727272727272727272727272727272727272727\ 272727272727272727272727272727272727] // AbsoluteTiming Out[1]= {0.0100000, True}
Can anyone else suggest some nice looking primes?
Unfortunately, Mathematica isn’t able to tell me what value of x for Prime[x] will yield that number. (And why aren’t Prime and PrimePi parallelizable, anyway??) It would be awesome if that value was also a neat looking prime.
Is 135791113151719212325272931333537394143454749515355575961636567697173757779818385878991939597 nice enough? The interesting thing is that four nontrivial prefixes of it are also primes. (I used isprime(parse(cat(“”, seq(1 .. 97, 2)))) to verify its primality in Maple by the way.)
Also, 1003005007009011013015017019021023025027029031033035037039041043045047049051053055057059061063065067069071073075077079081083085087089091093095097099101103105107109111113115117119121123125127129131133135137139141143145147149151153155157159161163165167169171, obtainable as parse(cat(seq(sprintf(“%03d”, i), i=1..171, 2))).
There appears to be a serious base 10 bias in this blog post and comments. Does it mean anything for a prime to be “nice looking” outside of a particular base?
Yep, they are definitely nice enough! pretty amazing that we can check primality of such large numbers so quickly.
Thanks!
@simon..it’s a good point, we are all being very baseist
Are these verifications absolute or probabilistic?
All Primes… :)
7
727
72727
727272727
72727272727272727
72727272727272727272727272727272727272727272727272727272727272727272727
727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727
727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727
1 and 7 are cool too.
1717171717171717171717171717171
1717171717171717171717171717171717171
Why not use only 1 and 7?
1717171717171717171717171717171
1717171717171717171717171717171717171
3 and 7;
373
373737373737373737373
373737373737373737373737373
373737373737373737373737373737373737373737373737373737373737373737373737373737373
…..
and with 1893 numbers
373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373
9 and 7
997
99797979797979797979797979797979797979797979797979797979797
997979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797
99797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797979797
I’m a math prime spammer? Sorry :( I’m ashamed…
This is even more improbable! 7 and 8! 4 times better than 7 and 2!
78787
787878787878787878787
787878787878787878787878787
78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787
@Thales I think we are going to have to come up with a compact notation. On my browser, these numbers scroll right outside the boundaries of the box
@Martin
According to http://reference.wolfram.com/mathematica/tutorial/SomeNotesOnInternalImplementation.html#6849
‘PrimeQ first tests for divisibility using small primes, then uses the Miller-Rabin strong pseudoprime test base 2 and base 3, and then uses a Lucas test.’
It’s a probabilistic procedure. More details at http://mathworld.wolfram.com/Rabin-MillerStrongPseudoprimeTest.html
Poor MATLAB, cannot handle such huge number :(… though I don’t understand why.
—–
Core i5, RAM 4GB, MATLAB R2012a 64bit
Hi Martin
If you are using plain MATLAB then it will be because MATLAB is using hardware-based double precision arithmetic and such a huge number cannot be exactly represented in it.
What you need to do is use the symbolic toolbox. Launch the mupad interface by typing
mupad
at the MATLAB prompt. Then, in the Mupad notebook, evaluate
isprime(N)
Replacing N with whatever huge integer you want to check. Mupad uses a very similar prime checking algorithm to Mathematica so the result is probabilistic (i.e., there is a chance it’s wrong!) as mentioned in a comment above.
Cheers,
Mike
@Mike Yeah… full notation is better since it gives the impression of “longness”. But anyway, a new notation.
Define a number in the form abbbb…bb where “a” and “b” are blocks of integers, and there are “n” blocks “b”‘s.
For a=7 and b=27, the numbers are prime for the following n’s:
n=1, 2, 4, 8, 35, 49, 121
For a=3 and b=73, the numbers are prime for the following n’s:
n=1, 10, 13, 40, 157, 424
For a=7 and b=87, the numbers are prime for the following n’s:
n=1, 2, 10, 13, 47
For a=1 and b=23456789, the numbers are prime for the following n’s:
n=59
For a=1 and b=87654321, the numbers are prime for the following n’s:
n=6, 49, 138
Yay! For more primes use the function:
RepeatedPrime[headN_, repeated_, n_Integer] := FromDigits@Flatten@{headN, ConstantArray[repeated, {n}]}
Hi Mike,
thanks for the suggestion, that “mupad” command is quite useful for me!
Martin
Here is a quick brute-force search of two digit repeaters…
RepeatingDigits[n_, c_] :=
ToExpression[
Apply[StringJoin, Table[ToString[n], {c}]]
StringTake[ToString[n], 1]]
Do[If[PrimeQ[#], Print[#]] &[RepeatingDigits[n, c]], {n, 10, 99}, {c,
20, 80}]
1212121212121212121212121212121212121212121
1212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121
151515151515151515151515151515151515151515151515151515151515151
15151515151515151515151515151515151515151515151515151515151515151515151515151515151515151
1616161616161616161616161616161616161616161616161616161
1616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161
1616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161
18181818181818181818181818181818181818181818181818181818181818181818181818181
1919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191
313131313131313131313131313131313131313131313131313
31313131313131313131313131313131313131313131313131313131313131313131313131313131313
373737373737373737373737373737373737373737373737373737373737373737373737373737373
383838383838383838383838383838383838383838383838383838383
72727272727272727272727272727272727272727272727272727272727272727272727
727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727
75757575757575757575757575757575757575757575757575757575757575757575757575757
75757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757
75757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757575757
78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787
94949494949494949494949494949494949494949494949494949494949494949
94949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949494949
979797979797979797979797979797979797979797979
98989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989898989
Oops. The blog comment system stripped out the StringJoin characters. Code again in different format…
RepeatingDigits[n_, c_] := ToExpression[ StringJoin[Apply[StringJoin , Table[ToString[n], {c}]], StringTake[ToString[n], 1]]];
Do[If[PrimeQ[#], Print[#]] & [RepeatingDigits[n, c]], {n, 10,
99}, {c, 20, 80}]
Another nice series are the “decimal repunit primes”, like 11, 1111111111111111111, and 11111111111111111111111. There are more: http://en.wikipedia.org/wiki/Repunit
727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727 is ‘nt prime
727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727 = 7*1153*1823071297393296313794645482344582929229459 *4942723325027431973353637942171511505058571593
PARI find it si not prime in 0ms and find the factorisation in 52 mn
Hi Paul
I copied your factorisation to Mathematica and got:
In[3]:= 7*1153*1823071297393296313794645482344582929229459*
4942723325027431973353637942171511505058571593
Out[3]= 72727272727272727272727272727272727272727272727272727272727272\
727272727272727272727272727277
The last digit is a 7 and not a 2