Bitcoin Forum
December 07, 2016, 12:51:21 PM *
News: To be able to use the next phase of the beta forum software, please ensure that your email address is correct/functional.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Calculating total bitcoins by number of blocks generated  (Read 2475 times)
mizerydearia
Hero Member
*****
Offline Offline

Activity: 574



View Profile
July 22, 2010, 01:58:53 AM
 #1

I couldn't find a post about this, so I created this.

freenode / #math
Quote
<necrodearia>http://pastebin.com/MJPr8K9d is a PHP script I wrote that calculates the output I'm looking for in http://nullvoid.org/formula.html but I would like to know if there is a one line math formula that can produce the same.
<meingtsla> necrodearia: not sure about a single-line math formula, but you could do the integer division of y by 210000 (call it yQuotient) and use that to compute 210000*(50+25+...+50/2^yInt).  (that's a geometric series.)  then you can take the remainder of that division, call it yRemainder, and find yRemainder * 50/2^(yQuotient+1).
<meingtsla> not gonna flesh it out in code myself, i'll leave that to you :p
<meingtsla> sorry, wherever i said y it should be x.  (integer division of x by 210000.... xQuotient... 50/2^xQuotient... xRemainder)

Here's the script in action:
http://nullvoid.org/bitcoin/blockcalc.php?b=1
http://nullvoid.org/bitcoin/blockcalc.php?b=210000
http://nullvoid.org/bitcoin/blockcalc.php?b=1000000
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!