Cody

Problem 44310. Digit concentration in Champernowne's constant

Solution 1329606

Submitted on 6 Nov 2017 by Anselm Karl
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
d = 1; x = 1; y_correct = 1; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

d_reamin: 1 Teilblock. d_reamin: 0 Z: 1 Y: 1. part_count: 1 recent number: 1

2   Pass
d = 10; x = 5; y_correct = 0.1000; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

d_reamin: 10 Ganzer Block. d_reamin: 1 Z: 9 Y: 9. part_count: 1 recent number: 9

3   Pass
d = 10; x = 1; y_correct = 0.2000; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

d_reamin: 10 Ganzer Block. d_reamin: 1 Z: 9 Y: 9. part_count: 1 recent number: 9

4   Pass
d = 20; x = 9; y_correct = 0.0500; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

d_reamin: 20 Ganzer Block. d_reamin: 11 Z: 9 Y: 9. part_count: 1 recent number: 9 Teilblock. d_reamin: 9 Z: 1 Y: 2. part_count: 0 recent number: 10 Teilblock. d_reamin: 7 Z: 1 Y: 2. part_count: 0 recent number: 11 Teilblock. d_reamin: 5 Z: 1 Y: 2. part_count: 0 recent number: 12 Teilblock. d_reamin: 3 Z: 1 Y: 2. part_count: 0 recent number: 13 Teilblock. d_reamin: 1 Z: 1 Y: 2. part_count: 0 recent number: 14

5   Pass
d = 50; x = 0; y_correct = 0.0400; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

d_reamin: 50 Ganzer Block. d_reamin: 41 Z: 9 Y: 9. part_count: 0 recent number: 9 Teilblock. d_reamin: 21 Z: 10 Y: 20. part_count: 1 recent number: 19 Teilblock. d_reamin: 1 Z: 10 Y: 20. part_count: 1 recent number: 29

6   Pass
d = 50; x = 2; y_correct = 0.2600; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

d_reamin: 50 Ganzer Block. d_reamin: 41 Z: 9 Y: 9. part_count: 1 recent number: 9 Teilblock. d_reamin: 21 Z: 10 Y: 20. part_count: 1 recent number: 19 Teilblock. d_reamin: 1 Z: 10 Y: 20. part_count: 11 recent number: 29

7   Pass
d = 1000; x = 9; y_correct = 0.0670; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

d_reamin: 1000 Ganzer Block. d_reamin: 991 Z: 9 Y: 9. part_count: 1 recent number: 9 Ganzer Block. d_reamin: 811 Z: 90 Y: 180. part_count: 19 recent number: 99 Teilblock. d_reamin: 511 Z: 100 Y: 300. part_count: 20 recent number: 199 Teilblock. d_reamin: 211 Z: 100 Y: 300. part_count: 20 recent number: 299 Teilblock. d_reamin: 181 Z: 10 Y: 30. part_count: 1 recent number: 309 Teilblock. d_reamin: 151 Z: 10 Y: 30. part_count: 1 recent number: 319 Teilblock. d_reamin: 121 Z: 10 Y: 30. part_count: 1 recent number: 329 Teilblock. d_reamin: 91 Z: 10 Y: 30. part_count: 1 recent number: 339 Teilblock. d_reamin: 61 Z: 10 Y: 30. part_count: 1 recent number: 349 Teilblock. d_reamin: 31 Z: 10 Y: 30. part_count: 1 recent number: 359 Teilblock. d_reamin: 1 Z: 10 Y: 30. part_count: 1 recent number: 369

8   Pass
d = 1e4; x = 8; y_correct = 0.0747; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

