A527 – Les pénultièmes et antépénultièmes.
Solution de Maurice et Andrée Bauval
Tous les nombres N de 1 à 9 sont atteints. Le 1er tableau ci dessous donne les plus petits nombres i conduisant à N= 10, 11 , 12, jusqu'à 99.
On voit aussi dans le deuxième tableau, que N=101 est le premier nombre qu'on n'obtient jamais.
On a fait les essais jusqu'à i= 46300, mais on aurait pu se limiter à i = 10000 uses crt;
var i,x,y,z: longint; aa:array[1..10000]of boolean;
bb:array[1..100]of longint;
begin clrscr;
for i:=1 to 1000 do aa[i]:=false;
for i:= 1 to 100 do bb[i]:=0;
for i:=1 to 46340 do begin x:=i*i; x:= x div 10;
y:= x mod 100; z:=x mod 1000;
aa[z]:=true;
aa[y]:=true;if bb[y]=0 then bb[y]:=i;
end;
for y:=10 to 99 do begin if y mod 10 =0 then writeln;
if bb[y]>0 then write(' ',bb[y]:4);end;
writeln; writeln;
for i:= 10 to 300 do if not aa[i] then write(' ',i);
end._
10 46 11 56 12 34 13 224 72 14 47 96 15 106 57 16 208 174 17 36 48 146 18 156 188 66 19 124 128 86 20 196 132 206 21 116 92 74 22 136 50 246 23 244 112 166 81 24 172 186 40 204 25 194 93 216 108 26 41 236 52 154 27 144 88 234 42 76 28 214 53 104 232 94 29 184 192 126 83 164 30 54 77 44 212 134 31 176 228 114
Nombres N inférieurs à 300, qui ne sont pas obtenus :
101 103 106 109 111 114 117 119 125 127 130 133 135 138 141 143 146 149 151 154 157 159 162 165 167 170 173 175 178 181 183 186 189 191 194 197 199 205 207 213 215 218 221 223 226 229 231 234 237 239 242 245 247 253 255 258 261 263 266 269 271 274 277 279 282 285 287 293 295 298