Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 674095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:40:05+00:00 2026-05-14T00:40:05+00:00

I am given a number N, and i must add some numbers from the

  • 0

I am given a number N, and i must add some numbers from the array V so that they wil be equal. V is consisting of numbers that are all powers of 3:

    N = 17
    S = 0
V = 1 3 9 27 81 ..

I should add numbers from V to N and S in order to make them equal. The solution to the example above is :
17 + 1 + 9 = 27, 27, 1 and 9 are taken from V, a number from V can be taken only once, and when taken it’s removed from V.

I tried sorting V and then adding the biggest numbers from V to S until S has reached N, but it fails on some tests when it’s like:

N = 7
S = 0
V = 1 3 9 27
So the solution will be:
7 + 3 = 9 + 1

In examples like this i need to add numbers both to N and S, and also select them so they become equal.
Any idea of solving this ? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T00:40:06+00:00Added an answer on May 14, 2026 at 12:40 am

    Write N in base 3: 17 = 2*1 + 2*3 + 1*9
    Find the first power of 3 with coefficient 2, in this case 1.
    Add this power of 3: 17 + 1
    Repeat until all coefficients are 0 or 1.

    17 = 2*1 + 2*3 + 1*9
    17 + 1 = 2*9
    17 + 1 + 9 = 27

    7 = 1*1 + 2*3
    7 + 3 = 1*1 + 1*9

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to write multithread windows application that runs a program in given number of
Anyone know an add-in or something that could give me the number of time
Given an array of ints, is it possible to choose a group of some
Given the scenario: Collection of X number of records from ModelA is retrieved, processing
The task is to generate a given number of numeric pins of a given
How can I rotate an Bitmap a given number of degrees while maintaining the
How can I find the least prime number greater than a given number? For
I'm writing a code to identify the subfix for a given number. I have
Can anyone tell me how to format a given number of seconds (for example
This question asks how to compute the Cartesian product of a given number of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.