A356770 a(n) is the number of equations in the set {x+2y=n, 2x+3y=n, ..., k*x+(k+1)*y=n, ..., n*x+(n+1)*y=n} which admit at least one nonnegative integer solution.
1, 2, 3, 4, 4, 5, 5, 6, 6, 7, 6, 8, 7, 8, 8, 9, 8, 10, 8, 10, 10, 10, 9, 12, 10, 11, 11, 12, 10, 13, 11, 13, 12, 12, 12, 15, 12, 13, 13, 15, 12, 15, 13, 15, 15, 14, 13, 17, 14, 16, 15, 16, 14, 17, 15, 17, 16, 16, 15, 20, 15, 16, 17, 18, 17, 19, 16, 18, 17, 19, 16, 21, 17, 18, 19, 19
Offset: 1
Keywords
Examples
a(5) = 4. Consider the equations: x+2y=5, 2x+3y=5, 3x+4y=5, 4x+5y=5, 5x+6y=5. Only four of them admit at least one nonnegative integer solution, since 3x+4y=5 has no nonnegative integer solution.
Crossrefs
Cf. A000005.
Programs
-
Mathematica
b[m_] := m; f[n_] := Table[Dimensions[Solve[b[k]*x + b[k + 1]*y == n, {x, y}, NonNegativeIntegers]][[1]], {k, 1, n}]; Flatten[Table[Dimensions[DeleteCases[f[k], 0]], {k, 1, 100}]]
Comments