Expand 10^n to Powers of 4 - MATLAB Cody - MATLAB Central

Problem 44705. Expand 10^n to Powers of 4

Difficulty:Rate

Given an integer n, return the coefficients

     c = [c_n,c_n-1,...,c_0]

Such that

    10^n = c_n*4^(n) + c_n-1*4^(n-1) +...+ c_0*4^(0)

With the constraint that

   c_n = c_0

For example,

n = 1
10^n = 10 = 2*4^(1) + 2*4^(0), so c = [2  2] 

Solution Stats

15.2% Correct | 84.8% Incorrect
Last Solution submitted on Feb 12, 2025

Problem Comments

Solution Comments

Show comments

Group

Number Manipulation IV Image
Number Manipulation IV
  • 15 Problems
  • 30 Finishers

Problem Recent Solvers42

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Go to top of page