Cody

# Problem 44306. Is it really a 5?

Solution 1289444

Submitted on 16 Oct 2017 by Reggie Wilcox
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   Pass
n = 5; assert(isequal(is_it_really_a_5(n),1))

tf = logical 0 str = '5' l = 1 l2 = 3 str2 = 48 48 48 str2 = 48 48 53 str2 = 48 48 53 str = 48 48 53 tf = logical 1

2   Pass
n = 15; assert(isequal(is_it_really_a_5(n),0))

tf = logical 0 str = '15' l = 2 l2 = 3 str2 = 48 48 48 str2 = 48 49 53 str2 = 48 49 53 str2 = 48 49 48 str = 48 49 48

3   Pass
n = 25; assert(isequal(is_it_really_a_5(n),1))

tf = logical 0 str = '25' l = 2 l2 = 3 str2 = 48 48 48 str2 = 48 50 53 str2 = 48 50 53 str = 48 50 53 tf = logical 1

4   Pass
n = 35; assert(isequal(is_it_really_a_5(n),1))

tf = logical 0 str = '35' l = 2 l2 = 3 str2 = 48 48 48 str2 = 48 51 53 str2 = 48 51 53 str = 48 51 53 tf = logical 1

5   Pass
n = 50; assert(isequal(is_it_really_a_5(n),0))

tf = logical 0 str = '50' l = 2 l2 = 3 str2 = 48 48 48 str2 = 48 53 48 str2 = 48 53 48 str2 = 48 48 48 str = 48 48 48

6   Pass
n = 52; assert(isequal(is_it_really_a_5(n),0))

tf = logical 0 str = '52' l = 2 l2 = 3 str2 = 48 48 48 str2 = 48 53 50 str2 = 48 53 50 str2 = 48 48 50 str = 48 48 50

7   Pass
n = 55; assert(isequal(is_it_really_a_5(n),1))

tf = logical 0 str = '55' l = 2 l2 = 3 str2 = 48 48 48 str2 = 48 53 53 str2 = 48 53 53 str2 = 48 48 53 str = 48 48 53 tf = logical 1

8   Pass
n = 59; assert(isequal(is_it_really_a_5(n),0))

tf = logical 0 str = '59' l = 2 l2 = 3 str2 = 48 48 48 str2 = 48 53 57 str2 = 48 53 57 str2 = 48 48 57 str = 48 48 57

9   Pass
n = 85; assert(isequal(is_it_really_a_5(n),1))

tf = logical 0 str = '85' l = 2 l2 = 3 str2 = 48 48 48 str2 = 48 56 53 str2 = 48 56 53 str = 48 56 53 tf = logical 1

10   Pass
n = 105; assert(isequal(is_it_really_a_5(n),1))

tf = logical 0 str = '105' l = 3 l2 = 3 str2 = 48 48 48 str2 = 49 48 53 str2 = 49 48 53 str = 49 48 53 tf = logical 1

11   Pass
n = 115; assert(isequal(is_it_really_a_5(n),0))

tf = logical 0 str = '115' l = 3 l2 = 3 str2 = 48 48 48 str2 = 49 49 53 str2 = 49 49 53 str2 = 49 49 48 str = 49 49 48

12   Pass
n = 125; assert(isequal(is_it_really_a_5(n),1))

tf = logical 0 str = '125' l = 3 l2 = 3 str2 = 48 48 48 str2 = 49 50 53 str2 = 49 50 53 str = 49 50 53 tf = logical 1

13   Pass
n = 250; assert(isequal(is_it_really_a_5(n),0))

tf = logical 0 str = '250' l = 3 l2 = 3 str2 = 48 48 48 str2 = 50 53 48 str2 = 50 53 48 str2 = 50 48 48 str = 50 48 48

14   Pass
n = 500; assert(isequal(is_it_really_a_5(n),1))

tf = logical 0 str = '500' l = 3 l2 = 3 str2 = 48 48 48 str2 = 53 48 48 str2 = 53 48 48 str = 53 48 48 tf = logical 1

15   Pass
n = 555; assert(isequal(is_it_really_a_5(n),1))

tf = logical 0 str = '555' l = 3 l2 = 3 str2 = 48 48 48 str2 = 53 53 53 str2 = 53 53 53 str2 = 53 48 53 str = 53 48 53 tf = logical 1 tf = logical 1

