cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A337140 Numbers m = a + b with a and b positive integers whose product a*b = k^2 is a square.

Original entry on oeis.org

2, 4, 5, 6, 8, 10, 12, 13, 14, 15, 16, 17, 18, 20, 22, 24, 25, 26, 28, 29, 30, 32, 34, 35, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 48, 50, 51, 52, 53, 54, 55, 56, 58, 60, 61, 62, 64, 65, 66, 68, 70, 72, 73, 74, 75, 76, 78, 80, 82, 84, 85, 86, 87, 88, 89, 90, 91
Offset: 1

Views

Author

Hein van Winkel, Aug 18 2020

Keywords

Comments

Related to Heron triangles with a partition point on one of the sides. Calculations become quite different when the partition a + b = m gives the perfect square k^2 = a*b.
These numbers coincide with the numbers > 1 not in A004614.
Let m = 2^t * p_1^a_1 * p_2^a_2 * ... * p_r^a_r * q_1^b_1 * q_2^b_2 * ... * q_s^b_s with t >= 0, a_i >= 0 for i=1..r, where p_i == 1 (mod 4) for i=1..r and q_j == -1 (mod 4) for j=1..s.
Even numbers (A005843) belong to this sequence: m = 2*k and p = k^2.
Numbers divisible by a prime q congruent to 1 (mod 4) (cf. A004613) belong to this sequence: m = q * m_1 = (u^2 + v^2) * m_1 and p = (u*v*q)^2.
The other numbers are divisible only by primes congruent to 3 (mod 4) (cf. A004614).
If a term m is not in the union of A005843 and A004613, then m = q_1^b_1 * q_2^b_2 * ... * q_s^b_s is a term of A018825 (numbers not the sum of two nonzero squares) = q_i * m_1 = q_i *(u^2 + v) and p = q_i^2 * u^2 * v for all u^2 < m_1 and v nonsquare. And so m is not a term: A contradiction.

Examples

			Even numbers m = 2*k give a = b = k. For example, 94 = 47+47 and k^2 = 47^2.
Numbers which are divisible by a prime q congruent to 1 (mod 4) give m = q*m' = (u^2 + v^2)*m' and p = (u*v*m')^2. For example, 87 = 3*29 = 3*(25 + 4) = (5*4*3)^2 = 60^2.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[100], Length @ Select[Times @@@ IntegerPartitions[#, {2}], IntegerQ @ Sqrt[#1] &] > 0 &] (* Amiram Eldar, Aug 26 2020 *)
  • PARI
    upto(n) = { my(res = List(vector(n\2, i, 2*i))); forstep(i = 1, n, 2, c = core(i); for(k = 1, sqrtint((n-i)\c), listput(res, i + c*k^2); ) ); listsort(res, 1); res } \\ David A. Corneth, Aug 26 2020
    
  • PARI
    is(n) = for(i = 1, n\2 + 1, if(issquare(i * (n-i)), return(n>1))); 0 \\ David A. Corneth, Aug 26 2020
    
  • Python
    from itertools import count, islice
    from sympy import primefactors
    def A337140_gen(startvalue=2): # generator of terms >= startvalue
        return filter(lambda n: n&1^1 or not all(p&2 for p in primefactors(n>>(~n & n-1).bit_length())), count(max(startvalue,2)))
    A337140_list = list(islice(A337140_gen(),30)) # Chai Wah Wu, Aug 21 2024