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

Home > Numbers
Ingenious Sum Puzzle 2 (Posted on 2023-07-01) Difficulty: 3 of 5
(A)Consider the set of all possible positive quaternary (base 4) integers each having exactly twelve digits consisting of precisely three 1's, three 2's, three 3's and three 0's. The first digit cannot be 0. Determine the sum of all these numbers in the decimal notation.

(B)Consider the set of all possible positive quinary (base 5) positive integers each having exactly fifteen digits consisting of precisely three 1's, three 2's, three 3's, three 4's, and three 0's. The first digit cannot be 0. Determine the sum of all these numbers in the base ten (decimal) notation.

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
(A) only (partial spoiler) | Comment 1 of 2
(A)

clearvars,clc
global supply ns n tot ct 
resources='000111222333'
supply=resources;
ns=''; n=0; tot=0; ct=0;
buildIt(12)
tot

function buildIt(wh)
global supply ns n tot ct 
  for addChar=['0' '1' '2' '3']
    if contains(supply,addChar)
      
      ns(wh)=addChar;
      ix=strfind(supply,addChar);
      supply(ix(1))=[];
      if wh==1
        if ns(1)~='0'
          n=base2dec(ns,4);
          tot=tot+n;
          ct=ct+1;
        end
      else
        buildIt(wh-1)
      end

      supply=[supply addChar];
    end
  end
end

finds

tot =
             2889036460800

(B) will have to await an analytic solution, or a faster programming language.

  Posted by Charlie on 2023-07-01 12:21:00
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (6)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

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