fork download
  1. var a,i,k,p:integer;
  2. begin
  3. k:=3;p:=9;
  4. for i:=3 to 200 do
  5. begin
  6. if i mod 2=1 then k:=(2*k+p) mod 23
  7. else p:=(2*p+k) mod 23;
  8. if k<0 then k:=23+k;
  9. if p<0 then p:=23+p;
  10. if (i mod 2=1) and (k mod 23=0) then write(i,' ');
  11. if (i mod 2=0) and (p mod 23=0) then write(i,' ');
  12. end;
  13. end.
  14.  
Success #stdin #stdout 0.01s 252KB
stdin
Standard input is empty
stdout
21 43 65 87 109 131 153 175 197