Frobenius numbers: Difference between revisions

Content added Content deleted
(→‎{{header|jq}}: simplify)
Line 769: Line 769:
'''Works with gojq, the Go implementation of jq'''
'''Works with gojq, the Go implementation of jq'''


The solution offered here is based on a function that can generate an unbounded stream of Frobenius numbers without relying on the precomputation or storage of an array of primes except as may be used by `is_prime`.
The solution offered here is based on a function that can in principle generate an unbounded stream of Frobenius numbers without relying on the precomputation or storage of an array of primes except as may be used by `is_prime`.

The following is also designed to take advantage of gojq's support for unbounded-precision integer arithmetic.


See e.g. [[Erd%C5%91s-primes#jq]] for a suitable implementation of `is_prime`.
See e.g. [[Erd%C5%91s-primes#jq]] for a suitable implementation of `is_prime`.