16   Pass
n = 5000; %5,000 assert(isequal(is_it_really_a_5(n),1))

tf = logical 0 str = '5000' l = 4 l2 = 6 str2 = 48 48 48 48 48 48 str2 = 48 48 53 48 48 48 str2 = 48 48 53 48 48 48 str = 48 48 48 48 53 48 tf = logical 1

17   Pass
n = 15000; %15,000 assert(isequal(is_it_really_a_5(n),0))

tf = logical 0 str = '15000' l = 5 l2 = 6 str2 = 48 48 48 48 48 48 str2 = 48 49 53 48 48 48 str2 = 48 49 53 48 48 48 str2 = 48 49 48 48 48 48 str = 48 48 49 48 48 48

18   Pass
n = 55555; %55,555 assert(isequal(is_it_really_a_5(n),1))

tf = logical 0 str = '55555' l = 5 l2 = 6 str2 = 48 48 48 48 48 48 str2 = 48 53 53 53 53 53 str2 = 48 53 53 53 53 53 str2 = 48 48 53 53 53 53 str2 = 48 48 53 53 48 53 str = 48 53 48 48 53 53 tf = logical 1 tf = logical 1 tf = logical 1

19   Pass
n = 50000; %50,000 assert(isequal(is_it_really_a_5(n),0))

tf = logical 0 str = '50000' l = 5 l2 = 6 str2 = 48 48 48 48 48 48 str2 = 48 53 48 48 48 48 str2 = 48 53 48 48 48 48 str2 = 48 48 48 48 48 48 str = 48 48 48 48 48 48

20   Pass
n = 55000; %55,000 assert(isequal(is_it_really_a_5(n),1))

tf = logical 0 str = '55000' l = 5 l2 = 6 str2 = 48 48 48 48 48 48 str2 = 48 53 53 48 48 48 str2 = 48 53 53 48 48 48 str2 = 48 48 53 48 48 48 str = 48 48 48 48 53 48 tf = logical 1

21   Pass
n = 50500; %50,500 assert(isequal(is_it_really_a_5(n),1))

tf = logical 0 str = '50500' l = 5 l2 = 6 str2 = 48 48 48 48 48 48 str2 = 48 53 48 53 48 48 str2 = 48 53 48 53 48 48 str2 = 48 48 48 53 48 48 str = 48 53 48 48 48 48 tf = logical 1

22   Pass
n = 50050; %50,050 assert(isequal(is_it_really_a_5(n),0))

tf = logical 0 str = '50050' l = 5 l2 = 6 str2 = 48 48 48 48 48 48 str2 = 48 53 48 48 53 48 str2 = 48 53 48 48 53 48 str2 = 48 48 48 48 53 48 str2 = 48 48 48 48 48 48 str = 48 48 48 48 48 48

23   Pass
n = 50005; %50,005 assert(isequal(is_it_really_a_5(n),1))

tf = logical 0 str = '50005' l = 5 l2 = 6 str2 = 48 48 48 48 48 48 str2 = 48 53 48 48 48 53 str2 = 48 53 48 48 48 53 str2 = 48 48 48 48 48 53 str = 48 48 48 48 48 53 tf = logical 1

24   Pass
n = 500000; %500,000 assert(isequal(is_it_really_a_5(n),1))

tf = logical 0 str = '500000' l = 6 l2 = 6 str2 = 48 48 48 48 48 48 str2 = 53 48 48 48 48 48 str2 = 53 48 48 48 48 48 str = 53 48 48 48 48 48 tf = logical 1

25   Pass
n = 5000000; %5,000,000 assert(isequal(is_it_really_a_5(n),1))

tf = logical 0 str = '5000000' l = 7 l2 = 9 str2 = 48 48 48 48 48 48 48 48 48 str2 = 48 48 53 48 48 48 48 48 48 str2 = 48 48 53 48 48 48 48 48 48 str = 48 48 48 48 48 48 53 48 48 tf = logical 1

26   Pass
n = 15000000; %15,000,000 assert(isequal(is_it_really_a_5(n),0))

