Skip to main content
added 21 characters in body
Source Link
xem
  • 5.8k
  • 3
  • 27
  • 40

JS, 100 6767 57

By xem and subzey

Execute this in the browser's console or nodeJS.

Short version: 69b57b. (it's very long to end: ~ 20 min)

for(i=2;1e6>i;i++i=1;1e6>++i;p&&console.log(i){p=1;for)for(j=i;jp=j=i;j-->2;)i%j||(p=0);p&&console.log(i)}p*=i%j

Faster version, 100b (ends in ~ 1 min)

p=[];for(i=2;1E6>i;i++)for(t=0,j=i;1E6>j;j+=i)t&&(p[j]=1),t=1;for(i=2;1E6>i;i++)p[i]||console.log(i)

JS, 100 67

Execute this in the browser's console or nodeJS.

Short version: 69b. (it's very long to end: ~ 20 min)

for(i=2;1e6>i;i++){p=1;for(j=i;j-->2;)i%j||(p=0);p&&console.log(i)}

Faster version, 100b (ends in ~ 1 min)

p=[];for(i=2;1E6>i;i++)for(t=0,j=i;1E6>j;j+=i)t&&(p[j]=1),t=1;for(i=2;1E6>i;i++)p[i]||console.log(i)

JS, 100 67 57

By xem and subzey

Execute this in the browser's console or nodeJS.

Short version: 57b. (it's very long to end: ~ 20 min)

for(i=1;1e6>++i;p&&console.log(i))for(p=j=i;j-->2;)p*=i%j

Faster version, 100b (ends in ~ 1 min)

p=[];for(i=2;1E6>i;i++)for(t=0,j=i;1E6>j;j+=i)t&&(p[j]=1),t=1;for(i=2;1E6>i;i++)p[i]||console.log(i)
deleted 1 character in body
Source Link
xem
  • 5.8k
  • 3
  • 27
  • 40

JS, 100 6967

Execute this in the browser's console or nodeJS.

Short version: 69b. (it's very long to end: ~ 20 min)

for(i=2;1e6>i;i++){p=1;for(j=2;j<i;j++j=i;j-->2;)i%j||(p=0);p&&console.log(i)}

Faster version, 100b (ends in ~ 1 min)

p=[];for(i=2;1E6>i;i++)for(t=0,j=i;1E6>j;j+=i)t&&(p[j]=1),t=1;for(i=2;1E6>i;i++)p[i]||console.log(i)

JS, 100 69

Execute this in the browser's console or nodeJS.

Short version: 69b. (it's very long to end: ~ 20 min)

for(i=2;1e6>i;i++){p=1;for(j=2;j<i;j++)i%j||(p=0);p&&console.log(i)}

Faster version, 100b (ends in ~ 1 min)

p=[];for(i=2;1E6>i;i++)for(t=0,j=i;1E6>j;j+=i)t&&(p[j]=1),t=1;for(i=2;1E6>i;i++)p[i]||console.log(i)

JS, 100 67

Execute this in the browser's console or nodeJS.

Short version: 69b. (it's very long to end: ~ 20 min)

for(i=2;1e6>i;i++){p=1;for(j=i;j-->2;)i%j||(p=0);p&&console.log(i)}

Faster version, 100b (ends in ~ 1 min)

p=[];for(i=2;1E6>i;i++)for(t=0,j=i;1E6>j;j+=i)t&&(p[j]=1),t=1;for(i=2;1E6>i;i++)p[i]||console.log(i)
added 97 characters in body
Source Link
xem
  • 5.8k
  • 3
  • 27
  • 40

JS, 100100 69

This is a first draft, I'll improve it asap:

Execute this in the browser's console, it'll take less than a minute to compute and log the numbers or nodeJS.

Short version: 69b. (it's very long to end: ~ 20 min)

for(i=2;1e6>i;i++){p=1;for(j=2;j<i;j++)i%j||(p=0);p&&console.log(i)}

Faster version, 100b (ends in ~ 1 min)

p=[];for(i=2;1E6>i;i++)for(t=0,j=i;1E6>j;j+=i)t&&(p[j]=1),t=1;for(i=2;1E6>i;i++)p[i]||console.log(i)

JS, 100

This is a first draft, I'll improve it asap:

Execute this in the console, it'll take less than a minute to compute and log the numbers.

p=[];for(i=2;1E6>i;i++)for(t=0,j=i;1E6>j;j+=i)t&&(p[j]=1),t=1;for(i=2;1E6>i;i++)p[i]||console.log(i)

JS, 100 69

Execute this in the browser's console or nodeJS.

Short version: 69b. (it's very long to end: ~ 20 min)

for(i=2;1e6>i;i++){p=1;for(j=2;j<i;j++)i%j||(p=0);p&&console.log(i)}

Faster version, 100b (ends in ~ 1 min)

p=[];for(i=2;1E6>i;i++)for(t=0,j=i;1E6>j;j+=i)t&&(p[j]=1),t=1;for(i=2;1E6>i;i++)p[i]||console.log(i)
Source Link
xem
  • 5.8k
  • 3
  • 27
  • 40
Loading