mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Forum Feedback (https://www.mersenneforum.org/forumdisplay.php?f=61)
-   -   What's the algorithm for deciding in which base to express the post count? (https://www.mersenneforum.org/showthread.php?t=21721)

jasong 2016-11-05 23:26

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?

Stargate38 2016-11-05 23:58

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.

Xyzzy 2016-11-06 00:58

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&times;"[/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]"&times;"[/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]"&times;"[/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]"&times;"[/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:

Dubslow 2016-11-06 19:22

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.

retina 2016-11-07 06:04

What about ...[code]for ($iii = 2; $iii [color=red][b]* $iii <=[/b][/color] $zzz; $iii++)[/code]Fewer wasted clock cycles = more P95 clock cycles.

Antonio 2016-11-07 10:58

[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.

retina 2016-11-07 12:04

[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]

Antonio 2016-11-07 13:04

[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]"&times;"[/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]"&times;"[/COLOR][COLOR=#007700]; [/COLOR]
}
[/CODE] or it misses the final prime.

axn 2016-11-07 13:17

[URL="http://www.mersenneforum.org/showthread.php?t=21033"]Nothing new under the sun[/URL]

Mark Rose 2016-11-08 02:22

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.