tf = logical 0 str = '15000000' l = 8 l2 = 9 str2 = 48 48 48 48 48 48 48 48 48 str2 = 48 49 53 48 48 48 48 48 48 str2 = 48 49 53 48 48 48 48 48 48 str2 = 48 49 48 48 48 48 48 48 48 str = 48 48 48 49 48 48 48 48 48

27   Pass
n = 50000000; %50,000,000 assert(isequal(is_it_really_a_5(n),0))

tf = logical 0 str = '50000000' l = 8 l2 = 9 str2 = 48 48 48 48 48 48 48 48 48 str2 = 48 53 48 48 48 48 48 48 48 str2 = 48 53 48 48 48 48 48 48 48 str2 = 48 48 48 48 48 48 48 48 48 str = 48 48 48 48 48 48 48 48 48

28   Pass
n = 105000000; %105,000,000 assert(isequal(is_it_really_a_5(n),1))

tf = logical 0 str = '105000000' l = 9 l2 = 9 str2 = 48 48 48 48 48 48 48 48 48 str2 = 49 48 53 48 48 48 48 48 48 str2 = 49 48 53 48 48 48 48 48 48 str = 49 48 48 48 48 48 53 48 48 tf = logical 1

29   Pass
n = 50050050; %50,050,050 assert(isequal(is_it_really_a_5(n),0))

tf = logical 0 str = '50050050' l = 8 l2 = 9 str2 = 48 48 48 48 48 48 48 48 48 str2 = 48 53 48 48 53 48 48 53 48 str2 = 48 53 48 48 53 48 48 53 48 str2 = 48 48 48 48 53 48 48 53 48 str2 = 48 48 48 48 48 48 48 53 48 str2 = 48 48 48 48 48 48 48 48 48 str = 48 48 48 48 48 48 48 48 48

30   Pass
n = 50000005; %50,000,005 assert(isequal(is_it_really_a_5(n),1))

tf = logical 0 str = '50000005' l = 8 l2 = 9 str2 = 48 48 48 48 48 48 48 48 48 str2 = 48 53 48 48 48 48 48 48 53 str2 = 48 53 48 48 48 48 48 48 53 str2 = 48 48 48 48 48 48 48 48 53 str = 48 48 48 48 48 48 48 48 53 tf = logical 1

31   Pass
n = 50000015; %50,000,015 assert(isequal(is_it_really_a_5(n),0))

tf = logical 0 str = '50000015' l = 8 l2 = 9 str2 = 48 48 48 48 48 48 48 48 48 str2 = 48 53 48 48 48 48 48 49 53 str2 = 48 53 48 48 48 48 48 49 53 str2 = 48 48 48 48 48 48 48 49 53 str2 = 48 48 48 48 48 48 48 49 48 str = 48 48 48 48 48 49 48 48 48

32   Pass
n = 500000000; %500,000,000 assert(isequal(is_it_really_a_5(n),1))

tf = logical 0 str = '500000000' l = 9 l2 = 9 str2 = 48 48 48 48 48 48 48 48 48 str2 = 53 48 48 48 48 48 48 48 48 str2 = 53 48 48 48 48 48 48 48 48 str = 53 48 48 48 48 48 48 48 48 tf = logical 1

33   Pass
n = 5000000000; %5,000,000,000 assert(isequal(is_it_really_a_5(n),1))

tf = logical 0 str = '5000000000' l = 10 l2 = 12 str2 = 48 48 48 48 48 48 48 48 48 48 48 48 str2 = 48 48 53 48 48 48 48 48 48 48 48 48 str2 = 48 48 53 48 48 48 48 48 48 48 48 48 str = 48 48 48 48 48 48 48 48 53 48 48 48 tf = logical 1

34   Pass
n = 50000000000; %50,000,000,000 assert(isequal(is_it_really_a_5(n),0))

tf = logical 0 str = '50000000000' l = 11 l2 = 12 str2 = 48 48 48 48 48 48 48 48 48 48 48 48 str2 = 48 53 48 48 48 48 48 48 48 48 48 48 str2 = 48 53 48 48 48 48 48 48 48 48 48 48 str2 = 48 48 48 48 48 48 48 48 48 48 48 48 str = 48 48 48 48 48 48 48 48 48 48 48 48

### Community Treasure Hunt

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

Start Hunting!