Positive numbers represented by a binary quadratic form.
This SageMath notebook implements methods for calculating the numbers represented by a binary quadratic form in a uniform and efficient way and hides the complexity of the situation by providing a simple interface for the user.
- The original SageMath notebook (Python2, 2014) was documented at OEIS: BinaryQuadraticForms-OEIS
- The updated notebook (Python 3.10, 2024) is at GitHub, as well as the pure Sage code from the updated notebook: BinaryQuadraticForms-GitHub
- A HTML version of the notebook can be found at: BinaryQuadraticForms-HTML
Go to SageMath CellServer and enter:
load('https://raw.githubusercontent.com/PeterLuschny/BinaryQuadraticForms/main/BinaryQF.sage')
Q = binaryQF([1, 0, -2])
Q.represented_positives(100, 'prime')
oeis_bqf([1, 1, -1], 100, 'primitively', terse=False)
oeis_bqf([1, 1, 1], 100, 'tutti')
oeis_bqf([1, 13, -9], 1000, 'tutti')