#include
<
stdio.h
>
#define
NUMBER 12000
int
getCount(
int
nInput)
{
int
nCount
=
0
;
for
(
int
i
=
1
; i
<=
NUMBER; i
++
)
{
int
nNum
=
i;
while
(nNum
!=
0
)
{
if
( (nNum
%
10
)
==
1
)
nCount
++
;
nNum
/=
10
;
}
}
return
nCount;
}
int
main(
void
)
{
for
(
int
i
=
1
; i
<=
NUMBER; i
++
)
{
printf(
"
%d
"
, i);
}
printf(
"
\n
"
);
printf(
"
getCount = %d\n
"
, getCount(NUMBER));
return
0
;
}
O(n) = n^2
#include <stdio.h>
#include <stdlib.h>
#define NUMBER 30
int getCount(int nInput)
{
int nCount = 0;
for( int i=1; i<=NUMBER; i++ )
{
int nNum = i;
while(nNum != 0)
{
if( (nNum%10) == 1 )
nCount++;
nNum /= 10;
}
}
return nCount;
}
int main(void)
{
for( int i=1; i<=NUMBER; i++ )
{
printf("%d ", i);
char szResult[25] = {0};
itoa(i, szResult, 2);
printf("%s \n", szResult);
}
printf("\n");
printf("getCount = %d\n", getCount(NUMBER));
return 0;
}
归纳法分析: '个位' 与 '十位' 出现 '1' 的次数进行分析
1. 当 N < 10 时,在'个位'出现的次数为 1,即 F(N) = 1
2. 当 N >= 10 且 N <= 99 时
假设 N = 15,
1). 1至15中,所有数'个位'上出现的次数为 2,分别是 1、11
2). 1至15中,所有数'十位'上出现的次数为 6,分别是 10、11、12、13、14、15
故 当 N = 15时,F(N) = 2 + 6 = 8
假设 N = 68,
1). '个位'上出现的次数为7,分别是 1、11、21、31、41、51、61
1). '十位'上出现的次数为10,分别是 10、11、12、13、14、15、16、17、18、19
68 (7,10) = 17
故 当 N = 68时,F(N) = 7 + 10 = 17
3. 按以上原理,推广到百位时
975 (98,100,100) = 298
推理过程相关程序
void printCount(int nNum)
{
int nNum1Count = 0;
int nNum2Count = 0;
int nNum3Count = 0;
for( int i=1; i<=nNum; i++ )
{
int nNum1 = 0;
nNum1 = i%10;
if( nNum1 == 1 )
{
nNum1Count++;
//printf("%d、", i);
}
}
//printf("\n");
for( int j=1; j<=nNum; j++ )
{
int nNum2 = 0;
nNum2 = (j/10)%10;
if( nNum2 == 1 )
{
nNum2Count++;
//printf("%d、", j);
}
}
//printf("\n");
for( int k=1; k<=nNum; k++ )
{
int nNum3 = 0;
nNum3 = k/100;
if( nNum3 == 1 )
{
nNum3Count++;
//printf("%d、", k);
}
}
//printf("\n");
printf("F(%d) = %d (%d,%d,%d) = %d\n", nNum, nNum, nNum3Count, nNum2Count, nNum1Count, nNum1Count+nNum2Count+nNum3Count);
}
1至999,百位,十位,个数 1出现的次数
F(1) = 1 (0,0,1) = 1
F(2) = 2 (0,0,1) = 1
F(3) = 3 (0,0,1) = 1
F(4) = 4 (0,0,1) = 1
F(5) = 5 (0,0,1) = 1
F(6) = 6 (0,0,1) = 1
F(7) = 7 (0,0,1) = 1
F(8) = 8 (0,0,1) = 1
F(9) = 9 (0,0,1) = 1
F(10) = 10 (0,1,1) = 2
F(11) = 11 (0,2,2) = 4
F(12) = 12 (0,3,2) = 5
F(13) = 13 (0,4,2) = 6
F(14) = 14 (0,5,2) = 7
F(15) = 15 (0,6,2) = 8
F(16) = 16 (0,7,2) = 9
F(17) = 17 (0,8,2) = 10
F(18) = 18 (0,9,2) = 11
F(19) = 19 (0,10,2) = 12
F(20) = 20 (0,10,2) = 12
F(21) = 21 (0,10,3) = 13
F(22) = 22 (0,10,3) = 13
F(23) = 23 (0,10,3) = 13
F(24) = 24 (0,10,3) = 13
F(25) = 25 (0,10,3) = 13
F(26) = 26 (0,10,3) = 13
F(27) = 27 (0,10,3) = 13
F(28) = 28 (0,10,3) = 13
F(29) = 29 (0,10,3) = 13
F(30) = 30 (0,10,3) = 13
F(31) = 31 (0,10,4) = 14
F(32) = 32 (0,10,4) = 14
F(33) = 33 (0,10,4) = 14
F(34) = 34 (0,10,4) = 14
F(35) = 35 (0,10,4) = 14
F(36) = 36 (0,10,4) = 14
F(37) = 37 (0,10,4) = 14
F(38) = 38 (0,10,4) = 14
F(39) = 39 (0,10,4) = 14
F(40) = 40 (0,10,4) = 14
F(41) = 41 (0,10,5) = 15
F(42) = 42 (0,10,5) = 15
F(43) = 43 (0,10,5) = 15
F(44) = 44 (0,10,5) = 15
F(45) = 45 (0,10,5) = 15
F(46) = 46 (0,10,5) = 15
F(47) = 47 (0,10,5) = 15
F(48) = 48 (0,10,5) = 15
F(49) = 49 (0,10,5) = 15
F(50) = 50 (0,10,5) = 15
F(51) = 51 (0,10,6) = 16
F(52) = 52 (0,10,6) = 16
F(53) = 53 (0,10,6) = 16
F(54) = 54 (0,10,6) = 16
F(55) = 55 (0,10,6) = 16
F(56) = 56 (0,10,6) = 16
F(57) = 57 (0,10,6) = 16
F(58) = 58 (0,10,6) = 16
F(59) = 59 (0,10,6) = 16
F(60) = 60 (0,10,6) = 16
F(61) = 61 (0,10,7) = 17
F(62) = 62 (0,10,7) = 17
F(63) = 63 (0,10,7) = 17
F(64) = 64 (0,10,7) = 17
F(65) = 65 (0,10,7) = 17
F(66) = 66 (0,10,7) = 17
F(67) = 67 (0,10,7) = 17
F(68) = 68 (0,10,7) = 17
F(69) = 69 (0,10,7) = 17
F(70) = 70 (0,10,7) = 17
F(71) = 71 (0,10,8) = 18
F(72) = 72 (0,10,8) = 18
F(73) = 73 (0,10,8) = 18
F(74) = 74 (0,10,8) = 18
F(75) = 75 (0,10,8) = 18
F(76) = 76 (0,10,8) = 18
F(77) = 77 (0,10,8) = 18
F(78) = 78 (0,10,8) = 18
F(79) = 79 (0,10,8) = 18
F(80) = 80 (0,10,8) = 18
F(81) = 81 (0,10,9) = 19
F(82) = 82 (0,10,9) = 19
F(83) = 83 (0,10,9) = 19
F(84) = 84 (0,10,9) = 19
F(85) = 85 (0,10,9) = 19
F(86) = 86 (0,10,9) = 19
F(87) = 87 (0,10,9) = 19
F(88) = 88 (0,10,9) = 19
F(89) = 89 (0,10,9) = 19
F(90) = 90 (0,10,9) = 19
F(91) = 91 (0,10,10) = 20
F(92) = 92 (0,10,10) = 20
F(93) = 93 (0,10,10) = 20
F(94) = 94 (0,10,10) = 20
F(95) = 95 (0,10,10) = 20
F(96) = 96 (0,10,10) = 20
F(97) = 97 (0,10,10) = 20
F(98) = 98 (0,10,10) = 20
F(99) = 99 (0,10,10) = 20
F(100) = 100 (1,10,10) = 21
F(101) = 101 (2,10,11) = 23
F(102) = 102 (3,10,11) = 24
F(103) = 103 (4,10,11) = 25
F(104) = 104 (5,10,11) = 26
F(105) = 105 (6,10,11) = 27
F(106) = 106 (7,10,11) = 28
F(107) = 107 (8,10,11) = 29
F(108) = 108 (9,10,11) = 30
F(109) = 109 (10,10,11) = 31
F(110) = 110 (11,11,11) = 33
F(111) = 111 (12,12,12) = 36
F(112) = 112 (13,13,12) = 38
F(113) = 113 (14,14,12) = 40
F(114) = 114 (15,15,12) = 42
F(115) = 115 (16,16,12) = 44
F(116) = 116 (17,17,12) = 46
F(117) = 117 (18,18,12) = 48
F(118) = 118 (19,19,12) = 50
F(119) = 119 (20,20,12) = 52
F(120) = 120 (21,20,12) = 53
F(121) = 121 (22,20,13) = 55
F(122) = 122 (23,20,13) = 56
F(123) = 123 (24,20,13) = 57
F(124) = 124 (25,20,13) = 58
F(125) = 125 (26,20,13) = 59
F(126) = 126 (27,20,13) = 60
F(127) = 127 (28,20,13) = 61
F(128) = 128 (29,20,13) = 62
F(129) = 129 (30,20,13) = 63
F(130) = 130 (31,20,13) = 64
F(131) = 131 (32,20,14) = 66
F(132) = 132 (33,20,14) = 67
F(133) = 133 (34,20,14) = 68
F(134) = 134 (35,20,14) = 69
F(135) = 135 (36,20,14) = 70
F(136) = 136 (37,20,14) = 71
F(137) = 137 (38,20,14) = 72
F(138) = 138 (39,20,14) = 73
F(139) = 139 (40,20,14) = 74
F(140) = 140 (41,20,14) = 75
F(141) = 141 (42,20,15) = 77
F(142) = 142 (43,20,15) = 78
F(143) = 143 (44,20,15) = 79
F(144) = 144 (45,20,15) = 80
F(145) = 145 (46,20,15) = 81
F(146) = 146 (47,20,15) = 82
F(147) = 147 (48,20,15) = 83
F(148) = 148 (49,20,15) = 84
F(149) = 149 (50,20,15) = 85
F(150) = 150 (51,20,15) = 86
F(151) = 151 (52,20,16) = 88
F(152) = 152 (53,20,16) = 89
F(153) = 153 (54,20,16) = 90
F(154) = 154 (55,20,16) = 91
F(155) = 155 (56,20,16) = 92
F(156) = 156 (57,20,16) = 93
F(157) = 157 (58,20,16) = 94
F(158) = 158 (59,20,16) = 95
F(159) = 159 (60,20,16) = 96
F(160) = 160 (61,20,16) = 97
F(161) = 161 (62,20,17) = 99
F(162) = 162 (63,20,17) = 100
F(163) = 163 (64,20,17) = 101
F(164) = 164 (65,20,17) = 102
F(165) = 165 (66,20,17) = 103
F(166) = 166 (67,20,17) = 104
F(167) = 167 (68,20,17) = 105
F(168) = 168 (69,20,17) = 106
F(169) = 169 (70,20,17) = 107
F(170) = 170 (71,20,17) = 108
F(171) = 171 (72,20,18) = 110
F(172) = 172 (73,20,18) = 111
F(173) = 173 (74,20,18) = 112
F(174) = 174 (75,20,18) = 113
F(175) = 175 (76,20,18) = 114
F(176) = 176 (77,20,18) = 115
F(177) = 177 (78,20,18) = 116
F(178) = 178 (79,20,18) = 117
F(179) = 179 (80,20,18) = 118
F(180) = 180 (81,20,18) = 119
F(181) = 181 (82,20,19) = 121
F(182) = 182 (83,20,19) = 122
F(183) = 183 (84,20,19) = 123
F(184) = 184 (85,20,19) = 124
F(185) = 185 (86,20,19) = 125
F(186) = 186 (87,20,19) = 126
F(187) = 187 (88,20,19) = 127
F(188) = 188 (89,20,19) = 128
F(189) = 189 (90,20,19) = 129
F(190) = 190 (91,20,19) = 130
F(191) = 191 (92,20,20) = 132
F(192) = 192 (93,20,20) = 133
F(193) = 193 (94,20,20) = 134
F(194) = 194 (95,20,20) = 135
F(195) = 195 (96,20,20) = 136
F(196) = 196 (97,20,20) = 137
F(197) = 197 (98,20,20) = 138
F(198) = 198 (99,20,20) = 139
F(199) = 199 (100,20,20) = 140
F(200) = 200 (100,20,20) = 140
F(201) = 201 (100,20,21) = 141
F(202) = 202 (100,20,21) = 141
F(203) = 203 (100,20,21) = 141
F(204) = 204 (100,20,21) = 141
F(205) = 205 (100,20,21) = 141
F(206) = 206 (100,20,21) = 141
F(207) = 207 (100,20,21) = 141
F(208) = 208 (100,20,21) = 141
F(209) = 209 (100,20,21) = 141
F(210) = 210 (100,21,21) = 142
F(211) = 211 (100,22,22) = 144
F(212) = 212 (100,23,22) = 145
F(213) = 213 (100,24,22) = 146
F(214) = 214 (100,25,22) = 147
F(215) = 215 (100,26,22) = 148
F(216) = 216 (100,27,22) = 149
F(217) = 217 (100,28,22) = 150
F(218) = 218 (100,29,22) = 151
F(219) = 219 (100,30,22) = 152
F(220) = 220 (100,30,22) = 152
F(221) = 221 (100,30,23) = 153
F(222) = 222 (100,30,23) = 153
F(223) = 223 (100,30,23) = 153
F(224) = 224 (100,30,23) = 153
F(225) = 225 (100,30,23) = 153
F(226) = 226 (100,30,23) = 153
F(227) = 227 (100,30,23) = 153
F(228) = 228 (100,30,23) = 153
F(229) = 229 (100,30,23) = 153
F(230) = 230 (100,30,23) = 153
F(231) = 231 (100,30,24) = 154
F(232) = 232 (100,30,24) = 154
F(233) = 233 (100,30,24) = 154
F(234) = 234 (100,30,24) = 154
F(235) = 235 (100,30,24) = 154
F(236) = 236 (100,30,24) = 154
F(237) = 237 (100,30,24) = 154
F(238) = 238 (100,30,24) = 154
F(239) = 239 (100,30,24) = 154
F(240) = 240 (100,30,24) = 154
F(241) = 241 (100,30,25) = 155
F(242) = 242 (100,30,25) = 155
F(243) = 243 (100,30,25) = 155
F(244) = 244 (100,30,25) = 155
F(245) = 245 (100,30,25) = 155
F(246) = 246 (100,30,25) = 155
F(247) = 247 (100,30,25) = 155
F(248) = 248 (100,30,25) = 155
F(249) = 249 (100,30,25) = 155
F(250) = 250 (100,30,25) = 155
F(251) = 251 (100,30,26) = 156
F(252) = 252 (100,30,26) = 156
F(253) = 253 (100,30,26) = 156
F(254) = 254 (100,30,26) = 156
F(255) = 255 (100,30,26) = 156
F(256) = 256 (100,30,26) = 156
F(257) = 257 (100,30,26) = 156
F(258) = 258 (100,30,26) = 156
F(259) = 259 (100,30,26) = 156
F(260) = 260 (100,30,26) = 156
F(261) = 261 (100,30,27) = 157
F(262) = 262 (100,30,27) = 157
F(263) = 263 (100,30,27) = 157
F(264) = 264 (100,30,27) = 157
F(265) = 265 (100,30,27) = 157
F(266) = 266 (100,30,27) = 157
F(267) = 267 (100,30,27) = 157
F(268) = 268 (100,30,27) = 157
F(269) = 269 (100,30,27) = 157
F(270) = 270 (100,30,27) = 157
F(271) = 271 (100,30,28) = 158
F(272) = 272 (100,30,28) = 158
F(273) = 273 (100,30,28) = 158
F(274) = 274 (100,30,28) = 158
F(275) = 275 (100,30,28) = 158
F(276) = 276 (100,30,28) = 158
F(277) = 277 (100,30,28) = 158
F(278) = 278 (100,30,28) = 158
F(279) = 279 (100,30,28) = 158
F(280) = 280 (100,30,28) = 158
F(281) = 281 (100,30,29) = 159
F(282) = 282 (100,30,29) = 159
F(283) = 283 (100,30,29) = 159
F(284) = 284 (100,30,29) = 159
F(285) = 285 (100,30,29) = 159
F(286) = 286 (100,30,29) = 159
F(287) = 287 (100,30,29) = 159
F(288) = 288 (100,30,29) = 159
F(289) = 289 (100,30,29) = 159
F(290) = 290 (100,30,29) = 159
F(291) = 291 (100,30,30) = 160
F(292) = 292 (100,30,30) = 160
F(293) = 293 (100,30,30) = 160
F(294) = 294 (100,30,30) = 160
F(295) = 295 (100,30,30) = 160
F(296) = 296 (100,30,30) = 160
F(297) = 297 (100,30,30) = 160
F(298) = 298 (100,30,30) = 160
F(299) = 299 (100,30,30) = 160
F(300) = 300 (100,30,30) = 160
F(301) = 301 (100,30,31) = 161
F(302) = 302 (100,30,31) = 161
F(303) = 303 (100,30,31) = 161
F(304) = 304 (100,30,31) = 161
F(305) = 305 (100,30,31) = 161
F(306) = 306 (100,30,31) = 161
F(307) = 307 (100,30,31) = 161
F(308) = 308 (100,30,31) = 161
F(309) = 309 (100,30,31) = 161
F(310) = 310 (100,31,31) = 162
F(311) = 311 (100,32,32) = 164
F(312) = 312 (100,33,32) = 165
F(313) = 313 (100,34,32) = 166
F(314) = 314 (100,35,32) = 167
F(315) = 315 (100,36,32) = 168
F(316) = 316 (100,37,32) = 169
F(317) = 317 (100,38,32) = 170
F(318) = 318 (100,39,32) = 171
F(319) = 319 (100,40,32) = 172
F(320) = 320 (100,40,32) = 172
F(321) = 321 (100,40,33) = 173
F(322) = 322 (100,40,33) = 173
F(323) = 323 (100,40,33) = 173
F(324) = 324 (100,40,33) = 173
F(325) = 325 (100,40,33) = 173
F(326) = 326 (100,40,33) = 173
F(327) = 327 (100,40,33) = 173
F(328) = 328 (100,40,33) = 173
F(329) = 329 (100,40,33) = 173
F(330) = 330 (100,40,33) = 173
F(331) = 331 (100,40,34) = 174
F(332) = 332 (100,40,34) = 174
F(333) = 333 (100,40,34) = 174
F(334) = 334 (100,40,34) = 174
F(335) = 335 (100,40,34) = 174
F(336) = 336 (100,40,34) = 174
F(337) = 337 (100,40,34) = 174
F(338) = 338 (100,40,34) = 174
F(339) = 339 (100,40,34) = 174
F(340) = 340 (100,40,34) = 174
F(341) = 341 (100,40,35) = 175
F(342) = 342 (100,40,35) = 175
F(343) = 343 (100,40,35) = 175
F(344) = 344 (100,40,35) = 175
F(345) = 345 (100,40,35) = 175
F(346) = 346 (100,40,35) = 175
F(347) = 347 (100,40,35) = 175
F(348) = 348 (100,40,35) = 175
F(349) = 349 (100,40,35) = 175
F(350) = 350 (100,40,35) = 175
F(351) = 351 (100,40,36) = 176
F(352) = 352 (100,40,36) = 176
F(353) = 353 (100,40,36) = 176
F(354) = 354 (100,40,36) = 176
F(355) = 355 (100,40,36) = 176
F(356) = 356 (100,40,36) = 176
F(357) = 357 (100,40,36) = 176
F(358) = 358 (100,40,36) = 176
F(359) = 359 (100,40,36) = 176
F(360) = 360 (100,40,36) = 176
F(361) = 361 (100,40,37) = 177
F(362) = 362 (100,40,37) = 177
F(363) = 363 (100,40,37) = 177
F(364) = 364 (100,40,37) = 177
F(365) = 365 (100,40,37) = 177
F(366) = 366 (100,40,37) = 177
F(367) = 367 (100,40,37) = 177
F(368) = 368 (100,40,37) = 177
F(369) = 369 (100,40,37) = 177
F(370) = 370 (100,40,37) = 177
F(371) = 371 (100,40,38) = 178
F(372) = 372 (100,40,38) = 178
F(373) = 373 (100,40,38) = 178
F(374) = 374 (100,40,38) = 178
F(375) = 375 (100,40,38) = 178
F(376) = 376 (100,40,38) = 178
F(377) = 377 (100,40,38) = 178
F(378) = 378 (100,40,38) = 178
F(379) = 379 (100,40,38) = 178
F(380) = 380 (100,40,38) = 178
F(381) = 381 (100,40,39) = 179
F(382) = 382 (100,40,39) = 179
F(383) = 383 (100,40,39) = 179
F(384) = 384 (100,40,39) = 179
F(385) = 385 (100,40,39) = 179
F(386) = 386 (100,40,39) = 179
F(387) = 387 (100,40,39) = 179
F(388) = 388 (100,40,39) = 179
F(389) = 389 (100,40,39) = 179
F(390) = 390 (100,40,39) = 179
F(391) = 391 (100,40,40) = 180
F(392) = 392 (100,40,40) = 180
F(393) = 393 (100,40,40) = 180
F(394) = 394 (100,40,40) = 180
F(395) = 395 (100,40,40) = 180
F(396) = 396 (100,40,40) = 180
F(397) = 397 (100,40,40) = 180
F(398) = 398 (100,40,40) = 180
F(399) = 399 (100,40,40) = 180
F(400) = 400 (100,40,40) = 180
F(401) = 401 (100,40,41) = 181
F(402) = 402 (100,40,41) = 181
F(403) = 403 (100,40,41) = 181
F(404) = 404 (100,40,41) = 181
F(405) = 405 (100,40,41) = 181
F(406) = 406 (100,40,41) = 181
F(407) = 407 (100,40,41) = 181
F(408) = 408 (100,40,41) = 181
F(409) = 409 (100,40,41) = 181
F(410) = 410 (100,41,41) = 182
F(411) = 411 (100,42,42) = 184
F(412) = 412 (100,43,42) = 185
F(413) = 413 (100,44,42) = 186
F(414) = 414 (100,45,42) = 187
F(415) = 415 (100,46,42) = 188
F(416) = 416 (100,47,42) = 189
F(417) = 417 (100,48,42) = 190
F(418) = 418 (100,49,42) = 191
F(419) = 419 (100,50,42) = 192
F(420) = 420 (100,50,42) = 192
F(421) = 421 (100,50,43) = 193
F(422) = 422 (100,50,43) = 193
F(423) = 423 (100,50,43) = 193
F(424) = 424 (100,50,43) = 193
F(425) = 425 (100,50,43) = 193
F(426) = 426 (100,50,43) = 193
F(427) = 427 (100,50,43) = 193
F(428) = 428 (100,50,43) = 193
F(429) = 429 (100,50,43) = 193
F(430) = 430 (100,50,43) = 193
F(431) = 431 (100,50,44) = 194
F(432) = 432 (100,50,44) = 194
F(433) = 433 (100,50,44) = 194
F(434) = 434 (100,50,44) = 194
F(435) = 435 (100,50,44) = 194
F(436) = 436 (100,50,44) = 194
F(437) = 437 (100,50,44) = 194
F(438) = 438 (100,50,44) = 194
F(439) = 439 (100,50,44) = 194
F(440) = 440 (100,50,44) = 194
F(441) = 441 (100,50,45) = 195
F(442) = 442 (100,50,45) = 195
F(443) = 443 (100,50,45) = 195
F(444) = 444 (100,50,45) = 195
F(445) = 445 (100,50,45) = 195
F(446) = 446 (100,50,45) = 195
F(447) = 447 (100,50,45) = 195
F(448) = 448 (100,50,45) = 195
F(449) = 449 (100,50,45) = 195
F(450) = 450 (100,50,45) = 195
F(451) = 451 (100,50,46) = 196
F(452) = 452 (100,50,46) = 196
F(453) = 453 (100,50,46) = 196
F(454) = 454 (100,50,46) = 196
F(455) = 455 (100,50,46) = 196
F(456) = 456 (100,50,46) = 196
F(457) = 457 (100,50,46) = 196
F(458) = 458 (100,50,46) = 196
F(459) = 459 (100,50,46) = 196
F(460) = 460 (100,50,46) = 196
F(461) = 461 (100,50,47) = 197
F(462) = 462 (100,50,47) = 197
F(463) = 463 (100,50,47) = 197
F(464) = 464 (100,50,47) = 197
F(465) = 465 (100,50,47) = 197
F(466) = 466 (100,50,47) = 197
F(467) = 467 (100,50,47) = 197
F(468) = 468 (100,50,47) = 197
F(469) = 469 (100,50,47) = 197
F(470) = 470 (100,50,47) = 197
F(471) = 471 (100,50,48) = 198
F(472) = 472 (100,50,48) = 198
F(473) = 473 (100,50,48) = 198
F(474) = 474 (100,50,48) = 198
F(475) = 475 (100,50,48) = 198
F(476) = 476 (100,50,48) = 198
F(477) = 477 (100,50,48) = 198
F(478) = 478 (100,50,48) = 198
F(479) = 479 (100,50,48) = 198
F(480) = 480 (100,50,48) = 198
F(481) = 481 (100,50,49) = 199
F(482) = 482 (100,50,49) = 199
F(483) = 483 (100,50,49) = 199
F(484) = 484 (100,50,49) = 199
F(485) = 485 (100,50,49) = 199
F(486) = 486 (100,50,49) = 199
F(487) = 487 (100,50,49) = 199
F(488) = 488 (100,50,49) = 199
F(489) = 489 (100,50,49) = 199
F(490) = 490 (100,50,49) = 199
F(491) = 491 (100,50,50) = 200
F(492) = 492 (100,50,50) = 200
F(493) = 493 (100,50,50) = 200
F(494) = 494 (100,50,50) = 200
F(495) = 495 (100,50,50) = 200
F(496) = 496 (100,50,50) = 200
F(497) = 497 (100,50,50) = 200
F(498) = 498 (100,50,50) = 200
F(499) = 499 (100,50,50) = 200
F(500) = 500 (100,50,50) = 200
F(501) = 501 (100,50,51) = 201
F(502) = 502 (100,50,51) = 201
F(503) = 503 (100,50,51) = 201
F(504) = 504 (100,50,51) = 201
F(505) = 505 (100,50,51) = 201
F(506) = 506 (100,50,51) = 201
F(507) = 507 (100,50,51) = 201
F(508) = 508 (100,50,51) = 201
F(509) = 509 (100,50,51) = 201
F(510) = 510 (100,51,51) = 202
F(511) = 511 (100,52,52) = 204
F(512) = 512 (100,53,52) = 205
F(513) = 513 (100,54,52) = 206
F(514) = 514 (100,55,52) = 207
F(515) = 515 (100,56,52) = 208
F(516) = 516 (100,57,52) = 209
F(517) = 517 (100,58,52) = 210
F(518) = 518 (100,59,52) = 211
F(519) = 519 (100,60,52) = 212
F(520) = 520 (100,60,52) = 212
F(521) = 521 (100,60,53) = 213
F(522) = 522 (100,60,53) = 213
F(523) = 523 (100,60,53) = 213
F(524) = 524 (100,60,53) = 213
F(525) = 525 (100,60,53) = 213
F(526) = 526 (100,60,53) = 213
F(527) = 527 (100,60,53) = 213
F(528) = 528 (100,60,53) = 213
F(529) = 529 (100,60,53) = 213
F(530) = 530 (100,60,53) = 213
F(531) = 531 (100,60,54) = 214
F(532) = 532 (100,60,54) = 214
F(533) = 533 (100,60,54) = 214
F(534) = 534 (100,60,54) = 214
F(535) = 535 (100,60,54) = 214
F(536) = 536 (100,60,54) = 214
F(537) = 537 (100,60,54) = 214
F(538) = 538 (100,60,54) = 214
F(539) = 539 (100,60,54) = 214
F(540) = 540 (100,60,54) = 214
F(541) = 541 (100,60,55) = 215
F(542) = 542 (100,60,55) = 215
F(543) = 543 (100,60,55) = 215
F(544) = 544 (100,60,55) = 215
F(545) = 545 (100,60,55) = 215
F(546) = 546 (100,60,55) = 215
F(547) = 547 (100,60,55) = 215
F(548) = 548 (100,60,55) = 215
F(549) = 549 (100,60,55) = 215
F(550) = 550 (100,60,55) = 215
F(551) = 551 (100,60,56) = 216
F(552) = 552 (100,60,56) = 216
F(553) = 553 (100,60,56) = 216
F(554) = 554 (100,60,56) = 216
F(555) = 555 (100,60,56) = 216
F(556) = 556 (100,60,56) = 216
F(557) = 557 (100,60,56) = 216
F(558) = 558 (100,60,56) = 216
F(559) = 559 (100,60,56) = 216
F(560) = 560 (100,60,56) = 216
F(561) = 561 (100,60,57) = 217
F(562) = 562 (100,60,57) = 217
F(563) = 563 (100,60,57) = 217
F(564) = 564 (100,60,57) = 217
F(565) = 565 (100,60,57) = 217
F(566) = 566 (100,60,57) = 217
F(567) = 567 (100,60,57) = 217
F(568) = 568 (100,60,57) = 217
F(569) = 569 (100,60,57) = 217
F(570) = 570 (100,60,57) = 217
F(571) = 571 (100,60,58) = 218
F(572) = 572 (100,60,58) = 218
F(573) = 573 (100,60,58) = 218
F(574) = 574 (100,60,58) = 218
F(575) = 575 (100,60,58) = 218
F(576) = 576 (100,60,58) = 218
F(577) = 577 (100,60,58) = 218
F(578) = 578 (100,60,58) = 218
F(579) = 579 (100,60,58) = 218
F(580) = 580 (100,60,58) = 218
F(581) = 581 (100,60,59) = 219
F(582) = 582 (100,60,59) = 219
F(583) = 583 (100,60,59) = 219
F(584) = 584 (100,60,59) = 219
F(585) = 585 (100,60,59) = 219
F(586) = 586 (100,60,59) = 219
F(587) = 587 (100,60,59) = 219
F(588) = 588 (100,60,59) = 219
F(589) = 589 (100,60,59) = 219
F(590) = 590 (100,60,59) = 219
F(591) = 591 (100,60,60) = 220
F(592) = 592 (100,60,60) = 220
F(593) = 593 (100,60,60) = 220
F(594) = 594 (100,60,60) = 220
F(595) = 595 (100,60,60) = 220
F(596) = 596 (100,60,60) = 220
F(597) = 597 (100,60,60) = 220
F(598) = 598 (100,60,60) = 220
F(599) = 599 (100,60,60) = 220
F(600) = 600 (100,60,60) = 220
F(601) = 601 (100,60,61) = 221
F(602) = 602 (100,60,61) = 221
F(603) = 603 (100,60,61) = 221
F(604) = 604 (100,60,61) = 221
F(605) = 605 (100,60,61) = 221
F(606) = 606 (100,60,61) = 221
F(607) = 607 (100,60,61) = 221
F(608) = 608 (100,60,61) = 221
F(609) = 609 (100,60,61) = 221
F(610) = 610 (100,61,61) = 222
F(611) = 611 (100,62,62) = 224
F(612) = 612 (100,63,62) = 225
F(613) = 613 (100,64,62) = 226
F(614) = 614 (100,65,62) = 227
F(615) = 615 (100,66,62) = 228
F(616) = 616 (100,67,62) = 229
F(617) = 617 (100,68,62) = 230
F(618) = 618 (100,69,62) = 231
F(619) = 619 (100,70,62) = 232
F(620) = 620 (100,70,62) = 232
F(621) = 621 (100,70,63) = 233
F(622) = 622 (100,70,63) = 233
F(623) = 623 (100,70,63) = 233
F(624) = 624 (100,70,63) = 233
F(625) = 625 (100,70,63) = 233
F(626) = 626 (100,70,63) = 233
F(627) = 627 (100,70,63) = 233
F(628) = 628 (100,70,63) = 233
F(629) = 629 (100,70,63) = 233
F(630) = 630 (100,70,63) = 233
F(631) = 631 (100,70,64) = 234
F(632) = 632 (100,70,64) = 234
F(633) = 633 (100,70,64) = 234
F(634) = 634 (100,70,64) = 234
F(635) = 635 (100,70,64) = 234
F(636) = 636 (100,70,64) = 234
F(637) = 637 (100,70,64) = 234
F(638) = 638 (100,70,64) = 234
F(639) = 639 (100,70,64) = 234
F(640) = 640 (100,70,64) = 234
F(641) = 641 (100,70,65) = 235
F(642) = 642 (100,70,65) = 235
F(643) = 643 (100,70,65) = 235
F(644) = 644 (100,70,65) = 235
F(645) = 645 (100,70,65) = 235
F(646) = 646 (100,70,65) = 235
F(647) = 647 (100,70,65) = 235
F(648) = 648 (100,70,65) = 235
F(649) = 649 (100,70,65) = 235
F(650) = 650 (100,70,65) = 235
F(651) = 651 (100,70,66) = 236
F(652) = 652 (100,70,66) = 236
F(653) = 653 (100,70,66) = 236
F(654) = 654 (100,70,66) = 236
F(655) = 655 (100,70,66) = 236
F(656) = 656 (100,70,66) = 236
F(657) = 657 (100,70,66) = 236
F(658) = 658 (100,70,66) = 236
F(659) = 659 (100,70,66) = 236
F(660) = 660 (100,70,66) = 236
F(661) = 661 (100,70,67) = 237
F(662) = 662 (100,70,67) = 237
F(663) = 663 (100,70,67) = 237
F(664) = 664 (100,70,67) = 237
F(665) = 665 (100,70,67) = 237
F(666) = 666 (100,70,67) = 237
F(667) = 667 (100,70,67) = 237
F(668) = 668 (100,70,67) = 237
F(669) = 669 (100,70,67) = 237
F(670) = 670 (100,70,67) = 237
F(671) = 671 (100,70,68) = 238
F(672) = 672 (100,70,68) = 238
F(673) = 673 (100,70,68) = 238
F(674) = 674 (100,70,68) = 238
F(675) = 675 (100,70,68) = 238
F(676) = 676 (100,70,68) = 238
F(677) = 677 (100,70,68) = 238
F(678) = 678 (100,70,68) = 238
F(679) = 679 (100,70,68) = 238
F(680) = 680 (100,70,68) = 238
F(681) = 681 (100,70,69) = 239
F(682) = 682 (100,70,69) = 239
F(683) = 683 (100,70,69) = 239
F(684) = 684 (100,70,69) = 239
F(685) = 685 (100,70,69) = 239
F(686) = 686 (100,70,69) = 239
F(687) = 687 (100,70,69) = 239
F(688) = 688 (100,70,69) = 239
F(689) = 689 (100,70,69) = 239
F(690) = 690 (100,70,69) = 239
F(691) = 691 (100,70,70) = 240
F(692) = 692 (100,70,70) = 240
F(693) = 693 (100,70,70) = 240
F(694) = 694 (100,70,70) = 240
F(695) = 695 (100,70,70) = 240
F(696) = 696 (100,70,70) = 240
F(697) = 697 (100,70,70) = 240
F(698) = 698 (100,70,70) = 240
F(699) = 699 (100,70,70) = 240
F(700) = 700 (100,70,70) = 240
F(701) = 701 (100,70,71) = 241
F(702) = 702 (100,70,71) = 241
F(703) = 703 (100,70,71) = 241
F(704) = 704 (100,70,71) = 241
F(705) = 705 (100,70,71) = 241
F(706) = 706 (100,70,71) = 241
F(707) = 707 (100,70,71) = 241
F(708) = 708 (100,70,71) = 241
F(709) = 709 (100,70,71) = 241
F(710) = 710 (100,71,71) = 242
F(711) = 711 (100,72,72) = 244
F(712) = 712 (100,73,72) = 245
F(713) = 713 (100,74,72) = 246
F(714) = 714 (100,75,72) = 247
F(715) = 715 (100,76,72) = 248
F(716) = 716 (100,77,72) = 249
F(717) = 717 (100,78,72) = 250
F(718) = 718 (100,79,72) = 251
F(719) = 719 (100,80,72) = 252
F(720) = 720 (100,80,72) = 252
F(721) = 721 (100,80,73) = 253
F(722) = 722 (100,80,73) = 253
F(723) = 723 (100,80,73) = 253
F(724) = 724 (100,80,73) = 253
F(725) = 725 (100,80,73) = 253
F(726) = 726 (100,80,73) = 253
F(727) = 727 (100,80,73) = 253
F(728) = 728 (100,80,73) = 253
F(729) = 729 (100,80,73) = 253
F(730) = 730 (100,80,73) = 253
F(731) = 731 (100,80,74) = 254
F(732) = 732 (100,80,74) = 254
F(733) = 733 (100,80,74) = 254
F(734) = 734 (100,80,74) = 254
F(735) = 735 (100,80,74) = 254
F(736) = 736 (100,80,74) = 254
F(737) = 737 (100,80,74) = 254
F(738) = 738 (100,80,74) = 254
F(739) = 739 (100,80,74) = 254
F(740) = 740 (100,80,74) = 254
F(741) = 741 (100,80,75) = 255
F(742) = 742 (100,80,75) = 255
F(743) = 743 (100,80,75) = 255
F(744) = 744 (100,80,75) = 255
F(745) = 745 (100,80,75) = 255
F(746) = 746 (100,80,75) = 255
F(747) = 747 (100,80,75) = 255
F(748) = 748 (100,80,75) = 255
F(749) = 749 (100,80,75) = 255
F(750) = 750 (100,80,75) = 255
F(751) = 751 (100,80,76) = 256
F(752) = 752 (100,80,76) = 256
F(753) = 753 (100,80,76) = 256
F(754) = 754 (100,80,76) = 256
F(755) = 755 (100,80,76) = 256
F(756) = 756 (100,80,76) = 256
F(757) = 757 (100,80,76) = 256
F(758) = 758 (100,80,76) = 256
F(759) = 759 (100,80,76) = 256
F(760) = 760 (100,80,76) = 256
F(761) = 761 (100,80,77) = 257
F(762) = 762 (100,80,77) = 257
F(763) = 763 (100,80,77) = 257
F(764) = 764 (100,80,77) = 257
F(765) = 765 (100,80,77) = 257
F(766) = 766 (100,80,77) = 257
F(767) = 767 (100,80,77) = 257
F(768) = 768 (100,80,77) = 257
F(769) = 769 (100,80,77) = 257
F(770) = 770 (100,80,77) = 257
F(771) = 771 (100,80,78) = 258
F(772) = 772 (100,80,78) = 258
F(773) = 773 (100,80,78) = 258
F(774) = 774 (100,80,78) = 258
F(775) = 775 (100,80,78) = 258
F(776) = 776 (100,80,78) = 258
F(777) = 777 (100,80,78) = 258
F(778) = 778 (100,80,78) = 258
F(779) = 779 (100,80,78) = 258
F(780) = 780 (100,80,78) = 258
F(781) = 781 (100,80,79) = 259
F(782) = 782 (100,80,79) = 259
F(783) = 783 (100,80,79) = 259
F(784) = 784 (100,80,79) = 259
F(785) = 785 (100,80,79) = 259
F(786) = 786 (100,80,79) = 259
F(787) = 787 (100,80,79) = 259
F(788) = 788 (100,80,79) = 259
F(789) = 789 (100,80,79) = 259
F(790) = 790 (100,80,79) = 259
F(791) = 791 (100,80,80) = 260
F(792) = 792 (100,80,80) = 260
F(793) = 793 (100,80,80) = 260
F(794) = 794 (100,80,80) = 260
F(795) = 795 (100,80,80) = 260
F(796) = 796 (100,80,80) = 260
F(797) = 797 (100,80,80) = 260
F(798) = 798 (100,80,80) = 260
F(799) = 799 (100,80,80) = 260
F(800) = 800 (100,80,80) = 260
F(801) = 801 (100,80,81) = 261
F(802) = 802 (100,80,81) = 261
F(803) = 803 (100,80,81) = 261
F(804) = 804 (100,80,81) = 261
F(805) = 805 (100,80,81) = 261
F(806) = 806 (100,80,81) = 261
F(807) = 807 (100,80,81) = 261
F(808) = 808 (100,80,81) = 261
F(809) = 809 (100,80,81) = 261
F(810) = 810 (100,81,81) = 262
F(811) = 811 (100,82,82) = 264
F(812) = 812 (100,83,82) = 265
F(813) = 813 (100,84,82) = 266
F(814) = 814 (100,85,82) = 267
F(815) = 815 (100,86,82) = 268
F(816) = 816 (100,87,82) = 269
F(817) = 817 (100,88,82) = 270
F(818) = 818 (100,89,82) = 271
F(819) = 819 (100,90,82) = 272
F(820) = 820 (100,90,82) = 272
F(821) = 821 (100,90,83) = 273
F(822) = 822 (100,90,83) = 273
F(823) = 823 (100,90,83) = 273
F(824) = 824 (100,90,83) = 273
F(825) = 825 (100,90,83) = 273
F(826) = 826 (100,90,83) = 273
F(827) = 827 (100,90,83) = 273
F(828) = 828 (100,90,83) = 273
F(829) = 829 (100,90,83) = 273
F(830) = 830 (100,90,83) = 273
F(831) = 831 (100,90,84) = 274
F(832) = 832 (100,90,84) = 274
F(833) = 833 (100,90,84) = 274
F(834) = 834 (100,90,84) = 274
F(835) = 835 (100,90,84) = 274
F(836) = 836 (100,90,84) = 274
F(837) = 837 (100,90,84) = 274
F(838) = 838 (100,90,84) = 274
F(839) = 839 (100,90,84) = 274
F(840) = 840 (100,90,84) = 274
F(841) = 841 (100,90,85) = 275
F(842) = 842 (100,90,85) = 275
F(843) = 843 (100,90,85) = 275
F(844) = 844 (100,90,85) = 275
F(845) = 845 (100,90,85) = 275
F(846) = 846 (100,90,85) = 275
F(847) = 847 (100,90,85) = 275
F(848) = 848 (100,90,85) = 275
F(849) = 849 (100,90,85) = 275
F(850) = 850 (100,90,85) = 275
F(851) = 851 (100,90,86) = 276
F(852) = 852 (100,90,86) = 276
F(853) = 853 (100,90,86) = 276
F(854) = 854 (100,90,86) = 276
F(855) = 855 (100,90,86) = 276
F(856) = 856 (100,90,86) = 276
F(857) = 857 (100,90,86) = 276
F(858) = 858 (100,90,86) = 276
F(859) = 859 (100,90,86) = 276
F(860) = 860 (100,90,86) = 276
F(861) = 861 (100,90,87) = 277
F(862) = 862 (100,90,87) = 277
F(863) = 863 (100,90,87) = 277
F(864) = 864 (100,90,87) = 277
F(865) = 865 (100,90,87) = 277
F(866) = 866 (100,90,87) = 277
F(867) = 867 (100,90,87) = 277
F(868) = 868 (100,90,87) = 277
F(869) = 869 (100,90,87) = 277
F(870) = 870 (100,90,87) = 277
F(871) = 871 (100,90,88) = 278
F(872) = 872 (100,90,88) = 278
F(873) = 873 (100,90,88) = 278
F(874) = 874 (100,90,88) = 278
F(875) = 875 (100,90,88) = 278
F(876) = 876 (100,90,88) = 278
F(877) = 877 (100,90,88) = 278
F(878) = 878 (100,90,88) = 278
F(879) = 879 (100,90,88) = 278
F(880) = 880 (100,90,88) = 278
F(881) = 881 (100,90,89) = 279
F(882) = 882 (100,90,89) = 279
F(883) = 883 (100,90,89) = 279
F(884) = 884 (100,90,89) = 279
F(885) = 885 (100,90,89) = 279
F(886) = 886 (100,90,89) = 279
F(887) = 887 (100,90,89) = 279
F(888) = 888 (100,90,89) = 279
F(889) = 889 (100,90,89) = 279
F(890) = 890 (100,90,89) = 279
F(891) = 891 (100,90,90) = 280
F(892) = 892 (100,90,90) = 280
F(893) = 893 (100,90,90) = 280
F(894) = 894 (100,90,90) = 280
F(895) = 895 (100,90,90) = 280
F(896) = 896 (100,90,90) = 280
F(897) = 897 (100,90,90) = 280
F(898) = 898 (100,90,90) = 280
F(899) = 899 (100,90,90) = 280
F(900) = 900 (100,90,90) = 280
F(901) = 901 (100,90,91) = 281
F(902) = 902 (100,90,91) = 281
F(903) = 903 (100,90,91) = 281
F(904) = 904 (100,90,91) = 281
F(905) = 905 (100,90,91) = 281
F(906) = 906 (100,90,91) = 281
F(907) = 907 (100,90,91) = 281
F(908) = 908 (100,90,91) = 281
F(909) = 909 (100,90,91) = 281
F(910) = 910 (100,91,91) = 282
F(911) = 911 (100,92,92) = 284
F(912) = 912 (100,93,92) = 285
F(913) = 913 (100,94,92) = 286
F(914) = 914 (100,95,92) = 287
F(915) = 915 (100,96,92) = 288
F(916) = 916 (100,97,92) = 289
F(917) = 917 (100,98,92) = 290
F(918) = 918 (100,99,92) = 291
F(919) = 919 (100,100,92) = 292
F(920) = 920 (100,100,92) = 292
F(921) = 921 (100,100,93) = 293
F(922) = 922 (100,100,93) = 293
F(923) = 923 (100,100,93) = 293
F(924) = 924 (100,100,93) = 293
F(925) = 925 (100,100,93) = 293
F(926) = 926 (100,100,93) = 293
F(927) = 927 (100,100,93) = 293
F(928) = 928 (100,100,93) = 293
F(929) = 929 (100,100,93) = 293
F(930) = 930 (100,100,93) = 293
F(931) = 931 (100,100,94) = 294
F(932) = 932 (100,100,94) = 294
F(933) = 933 (100,100,94) = 294
F(934) = 934 (100,100,94) = 294
F(935) = 935 (100,100,94) = 294
F(936) = 936 (100,100,94) = 294
F(937) = 937 (100,100,94) = 294
F(938) = 938 (100,100,94) = 294
F(939) = 939 (100,100,94) = 294
F(940) = 940 (100,100,94) = 294
F(941) = 941 (100,100,95) = 295
F(942) = 942 (100,100,95) = 295
F(943) = 943 (100,100,95) = 295
F(944) = 944 (100,100,95) = 295
F(945) = 945 (100,100,95) = 295
F(946) = 946 (100,100,95) = 295
F(947) = 947 (100,100,95) = 295
F(948) = 948 (100,100,95) = 295
F(949) = 949 (100,100,95) = 295
F(950) = 950 (100,100,95) = 295
F(951) = 951 (100,100,96) = 296
F(952) = 952 (100,100,96) = 296
F(953) = 953 (100,100,96) = 296
F(954) = 954 (100,100,96) = 296
F(955) = 955 (100,100,96) = 296
F(956) = 956 (100,100,96) = 296
F(957) = 957 (100,100,96) = 296
F(958) = 958 (100,100,96) = 296
F(959) = 959 (100,100,96) = 296
F(960) = 960 (100,100,96) = 296
F(961) = 961 (100,100,97) = 297
F(962) = 962 (100,100,97) = 297
F(963) = 963 (100,100,97) = 297
F(964) = 964 (100,100,97) = 297
F(965) = 965 (100,100,97) = 297
F(966) = 966 (100,100,97) = 297
F(967) = 967 (100,100,97) = 297
F(968) = 968 (100,100,97) = 297
F(969) = 969 (100,100,97) = 297
F(970) = 970 (100,100,97) = 297
F(971) = 971 (100,100,98) = 298
F(972) = 972 (100,100,98) = 298
F(973) = 973 (100,100,98) = 298
F(974) = 974 (100,100,98) = 298
F(975) = 975 (100,100,98) = 298
F(976) = 976 (100,100,98) = 298
F(977) = 977 (100,100,98) = 298
F(978) = 978 (100,100,98) = 298
F(979) = 979 (100,100,98) = 298
F(980) = 980 (100,100,98) = 298
F(981) = 981 (100,100,99) = 299
F(982) = 982 (100,100,99) = 299
F(983) = 983 (100,100,99) = 299
F(984) = 984 (100,100,99) = 299
F(985) = 985 (100,100,99) = 299
F(986) = 986 (100,100,99) = 299
F(987) = 987 (100,100,99) = 299
F(988) = 988 (100,100,99) = 299
F(989) = 989 (100,100,99) = 299
F(990) = 990 (100,100,99) = 299
F(991) = 991 (100,100,100) = 300
F(992) = 992 (100,100,100) = 300
F(993) = 993 (100,100,100) = 300
F(994) = 994 (100,100,100) = 300
F(995) = 995 (100,100,100) = 300
F(996) = 996 (100,100,100) = 300
F(997) = 997 (100,100,100) = 300
F(998) = 998 (100,100,100) = 300
F(999) = 999 (100,100,100) = 300