d_reamin: 10000 Ganzer Block. d_reamin: 9991 Z: 9 Y: 9. part_count: 1 recent number: 9 Ganzer Block. d_reamin: 9811 Z: 90 Y: 180. part_count: 19 recent number: 99 Ganzer Block. d_reamin: 7111 Z: 900 Y: 2700. part_count: 280 recent number: 999 Teilblock. d_reamin: 3111 Z: 1000 Y: 4000. part_count: 300 recent number: 1999 Teilblock. d_reamin: 2711 Z: 100 Y: 400. part_count: 20 recent number: 2099 Teilblock. d_reamin: 2311 Z: 100 Y: 400. part_count: 20 recent number: 2199 Teilblock. d_reamin: 1911 Z: 100 Y: 400. part_count: 20 recent number: 2299 Teilblock. d_reamin: 1511 Z: 100 Y: 400. part_count: 20 recent number: 2399 Teilblock. d_reamin: 1111 Z: 100 Y: 400. part_count: 20 recent number: 2499 Teilblock. d_reamin: 711 Z: 100 Y: 400. part_count: 20 recent number: 2599 Teilblock. d_reamin: 311 Z: 100 Y: 400. part_count: 20 recent number: 2699 Teilblock. d_reamin: 271 Z: 10 Y: 40. part_count: 1 recent number: 2709 Teilblock. d_reamin: 231 Z: 10 Y: 40. part_count: 1 recent number: 2719 Teilblock. d_reamin: 191 Z: 10 Y: 40. part_count: 1 recent number: 2729 Teilblock. d_reamin: 151 Z: 10 Y: 40. part_count: 1 recent number: 2739 Teilblock. d_reamin: 111 Z: 10 Y: 40. part_count: 1 recent number: 2749 Teilblock. d_reamin: 71 Z: 10 Y: 40. part_count: 1 recent number: 2759 Teilblock. d_reamin: 31 Z: 10 Y: 40. part_count: 1 recent number: 2769 Teilblock. d_reamin: 27 Z: 1 Y: 4. part_count: 0 recent number: 2770 Teilblock. d_reamin: 23 Z: 1 Y: 4. part_count: 0 recent number: 2771 Teilblock. d_reamin: 19 Z: 1 Y: 4. part_count: 0 recent number: 2772 Teilblock. d_reamin: 15 Z: 1 Y: 4. part_count: 0 recent number: 2773 Teilblock. d_reamin: 11 Z: 1 Y: 4. part_count: 0 recent number: 2774 Teilblock. d_reamin: 7 Z: 1 Y: 4. part_count: 0 recent number: 2775 Teilblock. d_reamin: 3 Z: 1 Y: 4. part_count: 0 recent number: 2776

9   Pass
d = 1e5; x = 7; y_correct = 0.0864; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

d_reamin: 100000 Ganzer Block. d_reamin: 99991 Z: 9 Y: 9. part_count: 1 recent number: 9 Ganzer Block. d_reamin: 99811 Z: 90 Y: 180. part_count: 19 recent number: 99 Ganzer Block. d_reamin: 97111 Z: 900 Y: 2700. part_count: 280 recent number: 999 Ganzer Block. d_reamin: 61111 Z: 9000 Y: 36000. part_count: 3700 recent number: 9999 Teilblock. d_reamin: 11111 Z: 10000 Y: 50000. part_count: 4000 recent number: 19999 Teilblock. d_reamin: 6111 Z: 1000 Y: 5000. part_count: 300 recent number: 20999 Teilblock. d_reamin: 1111 Z: 1000 Y: 5000. part_count: 300 recent number: 21999 Teilblock. d_reamin: 611 Z: 100 Y: 500. part_count: 20 recent number: 22099 Teilblock. d_reamin: 111 Z: 100 Y: 500. part_count: 20 recent number: 22199 Teilblock. d_reamin: 61 Z: 10 Y: 50. part_count: 1 recent number: 22209 Teilblock. d_reamin: 11 Z: 10 Y: 50. part_count: 1 recent number: 22219 Teilblock. d_reamin: 6 Z: 1 Y: 5. part_count: 0 recent number: 22220 Teilblock. d_reamin: 1 Z: 1 Y: 5. part_count: 0 recent number: 22221

10   Pass
d = 1e6; x = 6; y_correct = 0.0935; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

