Cody

Problem 44705. Expand 10^n to Powers of 4

Solution 2950120

Submitted on 15 Sep 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
n = 0; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n) & isequal(coeff(1),coeff(end)) & coeff(1)>0)

Output argument "ans" (and maybe others) not assigned during call to "ten2pow4". Error in Test1 (line 2) coeff = ten2pow4(n);

2   Fail
n = 1; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n) & isequal(coeff(1),coeff(end)) & coeff(1)>0)

Output argument "ans" (and maybe others) not assigned during call to "ten2pow4". Error in Test2 (line 2) coeff = ten2pow4(n);

3   Fail
n = 2; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n) & isequal(coeff(1),coeff(end)) & coeff(1)>0)

Output argument "ans" (and maybe others) not assigned during call to "ten2pow4". Error in Test3 (line 2) coeff = ten2pow4(n);

4   Fail
n = 3; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n) & isequal(coeff(1),coeff(end)) & coeff(1)>0)

Output argument "ans" (and maybe others) not assigned during call to "ten2pow4". Error in Test4 (line 2) coeff = ten2pow4(n);

5   Fail
n = 4; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n) & isequal(coeff(1),coeff(end)) & coeff(1)>0)

Output argument "ans" (and maybe others) not assigned during call to "ten2pow4". Error in Test5 (line 2) coeff = ten2pow4(n);

6   Fail
n = 5; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n) & isequal(coeff(1),coeff(end)) & coeff(1)>0)

Output argument "ans" (and maybe others) not assigned during call to "ten2pow4". Error in Test6 (line 2) coeff = ten2pow4(n);

7   Fail
n = 6; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n)& isequal(coeff(1),coeff(end)) & coeff(1)>0)

Output argument "ans" (and maybe others) not assigned during call to "ten2pow4". Error in Test7 (line 2) coeff = ten2pow4(n);

8   Fail
n = 7; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n) & isequal(coeff(1),coeff(end)) & coeff(1)>0)

Output argument "ans" (and maybe others) not assigned during call to "ten2pow4". Error in Test8 (line 2) coeff = ten2pow4(n);

9   Fail
n = 8; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n) & isequal(coeff(1),coeff(end)) & coeff(1)>0)

Output argument "ans" (and maybe others) not assigned during call to "ten2pow4". Error in Test9 (line 2) coeff = ten2pow4(n);

10   Fail
n = 9; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n) & isequal(coeff(1),coeff(end)) & coeff(1)>0)

Output argument "ans" (and maybe others) not assigned during call to "ten2pow4". Error in Test10 (line 2) coeff = ten2pow4(n);

11   Fail
n = 10; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n) & isequal(coeff(1),coeff(end))&coeff(1)>0)

Output argument "ans" (and maybe others) not assigned during call to "ten2pow4". Error in Test11 (line 2) coeff = ten2pow4(n);

12   Fail
n = 11; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n) & isequal(coeff(1),coeff(end))&coeff(1)>0)

Output argument "ans" (and maybe others) not assigned during call to "ten2pow4". Error in Test12 (line 2) coeff = ten2pow4(n);

13   Fail
n = 12; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n) & isequal(coeff(1),coeff(end))&coeff(1)>0)

Output argument "ans" (and maybe others) not assigned during call to "ten2pow4". Error in Test13 (line 2) coeff = ten2pow4(n);

14   Fail
n = 13; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n) & isequal(coeff(1),coeff(end))&coeff(1)>0)

Output argument "ans" (and maybe others) not assigned during call to "ten2pow4". Error in Test14 (line 2) coeff = ten2pow4(n);

15   Fail
n = 14; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n) & isequal(coeff(1),coeff(end))&coeff(1)>0)

Output argument "ans" (and maybe others) not assigned during call to "ten2pow4". Error in Test15 (line 2) coeff = ten2pow4(n);

16   Fail
n = 15; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n) & isequal(coeff(1),coeff(end))&coeff(1)>0)

Output argument "ans" (and maybe others) not assigned during call to "ten2pow4". Error in Test16 (line 2) coeff = ten2pow4(n);

17   Fail
n = 16; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n) & isequal(coeff(1),coeff(end)) & coeff(1)>0)

Output argument "ans" (and maybe others) not assigned during call to "ten2pow4". Error in Test17 (line 2) coeff = ten2pow4(n);

Community Treasure Hunt

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

Start Hunting!