Group Abstract Group Abstract

Message Boards Message Boards

8
|
10.1K Views
|
4 Replies
|
13 Total Likes
View groups...
Share
Share this post:

New Prime Oddity

Posted 10 years ago

Mathematicians Discover Prime Conspiracy mentions that primes with the same last digit tend to not follow each other.

Grid[Prepend[Transpose[Prepend[Partition[Last /@ Sort[Tally[Partition[Mod[Prime[Range[4, 1000000]], 10], 2, 1]]], 
     4], {1, 3, 7, 9}]], {"", 1, 3, 7, 9}]]  

Yep, that seems to be true.

       1     3        7          9
1   42853 58255   64230 84596
3   77475 39668   68595 64371
7   79453 72827   39603 58130
9   50153 79358   77586 42843
POSTED BY: Ed Pegg
4 Replies
Posted 10 years ago
POSTED BY: Jari Kirma
POSTED BY: Daniel Lichtblau

Here's some code that facilitates exploration of the ideas. The notion is that perhaps Machine Learning can be used to compute the next prime mod 3 from some sequence of preceding primes mod 3. The optional argument digitToCheck extends the idea to see whether one could predict the nth digit of the a prime from the nth digit of its predecessor primes. (all mod 3)

 cm[predecessors_Integer, trainingRange_: {4, 10000}, 
   testingRange_: {10001, 20000}, digitToCheck_: - 1] := 
  Module[{trainingData = 
     Map[Most@# -> Last@# &, 
      Partition[
       Map[IntegerDigits[#, 3][[digitToCheck]] &, 
        Table[Prime[i], {i, trainingRange[[1]], trainingRange[[2]]}]], 
       predecessors + 1, 1]], c, m},

   c = Classify[trainingData];
   m = ClassifierMeasurements[c, 
     Map[Most@# -> Last@# &, 
      Partition[
       Map[IntegerDigits[#, 3][[digitToCheck]] &, 
        Table[Prime[i], {i, testingRange[[1]], testingRange[[2]]}]], 
       predecessors + 1, 1]]];
   Sow[Association["Classifier" -> c, "ClassifierMeasurements" -> m, 
     "Predecessors" -> predecessors, "TrainingRange" -> trainingRange, 
     "TestingRange" -> testingRange]];
   m["Accuracy"]
   ]

And here are some preliminary experiments you can run:

 cm[1, {10000, 19999}, {50000, 
   59999}, -1](* just use immediate predecessor *)

 cm[2, {10000, 19999}, {50000, 59999}, -1](* two predecessors *)

 cm[3, {10000, 19999}, {50000, 59999}, -1](* three predecessors *)

 cm[1, {10000, 19999}, {50000, 
   59999}, -1](* training and testing data far apart *)

 cm[1, {20000, 29999}, {50000, 
   59999}, -1](* different training data far apart *)

 cm[1, {10000, 19999}, {50000, 
   59999}, -2] (* just use immediate predecessor but check whether the \
 second to last digit predicts *)

 cm[2, {10000, 19999}, {50000, 
   59999}, -2](* two predecessors but check whether the second to last \
 digit predicts*)
POSTED BY: Seth Chandler
Posted 10 years ago

Paul Abbott points out Distribution of the units digit of primes. Ko pointed out this behavior in 2002, and it was likely noticed before then.

POSTED BY: Ed Pegg
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard