# Tag Info

1 vote

### Output a 1-2-3-5-7... sequence

Python 3 (sympy), 126 bytes from sympy import* s=[] g=x=0 while 1: x+=1;g=nextprime(g) if all(f%x or~-isprime(f//x)*(x-f)for f in s):print(g*x);s+=[g*x] Try it ...
• 4,257

### Output a 1-2-3 sequence

x86-64 machine code, 24 bytes 31 C0 8D 70 07 FF C0 50 F7 E0 F7 F6 89 D1 E3 FA 58 E2 F2 FF CF 79 EE C3 Try it online! Following the standard calling convention for ...
• 10.3k

### Output a 1-2-3 sequence

Ruby, 36 bytes 0.step{|x|x.to_s(7)=~/[25]0*/&&p(x)} Try it online! Using m90's method
• 21.9k
1 vote

### Output a 1-2-3-5-7... sequence

Wolfram Language (Mathematica), 74 bytes f@n_:=f/;!Or@@CompositeQ/@NumeratorDenominator[i/n]=Print@n f@i~Do~{i,∞} Try it online! Greedy algorithm. Outputs (certain ...
• 20.4k
1 vote

### Output a 1-2-3 sequence

05AB1E, 7 bytes ∞ʒÒ<O3Ö Port of @Bubbler's Jelly answer, but with an infinite list instead. Try it online. Explanation: ...
• 126k
1 vote

### Output a 1-2-3 sequence

Haskell, 32 bytes [n|n<-[1..],mod(gcd(6^n)n^2)7<2] Try it online! An adaptation of m90's method. Extracts the 2^a * 3^b ...
• 145k

### Output a 1-2-3 sequence

JavaScript, 52 51 bytes for(n=0;h=x=>x%7||h(x/7);)~h(++n)%3||console.log(n) Try it online! -1 thanks to Mukundan314. The sequence contains the numbers that are ...
• 10.3k
1 vote

### Output a 1-2-3 sequence

C (GCC), 63 bytes i;main(j){for(;;~j%7%3||printf("%d ",i))for(j=++i;j%7<1;)j/=7;} Attempt This Online! Port of @m90's answer C (gcc), 82 74 bytes -8 ...
• 10.5k
1 vote

### Output a 1-2-3 sequence

Matlab, 69 66 bytes i=1;a=[];while 1;if all(a-i);disp(i);a=[a [2:4 9]*i];end;i=i+1;end Try it online! It basically is a translation of pxeger's answer. Matlab ...
• 171

### Output a 1-2-3-5-7... sequence

05AB1E, 11 9 bytes ∞ʒÓ2ôÆƶO_ Try it online! Outputs the infinite sequence (well on TIO it will time out after about 18000). ...
• 170k