d_reamin: 1000000 Ganzer Block. d_reamin: 999991 Z: 9 Y: 9. part_count: 1 recent number: 9 Ganzer Block. d_reamin: 999811 Z: 90 Y: 180. part_count: 19 recent number: 99 Ganzer Block. d_reamin: 997111 Z: 900 Y: 2700. part_count: 280 recent number: 999 Ganzer Block. d_reamin: 961111 Z: 9000 Y: 36000. part_count: 3700 recent number: 9999 Ganzer Block. d_reamin: 511111 Z: 90000 Y: 450000. part_count: 46000 recent number: 99999 Teilblock. d_reamin: 451111 Z: 10000 Y: 60000. part_count: 4000 recent number: 109999 Teilblock. d_reamin: 391111 Z: 10000 Y: 60000. part_count: 4000 recent number: 119999 Teilblock. d_reamin: 331111 Z: 10000 Y: 60000. part_count: 4000 recent number: 129999 Teilblock. d_reamin: 271111 Z: 10000 Y: 60000. part_count: 4000 recent number: 139999 Teilblock. d_reamin: 211111 Z: 10000 Y: 60000. part_count: 4000 recent number: 149999 Teilblock. d_reamin: 151111 Z: 10000 Y: 60000. part_count: 4000 recent number: 159999 Teilblock. d_reamin: 91111 Z: 10000 Y: 60000. part_count: 14000 recent number: 169999 Teilblock. d_reamin: 31111 Z: 10000 Y: 60000. part_count: 4000 recent number: 179999 Teilblock. d_reamin: 25111 Z: 1000 Y: 6000. part_count: 300 recent number: 180999 Teilblock. d_reamin: 19111 Z: 1000 Y: 6000. part_count: 300 recent number: 181999 Teilblock. d_reamin: 13111 Z: 1000 Y: 6000. part_count: 300 recent number: 182999 Teilblock. d_reamin: 7111 Z: 1000 Y: 6000. part_count: 300 recent number: 183999 Teilblock. d_reamin: 1111 Z: 1000 Y: 6000. part_count: 300 recent number: 184999 Teilblock. d_reamin: 511 Z: 100 Y: 600. part_count: 20 recent number: 185099 Teilblock. d_reamin: 451 Z: 10 Y: 60. part_count: 1 recent number: 185109 Teilblock. d_reamin: 391 Z: 10 Y: 60. part_count: 1 recent number: 185119 Teilblock. d_reamin: 331 Z: 10 Y: 60. part_count: 1 recent number: 185129 Teilblock. d_reamin: 271 Z: 10 Y: 60. part_count: 1 recent number: 185139 Teilblock. d_reamin: 211 Z: 10 Y: 60. part_count: 1 recent number: 185149 Teilblock. d_reamin: 151 Z: 10 Y: 60. part_count: 1 recent number: 185159 Teilblock. d_reamin: 91 Z: 10 Y: 60. part_count: 11 recent number: 185169 Teilblock. d_reamin: 31 Z: 10 Y: 60. part_count: 1 recent number: 185179 Teilblock. d_reamin: 25 Z: 1 Y: 6. part_count: 0 recent number: 185180 Teilblock. d_reamin: 19 Z: 1 Y: 6. part_count: 0 recent number: 185181 Teilblock. d_reamin: 13 Z: 1 Y: 6. part_count: 0 recent number: 185182 Teilblock. d_reamin: 7 Z: 1 Y: 6. part_count: 0 recent number: 185183 Teilblock. d_reamin: 1 Z: 1 Y: 6. part_count: 0 recent number: 185184

11   Pass
d = 1e6; x = 5; y_correct = 0.0937; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

