![]() |
What's the algorithm for deciding in which base to express the post count?
Is it random? And what are all the possible bases for this particular algorithm? I mean the bases that are being used right now, not ones you could potentially add.
All the bases seem to be a power of 2, base 2, 4, 8, 16, 32, have I missed or forgotten some that don't fit this pattern? edit: Oh yeah, also there's post counts where they factor the numbers. Maybe the ones in a weird base are all prime? |
I think it depends on the subforum, or possibly even the thread number (i.e. this thread starts with 446485). It could also be a random seed-based algorithm.
|
This code is really inelegant, but it works.[CODE][COLOR=#000000][COLOR=#0000BB]$zzz [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]$post[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]posts[/COLOR][COLOR=#007700]];
[/COLOR][COLOR=#0000BB]$xxx [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]$zzz[/COLOR][COLOR=#007700]; if ([/COLOR][COLOR=#0000BB]$xxx [/COLOR][COLOR=#007700]== [/COLOR][COLOR=#0000BB]0[/COLOR][COLOR=#007700]) { [/COLOR][COLOR=#0000BB]$zzz [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]rand[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]1[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]10000[/COLOR][COLOR=#007700]); [/COLOR][COLOR=#0000BB]$xxx [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]$zzz[/COLOR][COLOR=#007700]; } [/COLOR][COLOR=#0000BB]$tmp [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#DD0000]""[/COLOR][COLOR=#007700]; [/COLOR][COLOR=#0000BB]$choice [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]time[/COLOR][COLOR=#007700](); if ([/COLOR][COLOR=#0000BB]$choice [/COLOR][COLOR=#007700]% [/COLOR][COLOR=#0000BB]20 [/COLOR][COLOR=#007700]== [/COLOR][COLOR=#0000BB]0[/COLOR][COLOR=#007700]) { [/COLOR][COLOR=#0000BB]$listofradices [/COLOR][COLOR=#007700]= array([/COLOR][COLOR=#DD0000]"2"[/COLOR][COLOR=#007700], [/COLOR][COLOR=#DD0000]"8"[/COLOR][COLOR=#007700], [/COLOR][COLOR=#DD0000]"10"[/COLOR][COLOR=#007700], [/COLOR][COLOR=#DD0000]"16"[/COLOR][COLOR=#007700]); [/COLOR][COLOR=#0000BB]shuffle[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$listofradices[/COLOR][COLOR=#007700]); [/COLOR][COLOR=#0000BB]$radix [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]$listofradices[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]0[/COLOR][COLOR=#007700]]; [/COLOR][COLOR=#0000BB]$tmp [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]strtoupper[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]base_convert[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$xxx[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]10[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]$radix[/COLOR][COLOR=#007700])) . [/COLOR][COLOR=#DD0000]"<SUB>" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000BB]$radix [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#DD0000]"</SUB>"[/COLOR][COLOR=#007700]; } else { if ([/COLOR][COLOR=#0000BB]$xxx [/COLOR][COLOR=#007700]== [/COLOR][COLOR=#0000BB]1[/COLOR][COLOR=#007700]) { [/COLOR][COLOR=#0000BB]$tmp [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#DD0000]"1×"[/COLOR][COLOR=#007700]; } for ([/COLOR][COLOR=#0000BB]$iii [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]2[/COLOR][COLOR=#007700]; [/COLOR][COLOR=#0000BB]$iii [/COLOR][COLOR=#007700]< [/COLOR][COLOR=#0000BB]$zzz[/COLOR][COLOR=#007700]; [/COLOR][COLOR=#0000BB]$iii[/COLOR][COLOR=#007700]++) { [/COLOR][COLOR=#0000BB]$counter [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]0[/COLOR][COLOR=#007700]; while ([/COLOR][COLOR=#0000BB]$xxx [/COLOR][COLOR=#007700]% [/COLOR][COLOR=#0000BB]$iii [/COLOR][COLOR=#007700]== [/COLOR][COLOR=#0000BB]0[/COLOR][COLOR=#007700]) { [/COLOR][COLOR=#0000BB]$counter [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]$counter [/COLOR][COLOR=#007700]+ [/COLOR][COLOR=#0000BB]1[/COLOR][COLOR=#007700]; [/COLOR][COLOR=#0000BB]$xxx [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]$xxx [/COLOR][COLOR=#007700]/ [/COLOR][COLOR=#0000BB]$iii[/COLOR][COLOR=#007700]; } if ([/COLOR][COLOR=#0000BB]$counter [/COLOR][COLOR=#007700]> [/COLOR][COLOR=#0000BB]1[/COLOR][COLOR=#007700]) { [/COLOR][COLOR=#0000BB]$tmp [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]$tmp [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000BB]number_format[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$iii[/COLOR][COLOR=#007700]) . [/COLOR][COLOR=#DD0000]"<SUP>" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000BB]$counter [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#DD0000]"</SUP>" [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#DD0000]"×"[/COLOR][COLOR=#007700]; } else { if ([/COLOR][COLOR=#0000BB]$counter [/COLOR][COLOR=#007700]== [/COLOR][COLOR=#0000BB]1[/COLOR][COLOR=#007700]) { [/COLOR][COLOR=#0000BB]$tmp [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]$tmp [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000BB]number_format[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$iii[/COLOR][COLOR=#007700]) . [/COLOR][COLOR=#DD0000]"×"[/COLOR][COLOR=#007700]; } } } if ([/COLOR][COLOR=#0000BB]$xxx [/COLOR][COLOR=#007700]== [/COLOR][COLOR=#0000BB]$iii[/COLOR][COLOR=#007700]) { [/COLOR][COLOR=#0000BB]$tmp [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]$tmp [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000BB]number_format[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$xxx[/COLOR][COLOR=#007700]) . [/COLOR][COLOR=#DD0000]"×"[/COLOR][COLOR=#007700]; } [/COLOR][COLOR=#0000BB]$tmp [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]substr[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$tmp[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]0[/COLOR][COLOR=#007700], -[/COLOR][COLOR=#0000BB]7[/COLOR][COLOR=#007700]); }[/COLOR][/COLOR][/CODE]:mike: |
Looks like 1 in 20 chance to get binary, octal, decimal, or hex post count, otherwise (19 out of 20) it's shown in factored form.
|
What about ...[code]for ($iii = 2; $iii [color=red][b]* $iii <=[/b][/color] $zzz; $iii++)[/code]Fewer wasted clock cycles = more P95 clock cycles.
|
[QUOTE=retina;446643]What about ...[code]for ($iii = 2; $iii [COLOR=red][B]* $iii <=[/B][/COLOR] $zzz; $iii++)[/code]Fewer wasted clock cycles = more P95 clock cycles.[/QUOTE]
Sorry - ignore me, just being stupid today :blush: Or ... [CODE] for ($iii = 2; $iii < $xxx; $iii++) { [/CODE]and do away with the multiply. |
[QUOTE=Antonio;446647]and do away with the multiply.[/QUOTE]If $xxx is a prime then we get back the original algorithm.
ETA: But it could be this:[code]for ($iii = 2; $iii * $iii <= $xxx; $iii++)[/code] |
[QUOTE=retina;446649]If $xxx is a prime then we get back the original algorithm.
ETA: But it could be this:[code]for ($iii = 2; $iii * $iii <= $xxx; $iii++)[/code][/QUOTE] But you also need to change ...[CODE][COLOR=#007700] if ([/COLOR][COLOR=#0000bb]$xxx [/COLOR][COLOR=#007700]== [/COLOR][COLOR=#0000bb]$iii[/COLOR][COLOR=#007700]) { [/COLOR][COLOR=#0000bb]$tmp [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]$tmp [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000bb]number_format[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$xxx[/COLOR][COLOR=#007700]) . [/COLOR][COLOR=#dd0000]"×"[/COLOR][COLOR=#007700]; } [/COLOR][/CODE]to ...[CODE] if ($xxx != 1) { $tmp = $tmp . [COLOR=#0000bb]number_format[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$xxx) [/COLOR]. [COLOR=#dd0000]"×"[/COLOR][COLOR=#007700]; [/COLOR] } [/CODE] or it misses the final prime. |
[URL="http://www.mersenneforum.org/showthread.php?t=21033"]Nothing new under the sun[/URL]
|
I'm still waiting for
[code] if (!($xxx & $xxx + 1)) $tmp = 'M' . log($xxx + 1, 2); elseif ($choice % 20 == 0) { ... [/code] |
| All times are UTC. The time now is 13:32. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.