Skip to main content
edited body; edited body; added 6 characters in body; added 1 character in body
Source Link
Luis Mendo
  • 105.3k
  • 9
  • 135
  • 372

Octave, 24 bytes

@(m,n)diff(fix(0:m/n:m))

The code defines an anonymous function. The output is a row vectornumeric array (numeric arrayrow vector). When there is no this array contains at least one zero, which is falsy in Octave.

Try it online!

Explanation

0:m/n:nm produces an array of n+1 values from 0 to nm with step m/n. fix rounds each entry towards 0, and diff computes consecutive differences.

As an example, here are all intermediate results fofor m = 7, n = 3:

>> 0:m/n:m
ans =
         0    2.3333    4.6667    7.0000

>> fix(0:m/n:m)
ans =
     0     2     4     7

>> diff(fix(0:m/n:m))
ans =
     2     2     3

Octave, 24 bytes

@(m,n)diff(fix(0:m/n:m))

The code defines an anonymous function. The output is a row vector (numeric array). When there is no this array contains at least one zero, which is falsy in Octave.

Try it online!

Explanation

0:m/n:n produces an array of values from 0 to n with step m/n. fix rounds each entry towards 0, and diff computes consecutive differences.

As an example, here are all intermediate results fo m = 7, n = 3:

>> 0:m/n:m
ans =
         0    2.3333    4.6667    7.0000

>> fix(0:m/n:m)
ans =
     0     2     4     7

>> diff(fix(0:m/n:m))
ans =
     2     2     3

Octave, 24 bytes

@(m,n)diff(fix(0:m/n:m))

The code defines an anonymous function. The output is a numeric array (row vector). When there is no this array contains at least one zero, which is falsy in Octave.

Try it online!

Explanation

0:m/n:m produces an array of n+1 values from 0 to m with step m/n. fix rounds each entry towards 0, and diff computes consecutive differences.

As an example, here are all intermediate results for m = 7, n = 3:

>> 0:m/n:m
ans =
         0    2.3333    4.6667    7.0000

>> fix(0:m/n:m)
ans =
     0     2     4     7

>> diff(fix(0:m/n:m))
ans =
     2     2     3
added 106 characters in body
Source Link
Luis Mendo
  • 105.3k
  • 9
  • 135
  • 372

Octave, 24 bytes

@(m,n)diff(fix(0:m/n:m))

The code defines an anonymous function. The output is a row vector (numeric array). When there is no this array contains at least one zero, which is falsyfalsy in Octave.

Try it online!

Explanation

0:m/n:n produces an array of values from 0 to n with step m/n. fix rounds each entry towards 0, and diff computes consecutive differences.

As an example, here are all intermediate results fo m = 7, n = 3:

>> 0:m/n:m
ans =
         0    2.3333    4.6667    7.0000

>> fix(0:m/n:m)
ans =
     0     2     4     7

>> diff(fix(0:m/n:m))
ans =
     2     2     3

Octave, 24 bytes

@(m,n)diff(fix(0:m/n:m))

The code defines an anonymous function. The output is a row vector (numeric array). When there is no this array contains at least one zero, which is falsy in Octave.

Try it online!

Explanation

0:m/n:n produces an array of values from 0 to n with step m/n. fix rounds each entry towards 0, and diff computes consecutive differences.

As an example, here are all intermediate results fo m = 7, n = 3:

>> 0:m/n:m
ans =
         0    2.3333    4.6667    7.0000

>> fix(0:m/n:m)
ans =
     0     2     4     7

>> diff(fix(0:m/n:m))
ans =
     2     2     3

Octave, 24 bytes

@(m,n)diff(fix(0:m/n:m))

The code defines an anonymous function. The output is a row vector (numeric array). When there is no this array contains at least one zero, which is falsy in Octave.

Try it online!

Explanation

0:m/n:n produces an array of values from 0 to n with step m/n. fix rounds each entry towards 0, and diff computes consecutive differences.

As an example, here are all intermediate results fo m = 7, n = 3:

>> 0:m/n:m
ans =
         0    2.3333    4.6667    7.0000

>> fix(0:m/n:m)
ans =
     0     2     4     7

>> diff(fix(0:m/n:m))
ans =
     2     2     3
added 21 characters in body
Source Link
Luis Mendo
  • 105.3k
  • 9
  • 135
  • 372

Octave, 24 bytes

@(m,n)diff(fix(0:m/n:m))

The code defines an anonymous function. The output is a row vector (numeric array). When there is no solution the output is anthis array containingcontains at least one zero, which is falsy in Octave.

Try it online!

Explanation

0:m/n:n produces an array of values from 0 to n with step m/n. fix rounds each entry towards 0, and diff computes consecutive differences.

As an example, here are all intermediate results fo m = 7, n = 3:

>> 0:m/n:m
ans =
         0    2.3333    4.6667    7.0000

>> fix(0:m/n:m)
ans =
     0     2     4     7

>> diff(fix(0:m/n:m))
ans =
     2     2     3

Octave, 24 bytes

@(m,n)diff(fix(0:m/n:m))

The code defines an anonymous function. When there is no solution the output is an array containing at least one zero, which is falsy in Octave.

Try it online!

Explanation

0:m/n:n produces an array of values from 0 to n with step m/n. fix rounds each entry towards 0, and diff computes consecutive differences.

As an example, here are all intermediate results fo m = 7, n = 3:

>> 0:m/n:m
ans =
         0    2.3333    4.6667    7.0000

>> fix(0:m/n:m)
ans =
     0     2     4     7

>> diff(fix(0:m/n:m))
ans =
     2     2     3

Octave, 24 bytes

@(m,n)diff(fix(0:m/n:m))

The code defines an anonymous function. The output is a row vector (numeric array). When there is no this array contains at least one zero, which is falsy in Octave.

Try it online!

Explanation

0:m/n:n produces an array of values from 0 to n with step m/n. fix rounds each entry towards 0, and diff computes consecutive differences.

As an example, here are all intermediate results fo m = 7, n = 3:

>> 0:m/n:m
ans =
         0    2.3333    4.6667    7.0000

>> fix(0:m/n:m)
ans =
     0     2     4     7

>> diff(fix(0:m/n:m))
ans =
     2     2     3
Source Link
Luis Mendo
  • 105.3k
  • 9
  • 135
  • 372
Loading