All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Probability
2014 Prime Treat (Posted on 2014-12-22) Difficulty: 3 of 5
(2014)base N denotes the base-N number 2014.

Determine the probability that for all the positive odd values of N chosen at random from (5)base 10 to (203)base 10 inclusively, the number (2014)base N is a prime number.

No Solution Yet Submitted by K Sengupta    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution and exploration Comment 1 of 1
The following table shows the base N followed by the prime value in decimal of 2014 and the fraction of the odd numbers tested thus far that meet this criterion.  The numbers of course will skew somewhat high, as they are reported only when a hit has just been made:

 decimal
N prime      fraction hits
9 1471 0.33333333333333
11 2677 0.50000000000000
27 39397 0.25000000000000
31 59617 0.28571428571429
37 101347 0.29411764705882
39 118681 0.33333333333333
53 297811 0.28000000000000
65 549319 0.25806451612903
69 657091 0.27272727272727
73 778111 0.28571428571429
83 1143661 0.27500000000000
95 1714849 0.26086956521739
111 2735377 0.24074074074074
137 5142847 0.20895522388060
161 8346727 0.18987341772152
179 11470861 0.18181818181818
185 12663439 0.18681318681319

17 0.17000000000000

at n =  203 there have been 17 hits on the 100 odd numbers tried, for a 17% probability.

The running count is continued to 1000 (actually 999, of course)

223 22179361 0.16363636363636
231 24653017 0.16666666666667
237 26624347 0.17094017094017
263 36383161 0.16153846153846
269 38930491 0.16541353383459
287 47280097 0.16197183098592
289 48275431 0.16783216783217
297 52396447 0.17006802721088
307 57869197 0.17105263157895
317 63710347 0.17197452229299
325 68656579 0.17391304347826
339 77916781 0.17261904761905
345 82127599 0.17543859649123
349 85017451 0.17919075144509
359 92536921 0.17977528089888
389 117728131 0.17098445595855
391 119553337 0.17525773195876
401 128962807 0.17587939698493
405 132860659 0.17910447761194
413 140890411 0.18048780487805
419 147120541 0.18269230769231
423 151374361 0.18571428571429
427 155709397 0.18867924528302
433 162365911 0.19069767441861
445 176242699 0.19004524886878
455 188393209 0.19026548672566
457 190888447 0.19383259911894
473 211648111 0.19148936170213
479 219804961 0.19327731092437
525 289406779 0.18007662835249
535 306261289 0.18045112781955
543 320206561 0.18148148148148
549 330938851 0.18315018315018
557 345617947 0.18411552346570
569 368440591 0.18374558303887
571 372339397 0.18661971830986
577 384200647 0.18815331010453
595 421290349 0.18581081081081
609 451733671 0.18481848184819
611 456198877 0.18750000000000
627 492984397 0.18589743589744
647 541680697 0.18322981366460
655 562023409 0.18404907975460
679 626094361 0.18047337278107
681 631643167 0.18289085545723
689 654166231 0.18367346938776
723 755866861 0.17777777777778
753 853916311 0.17333333333333
759 874491721 0.17460317460318
767 902436097 0.17539267015707
779 945459061 0.17525773195876
797 1012523947 0.17380352644836
821 1106776147 0.17114914425428
853 1241301811 0.16705882352941
861 1276555627 0.16783216783217
899 1453146301 0.16294642857143
927 1593196897 0.16017316017316
945 1687818199 0.15923566878981
969 1819707391 0.15734989648033
987 1923010597 0.15650406504065
997 1982054947 0.15694164989940

At the arbitrary cutoff point of 999, the probability is down to about 15.7%:

78 0.15662650602410

 s$ = "2014"
 nlim = 1000
 For n = 5 To nlim Step 2
   denom = denom + 1
   v = 0
   For i = 1 To 4
     v = v * n + Val(Mid(s$, i, 1))
   Next
   If prmdiv(v) = v Then
     ct = ct + 1
     Text1.Text = Text1.Text & n & Str(v) & mform(ct / denom, " 0.00000000000000") & crlf
     DoEvents
   End If
   If n = 203 Then
     Text1.Text = Text1.Text & crlf & ct & mform(ct / denom, " 0.00000000000000") & crlf & crlf
   End If
 Next n
 
 Text1.Text = Text1.Text & ct & mform(ct / denom, " 0.00000000000000")

Function prmdiv(num)
 Dim n, dv, q
 If num = 1 Then prmdiv = 1: Exit Function
 n = Abs(num): If n > 0 Then limit = Sqr(n) Else limit = 0
 If limit <> Int(limit) Then limit = Int(limit + 1)
 dv = 2: GoSub DivideIt
 dv = 3: GoSub DivideIt
 dv = 5: GoSub DivideIt
 dv = 7
 Do Until dv > limit
   GoSub DivideIt: dv = dv + 4 '11
   GoSub DivideIt: dv = dv + 2 '13
   GoSub DivideIt: dv = dv + 4 '17
   GoSub DivideIt: dv = dv + 2 '19
   GoSub DivideIt: dv = dv + 4 '23
   GoSub DivideIt: dv = dv + 6 '29
   GoSub DivideIt: dv = dv + 2 '31
   GoSub DivideIt: dv = dv + 6 '37
 Loop
 If n > 1 Then prmdiv = n
 Exit Function

DivideIt:
 Do
  q = Int(n / dv)
  If q * dv = n And n > 0 Then
    prmdiv = dv: Exit Function
   Else
    Exit Do
  End If
 Loop

 Return
End Function


  Posted by Charlie on 2014-12-22 15:52:52
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (2)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2017 by Animus Pactum Consulting. All rights reserved. Privacy Information