Skip to main content
Commonmark migration
Source Link

cQuents, 16 bytes

=A000007//5#|A:0 

Try it online!, A000007, 1,0,0,0,0...

=A000004//5#|A:0 

Try it online!, A000004, 0,0,0,0,0...

##Explanation

Explanation

 Implicit input A =A000007 First item in the sequence equals A * 7 //5 intdiv 5 = 1 #|A n equals A : Mode : (sequence): output nth item (1-based) 0 Rest of the sequence is 0 
 Implicit input A =A000004 First item in the sequence equals A * 4 //5 intdiv 5 = 0 #|A n equals A : Mode : (sequence): output nth item (1-based) 0 Rest of the sequence is 0 

Thanks to Conor O'Brien for 4//5 = 0 and 7//5 = 1.

If the spec was more flexible, it would be O7A$ and O4A$.

cQuents, 16 bytes

=A000007//5#|A:0 

Try it online!, A000007, 1,0,0,0,0...

=A000004//5#|A:0 

Try it online!, A000004, 0,0,0,0,0...

##Explanation

 Implicit input A =A000007 First item in the sequence equals A * 7 //5 intdiv 5 = 1 #|A n equals A : Mode : (sequence): output nth item (1-based) 0 Rest of the sequence is 0 
 Implicit input A =A000004 First item in the sequence equals A * 4 //5 intdiv 5 = 0 #|A n equals A : Mode : (sequence): output nth item (1-based) 0 Rest of the sequence is 0 

Thanks to Conor O'Brien for 4//5 = 0 and 7//5 = 1.

If the spec was more flexible, it would be O7A$ and O4A$.

cQuents, 16 bytes

=A000007//5#|A:0 

Try it online!, A000007, 1,0,0,0,0...

=A000004//5#|A:0 

Try it online!, A000004, 0,0,0,0,0...

Explanation

 Implicit input A =A000007 First item in the sequence equals A * 7 //5 intdiv 5 = 1 #|A n equals A : Mode : (sequence): output nth item (1-based) 0 Rest of the sequence is 0 
 Implicit input A =A000004 First item in the sequence equals A * 4 //5 intdiv 5 = 0 #|A n equals A : Mode : (sequence): output nth item (1-based) 0 Rest of the sequence is 0 

Thanks to Conor O'Brien for 4//5 = 0 and 7//5 = 1.

If the spec was more flexible, it would be O7A$ and O4A$.

Source Link
Stephen
  • 14.2k
  • 3
  • 57
  • 118

cQuents, 16 bytes

=A000007//5#|A:0 

Try it online!, A000007, 1,0,0,0,0...

=A000004//5#|A:0 

Try it online!, A000004, 0,0,0,0,0...

##Explanation

 Implicit input A =A000007 First item in the sequence equals A * 7 //5 intdiv 5 = 1 #|A n equals A : Mode : (sequence): output nth item (1-based) 0 Rest of the sequence is 0 
 Implicit input A =A000004 First item in the sequence equals A * 4 //5 intdiv 5 = 0 #|A n equals A : Mode : (sequence): output nth item (1-based) 0 Rest of the sequence is 0 

Thanks to Conor O'Brien for 4//5 = 0 and 7//5 = 1.

If the spec was more flexible, it would be O7A$ and O4A$.