Palindromic gapful numbers: Difference between revisions

Added XPL0 example.
m (syntax highlighting fixup automation)
(Added XPL0 example.)
Line 5,096:
8: 80869644696808 80869655696808 80869666696808 80869677696808 80869688696808
9: 96877711777869 96877800877869 96877899877869 96877988977869 96878077087869
</pre>
 
=={{header|XPL0}}==
<syntaxhighlight lang "XPL0">func Palindromic(N); \Return 'true' if N is palindromic
int N, I, J, S(10);
[I:= 0;
while N > 0 do
[N:= N/10;
S(I):= rem(0);
I:= I+1;
];
J:= 0; I:= I-1;
while J < I do
[if S(J) # S(I) then return false;
J:= J+1; I:= I-1;
];
return true;
];
 
int Lo, Hi, Task, Mul, N, Cnt, Prod;
[Lo:= 0; Hi:= 20;
for Task:= 1 to 2 do
[Mul:= 11;
repeat N:= 1; Cnt:= 0;
loop [Prod:= N * Mul;
if Prod >= 100 then
if rem(Prod/10) = Mul/10 then
if Palindromic(Prod) then
[Cnt:= Cnt+1;
if Cnt >= Lo then
[IntOut(0, Prod); ChOut(0, ^ )];
if Cnt >= Hi then quit;
];
N:= N+1;
];
CrLf(0);
Mul:= Mul + 11;
until Mul > 99;
CrLf(0);
Lo:= 86; Hi:= 100;
];
]</syntaxhighlight>
{{out}}
<pre>
121 1001 1111 1221 1331 1441 1551 1661 1771 1881 1991 10901 11011 12221 13431 14641 15851 17171 18381 19591
242 2002 2112 2222 2332 2442 2552 2662 2772 2882 2992 20702 21912 22022 23232 24442 25652 26862 28182 29392
363 3003 3333 3663 3993 31713 33033 36663 300003 303303 306603 309903 312213 315513 318813 321123 324423 327723 330033 333333
484 4004 4224 4444 4664 4884 40304 42724 44044 46464 48884 400004 401104 402204 403304 404404 405504 406604 407704 408804
5005 5115 5225 5335 5445 5555 5665 5775 5885 5995 50105 51315 52525 53735 54945 55055 56265 57475 58685 59895
6006 6336 6666 6996 61116 64746 66066 69696 600006 603306 606606 609906 612216 615516 618816 621126 624426 627726 630036 633336
7007 7777 77077 700007 707707 710017 717717 720027 727727 730037 737737 740047 747747 750057 757757 760067 767767 770077 777777 780087
8008 8448 8888 80608 86768 88088 800008 802208 804408 806608 808808 821128 823328 825528 827728 829928 840048 842248 844448 846648
9009 9999 94149 99099 900009 909909 918819 927729 936639 945549 954459 963369 972279 981189 990099 999999 9459549 9508059 9557559 9606069
 
165561 166661 167761 168861 169961 170071 171171 172271 173371 174471 175571 176671 177771 178871 179971
265562 266662 267762 268862 269962 270072 271172 272272 273372 274472 275572 276672 277772 278872 279972
30366303 30399303 30422403 30455403 30488403 30511503 30544503 30577503 30600603 30633603 30666603 30699603 30722703 30755703 30788703
4473744 4485844 4497944 4607064 4619164 4620264 4632364 4644464 4656564 4668664 4681864 4693964 4803084 4815184 4827284
565565 566665 567765 568865 569965 570075 571175 572275 573375 574475 575575 576675 577775 578875 579975
60399306 60422406 60455406 60488406 60511506 60544506 60577506 60600606 60633606 60666606 60699606 60722706 60755706 60788706 60811806
72299227 72322327 72399327 72422427 72499427 72522527 72599527 72622627 72699627 72722727 72799727 72822827 72899827 72922927 72999927
80611608 80622608 80633608 80644608 80655608 80666608 80677608 80688608 80699608 80800808 80811808 80822808 80833808 80844808 80855808
95311359 95400459 95499459 95588559 95677659 95766759 95855859 95944959 96033069 96122169 96211269 96300369 96399369 96488469 96577569
 
</pre>
 
296

edits