Miscellany
public ruby v1 · immutablea=[0]k=1i=1while i<1000000 do a.push(i) puts a[i] i+=1enda[1]=0i=2b= Math.sqrt(1000000)while i<b do j=1 while j<1000000 do if a[j] == nil then a[j]=0 end if a[j] % i == 0 then a[j]=0 end j+=1 puts j end k+=1 while a[k]==0 || a[k]==nil do k+=1 puts k end i=a[k] puts iendputs summingj=1x=0while j<1000000 do puts j/10000 + "%" x+=a[j] j+=1endputs x