d_reamin: 1000000 Ganzer Block. d_reamin: 999991 Z: 9 Y: 9. part_count: 1 recent number: 9 Ganzer Block. d_reamin: 999811 Z: 90 Y: 180. part_count: 19 recent number: 99 Ganzer Block. d_reamin: 997111 Z: 900 Y: 2700. part_count: 280 recent number: 999 Ganzer Block. d_reamin: 961111 Z: 9000 Y: 36000. part_count: 3700 recent number: 9999 Ganzer Block. d_reamin: 511111 Z: 90000 Y: 450000. part_count: 46000 recent number: 99999 Teilblock. d_reamin: 451111 Z: 10000 Y: 60000. part_count: 4000 recent number: 109999 Teilblock. d_reamin: 391111 Z: 10000 Y: 60000. part_count: 4000 recent number: 119999 Teilblock. d_reamin: 331111 Z: 10000 Y: 60000. part_count: 4000 recent number: 129999 Teilblock. d_reamin: 271111 Z: 10000 Y: 60000. part_count: 4000 recent number: 139999 Teilblock. d_reamin: 211111 Z: 10000 Y: 60000. part_count: 4000 recent number: 149999 Teilblock. d_reamin: 151111 Z: 10000 Y: 60000. part_count: 14000 recent number: 159999 Teilblock. d_reamin: 91111 Z: 10000 Y: 60000. part_count: 4000 recent number: 169999 Teilblock. d_reamin: 31111 Z: 10000 Y: 60000. part_count: 4000 recent number: 179999 Teilblock. d_reamin: 25111 Z: 1000 Y: 6000. part_count: 300 recent number: 180999 Teilblock. d_reamin: 19111 Z: 1000 Y: 6000. part_count: 300 recent number: 181999 Teilblock. d_reamin: 13111 Z: 1000 Y: 6000. part_count: 300 recent number: 182999 Teilblock. d_reamin: 7111 Z: 1000 Y: 6000. part_count: 300 recent number: 183999 Teilblock. d_reamin: 1111 Z: 1000 Y: 6000. part_count: 300 recent number: 184999 Teilblock. d_reamin: 511 Z: 100 Y: 600. part_count: 120 recent number: 185099 Teilblock. d_reamin: 451 Z: 10 Y: 60. part_count: 11 recent number: 185109 Teilblock. d_reamin: 391 Z: 10 Y: 60. part_count: 11 recent number: 185119 Teilblock. d_reamin: 331 Z: 10 Y: 60. part_count: 11 recent number: 185129 Teilblock. d_reamin: 271 Z: 10 Y: 60. part_count: 11 recent number: 185139 Teilblock. d_reamin: 211 Z: 10 Y: 60. part_count: 11 recent number: 185149 Teilblock. d_reamin: 151 Z: 10 Y: 60. part_count: 21 recent number: 185159 Teilblock. d_reamin: 91 Z: 10 Y: 60. part_count: 11 recent number: 185169 Teilblock. d_reamin: 31 Z: 10 Y: 60. part_count: 11 recent number: 185179 Teilblock. d_reamin: 25 Z: 1 Y: 6. part_count: 1 recent number: 185180 Teilblock. d_reamin: 19 Z: 1 Y: 6. part_count: 1 recent number: 185181 Teilblock. d_reamin: 13 Z: 1 Y: 6. part_count: 1 recent number: 185182 Teilblock. d_reamin: 7 Z: 1 Y: 6. part_count: 1 recent number: 185183 Teilblock. d_reamin: 1 Z: 1 Y: 6. part_count: 1 recent number: 185184

12   Pass
d = 2e6; x = 4; y_correct = 0.0903; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

d_reamin: 2000000 Ganzer Block. d_reamin: 1999991 Z: 9 Y: 9. part_count: 1 recent number: 9 Ganzer Block. d_reamin: 1999811 Z: 90 Y: 180. part_count: 19 recent number: 99 Ganzer Block. d_reamin: 1997111 Z: 900 Y: 2700. part_count: 280 recent number: 999 Ganzer Block. d_reamin: 1961111 Z: 9000 Y: 36000. part_count: 3700 recent number: 9999 Ganzer Block. d_reamin: 1511111 Z: 90000 Y: 450000. part_count: 46000 recent number: 99999 Teilblock. d_reamin: 911111 Z: 100000 Y: 600000. part_count: 50000 recent number: 199999 Teilblock. d_reamin: 311111 Z: 100000 Y: 600000. part_count: 50000 recent number: 299999 Teilblock. d_reamin: 251111 Z: 10000 Y: 60000. part_count: 4000 recent number: 309999 Teilblock. d_reamin: 191111 Z: 10000 Y: 60000. part_count: 4000 recent number: 319999 Teilblock. d_reamin: 131111 Z: 10000 Y: 60000. part_count: 4000 recent number: 329999 Teilblock. d_reamin: 71111 Z: 10000 Y: 60000. part_count: 4000 recent number: 339999 Teilblock. d_reamin: 11111 Z: 10000 Y: 60000. part_count: 14000 recent number: 349999 Teilblock. d_reamin: 5111 Z: 1000 Y: 6000. part_count: 300 recent number: 350999 Teilblock. d_reamin: 4511 Z: 100 Y: 600. part_count: 20 recent number: 351099 Teilblock. d_reamin: 3911 Z: 100 Y: 600. part_count: 20 recent number: 351199 Teilblock. d_reamin: 3311 Z: 100 Y: 600. part_count: 20 recent number: 351299 Teilblock. d_reamin: 2711 Z: 100 Y: 600. part_count: 20 recent number: 351399 Teilblock. d_reamin: 2111 Z: 100 Y: 600. part_count: 120 recent number: 351499 Teilblock. d_reamin: 1511 Z: 100 Y: 600. part_count: 20 recent number: 351599 Teilblock. d_reamin: 911 Z: 100 Y: 600. part_count: 20 recent number: 351699 Teilblock. d_reamin: 311 Z: 100 Y: 600. part_count: 20 recent number: 351799 Teilblock. d_reamin: 251 Z: 10 Y: 60. part_count: 1 recent number: 351809 Teilblock. d_reamin: 191 Z: 10 Y: 60. part_count: 1 recent number: 351819 Teilblock. d_reamin: 131 Z: 10 Y: 60. part_count: 1 recent number: 351829 Teilblock. d_reamin: 71 Z: 10 Y: 60. part_count: 1 recent number: 351839 Teilblock. d_reamin: 11 Z: 10 Y: 60. part_count: 11 recent number: 351849 Teilblock. d_reamin: 5 Z: 1 Y: 6. part_count: 0 recent number: 351850

