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

Home > Just Math
Journey from 11 to 25 (Posted on 2025-05-14) Difficulty: 2 of 5
How can you go from the number 11 to 25 by only multiplying by 2 or decreasing by 3 in a minimum number of steps?

No Solution Yet Submitted by Danish Ahmed Khan    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution | Comment 1 of 2
clearvars,clc
global path shortest shortpath t shortt
shortest=30;
path=[11]; t='';
addon
shortest
shortpath
shortt

function addon()
global path shortest shortpath t shortt
  for type = 1:2
    savepath=path;
    savet=t;

    if type==2
      path(end+1)=path(end)-3;
      t(end+1)='-';
    else
      path(end+1)=path(end)*2;
      t(end+1)='*';
    end
    if path(end)==25
      if length(path)<shortest
        shortest=length(path);
        shortpath=path;
        shortt=t;
      end
    else
      if length(path)<10
        addon;
      end
    end

    path=savepath;
    t=savet;
  end
end

shows

shortest =
     8
shortpath =
    11     8     5    10     7    14    28    25
shortt =
    '--*-**-'
    
indicating the sequence is 7 steps long: 2 subtractions, 1 multiplication, 1 subtraction, 2 multiplications, and 1 final subtraction, making the sequence of numbers:

   11, 8, 5, 10, 7, 14, 28, 25


  Posted by Charlie on 2025-05-14 08:33:20
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 (5)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

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