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.

A365686 Numbers k such that there exists a pair of integers (m,h) where 1 <= m < floor(sqrt(k)/2) <= h that satisfy Sum_{j=0..m} (k-j)^2 = Sum_{i=1..m} (h+i)^2.

This page as a plain text file.
%I A365686 #85 Mar 02 2025 16:04:04
%S A365686 4,12,21,24,40,60,84,110,112,120,144,180,220,264,312,315,364,420,480,
%T A365686 544,612,684,697,760,820,840,924,1012,1080,1104,1200,1265,1300,1404,
%U A365686 1512,1624,1740,1860,1984,2106,2112,2244,2380,2520,2664,2812,2964,3120,3255
%N A365686 Numbers k such that there exists a pair of integers (m,h) where 1 <= m < floor(sqrt(k)/2) <= h that satisfy Sum_{j=0..m} (k-j)^2 = Sum_{i=1..m} (h+i)^2.
%C A365686 The sums are of m+1 consecutive squares ending at k^2, and of m consecutive squares starting somewhere at or beyond (k+1)^2.
%C A365686 If k is a term and h = k then k is in A046092.
%C A365686 All terms are composite numbers.
%C A365686 Also k is a term if there exists a pair of integers (m, h) such that 1 <= m < floor(sqrt(k)/2) <= h and that satisfy k*(m+1)*(k-m)-m*h*(h+m+1)=0.
%H A365686 Project Euler, <a href="https://projecteuler.net/problem=261">Problem 261: Pivotal Square Sums</a>.
%F A365686 k if Sum_{j=0..m} (k-j)^2 = Sum_{i=1..m} (h+i)^2 where 1 <= m < floor(sqrt(k)/2) <= h.
%e A365686 k=24 is a term because 21^2 + 22^2 + 23^2 + 24^2 = 25^2 + 26^2 + 27^2 with m=3 and h=24.
%e A365686 k=110 is a term because 108^2 + 109^2 + 110^2 = 133^2 + 134^2, with m=2 and h=132.
%o A365686 (Python)
%o A365686 from sympy import isprime
%o A365686 from sympy.ntheory.primetest import is_square
%o A365686 from sympy.core.intfunc import isqrt
%o A365686 A002378 = lambda n: n * (n + 1)
%o A365686 A046092 = lambda n: A002378(n) << 1
%o A365686 isA046092 = lambda n: (n & 1 == 0) and is_square((n << 1) + 1)
%o A365686 def isok(k):
%o A365686     if isprime(k): return False
%o A365686     if isA046092(k): return True
%o A365686     k2 = k * k
%o A365686     for m in range(1, (isqrt(k) >> 1) + 1):
%o A365686         h, m2, m_2 = k+1, m * m, m << 1
%o A365686         S = k2 - k * A046092(m)
%o A365686         while S > 0:
%o A365686             S -= m2 + (h * m_2)
%o A365686             h += 1
%o A365686             if S == 0: return True
%o A365686 print([k for k in range(1, 3256) if isok(k)])
%o A365686 (PARI) isok(k) = for (i=1, k-1, my(s1 = sum(j=k-i, k, j^2)); for (m=k+1, oo, my(s2 = sum(j=0, i-1, (m+j)^2)); if (s2 == s1, return(1)); if (s2 > s1, break););); \\ _Michel Marcus_, Sep 27 2023
%Y A365686 Cf. A000290, A002378, A046092, A233035.
%K A365686 nonn
%O A365686 1,1
%A A365686 _DarĂ­o Clavijo_, Sep 15 2023