Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; plgContentJComments has a deprecated constructor in /var/www/astarmathsandphysics/plugins/content/jcomments/jcomments.php on line 25 Call Stack: 0.0001 360720 1. {main}() /var/www/astarmathsandphysics/index.php:0 0.0496 1209368 2. Joomla\CMS\Application\SiteApplication->execute() /var/www/astarmathsandphysics/index.php:49 0.0496 1209368 3. Joomla\CMS\Application\SiteApplication->doExecute() /var/www/astarmathsandphysics/libraries/src/Application/CMSApplication.php:267 0.1549 4102376 4. Joomla\CMS\Application\SiteApplication->dispatch() /var/www/astarmathsandphysics/libraries/src/Application/SiteApplication.php:233 0.1563 4129928 5. Joomla\CMS\Component\ComponentHelper::renderComponent() /var/www/astarmathsandphysics/libraries/src/Application/SiteApplication.php:194 0.1571 4147640 6. Joomla\CMS\Component\ComponentHelper::executeComponent() /var/www/astarmathsandphysics/libraries/src/Component/ComponentHelper.php:356 0.1571 4164648 7. require_once('/var/www/astarmathsandphysics/components/com_content/content.php') /var/www/astarmathsandphysics/libraries/src/Component/ComponentHelper.php:381 0.1579 4172384 8. ContentController->execute() /var/www/astarmathsandphysics/components/com_content/content.php:42 0.1579 4172384 9. ContentController->display() /var/www/astarmathsandphysics/libraries/src/MVC/Controller/BaseController.php:710 0.2080 4401760 10. ContentController->display() /var/www/astarmathsandphysics/components/com_content/controller.php:113 0.2096 4419160 11. Joomla\CMS\Cache\Controller\ViewController->get() /var/www/astarmathsandphysics/libraries/src/MVC/Controller/BaseController.php:663 0.2102 4440088 12. ContentViewArticle->display() /var/www/astarmathsandphysics/libraries/src/Cache/Controller/ViewController.php:102 0.2192 4505872 13. Joomla\CMS\Plugin\PluginHelper::importPlugin() /var/www/astarmathsandphysics/components/com_content/views/article/view.html.php:189 0.2192 4506128 14. Joomla\CMS\Plugin\PluginHelper::import() /var/www/astarmathsandphysics/libraries/src/Plugin/PluginHelper.php:182 Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; JCommentsACL has a deprecated constructor in /var/www/astarmathsandphysics/components/com_jcomments/classes/acl.php on line 17 Call Stack: 0.0001 360720 1. {main}() /var/www/astarmathsandphysics/index.php:0 0.0496 1209368 2. Joomla\CMS\Application\SiteApplication->execute() /var/www/astarmathsandphysics/index.php:49 0.0496 1209368 3. Joomla\CMS\Application\SiteApplication->doExecute() /var/www/astarmathsandphysics/libraries/src/Application/CMSApplication.php:267 0.1549 4102376 4. Joomla\CMS\Application\SiteApplication->dispatch() /var/www/astarmathsandphysics/libraries/src/Application/SiteApplication.php:233 0.1563 4129928 5. Joomla\CMS\Component\ComponentHelper::renderComponent() /var/www/astarmathsandphysics/libraries/src/Application/SiteApplication.php:194 0.1571 4147640 6. Joomla\CMS\Component\ComponentHelper::executeComponent() /var/www/astarmathsandphysics/libraries/src/Component/ComponentHelper.php:356 0.1571 4164648 7. require_once('/var/www/astarmathsandphysics/components/com_content/content.php') /var/www/astarmathsandphysics/libraries/src/Component/ComponentHelper.php:381 0.1579 4172384 8. ContentController->execute() /var/www/astarmathsandphysics/components/com_content/content.php:42 0.1579 4172384 9. ContentController->display() /var/www/astarmathsandphysics/libraries/src/MVC/Controller/BaseController.php:710 0.2080 4401760 10. ContentController->display() /var/www/astarmathsandphysics/components/com_content/controller.php:113 0.2096 4419160 11. Joomla\CMS\Cache\Controller\ViewController->get() /var/www/astarmathsandphysics/libraries/src/MVC/Controller/BaseController.php:663 0.2102 4440088 12. ContentViewArticle->display() /var/www/astarmathsandphysics/libraries/src/Cache/Controller/ViewController.php:102 0.4094 12294424 13. JEventDispatcher->trigger() /var/www/astarmathsandphysics/components/com_content/views/article/view.html.php:199 0.4097 12294872 14. plgContentJComments->update() /var/www/astarmathsandphysics/libraries/joomla/event/dispatcher.php:160 0.4097 12294872 15. plgContentJComments->onContentAfterDisplay() /var/www/astarmathsandphysics/libraries/joomla/event/event.php:70 0.4100 12303120 16. plgContentJComments->onAfterDisplayContent() /var/www/astarmathsandphysics/plugins/content/jcomments/jcomments.php:339 0.4103 12304856 17. JComments::show() /var/www/astarmathsandphysics/plugins/content/jcomments/jcomments.php:282 0.4109 12337904 18. JCommentsFactory::getACL() /var/www/astarmathsandphysics/components/com_jcomments/jcomments.php:188 0.4109 12338304 19. spl_autoload_call() /var/www/astarmathsandphysics/components/com_jcomments/classes/factory.php:274 0.4110 12338384 20. JLoader::load() /var/www/astarmathsandphysics/components/com_jcomments/classes/factory.php:274

The Russian Peasant Algorithm

The Russian Peasant Algorithm multiplies two numbers together. The steps are:

1. Write down the two numbers in the two columns of a table.

2. Divide the number in column 1 by 2 and write the result in the second row below the first number, ignoring decimals and remainders.

3. Multiply the number in column 2 by two and write the answer below the second number in column 2.

4. Repeat steps 2 and 3 until the last number in the first column is 1.

5. Delete every row that has an even number in column 1.

6. Add up the numbers in column 2 that have not been crossed out. The result is the product of the two numbers.

55

53

27

106

13

212

6

424

3

848

1

1696

Dividing 55 successively by 2 and ignoring the remainder gives 27, 13, 6, 3, 1.

Delete row 4 containing an (even) 6.

55

53

27

106

13

212

3

848

1

1696

Add up the numbers in column 2 that are not crossed out to give 53+106+212+848+1696=2915.

This is indeed equal to 55*53.

Add comment

Security code
Refresh