13   Pass
d = 2000124; x = 3; y_correct = 0.1162; assert(abs(digitCon(d,x)-y_correct) < 1e-4)

d_reamin: 2000124 Ganzer Block. d_reamin: 2000115 Z: 9 Y: 9. part_count: 1 recent number: 9 Ganzer Block. d_reamin: 1999935 Z: 90 Y: 180. part_count: 19 recent number: 99 Ganzer Block. d_reamin: 1997235 Z: 900 Y: 2700. part_count: 280 recent number: 999 Ganzer Block. d_reamin: 1961235 Z: 9000 Y: 36000. part_count: 3700 recent number: 9999 Ganzer Block. d_reamin: 1511235 Z: 90000 Y: 450000. part_count: 46000 recent number: 99999 Teilblock. d_reamin: 911235 Z: 100000 Y: 600000. part_count: 50000 recent number: 199999 Teilblock. d_reamin: 311235 Z: 100000 Y: 600000. part_count: 50000 recent number: 299999 Teilblock. d_reamin: 251235 Z: 10000 Y: 60000. part_count: 14000 recent number: 309999 Teilblock. d_reamin: 191235 Z: 10000 Y: 60000. part_count: 14000 recent number: 319999 Teilblock. d_reamin: 131235 Z: 10000 Y: 60000. part_count: 14000 recent number: 329999 Teilblock. d_reamin: 71235 Z: 10000 Y: 60000. part_count: 24000 recent number: 339999 Teilblock. d_reamin: 11235 Z: 10000 Y: 60000. part_count: 14000 recent number: 349999 Teilblock. d_reamin: 5235 Z: 1000 Y: 6000. part_count: 1300 recent number: 350999 Teilblock. d_reamin: 4635 Z: 100 Y: 600. part_count: 120 recent number: 351099 Teilblock. d_reamin: 4035 Z: 100 Y: 600. part_count: 120 recent number: 351199 Teilblock. d_reamin: 3435 Z: 100 Y: 600. part_count: 120 recent number: 351299 Teilblock. d_reamin: 2835 Z: 100 Y: 600. part_count: 220 recent number: 351399 Teilblock. d_reamin: 2235 Z: 100 Y: 600. part_count: 120 recent number: 351499 Teilblock. d_reamin: 1635 Z: 100 Y: 600. part_count: 120 recent number: 351599 Teilblock. d_reamin: 1035 Z: 100 Y: 600. part_count: 120 recent number: 351699 Teilblock. d_reamin: 435 Z: 100 Y: 600. part_count: 120 recent number: 351799 Teilblock. d_reamin: 375 Z: 10 Y: 60. part_count: 11 recent number: 351809 Teilblock. d_reamin: 315 Z: 10 Y: 60. part_count: 11 recent number: 351819 Teilblock. d_reamin: 255 Z: 10 Y: 60. part_count: 11 recent number: 351829 Teilblock. d_reamin: 195 Z: 10 Y: 60. part_count: 21 recent number: 351839 Teilblock. d_reamin: 135 Z: 10 Y: 60. part_count: 11 recent number: 351849 Teilblock. d_reamin: 75 Z: 10 Y: 60. part_count: 11 recent number: 351859 Teilblock. d_reamin: 15 Z: 10 Y: 60. part_count: 11 recent number: 351869 Teilblock. d_reamin: 9 Z: 1 Y: 6. part_count: 1 recent number: 351870 Teilblock. d_reamin: 3 Z: 1 Y: 6. part_count: 1 recent number: 351871

Suggested Problems

More from this Author62

Community Treasure Hunt

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

Start Hunting!