OFFSET
1,2
EXAMPLE
a(2) = 36 is both the 8th triangular and the 6th square number.
a(3) = 1225 is both the 49th triangular and the 35th square number.
a(5) = 40755 is both the 165th pentagonal number and the 143th hexagonal number.
PROG
(PARI) upto(limit) = my(terms=List(1)); for(k=3, oo, my(found=0); for(n=2, oo, my(a = (2*n - 1)^2, b = (4*n*(3*n - 5) + 6), c = (8*(n-1)^2 + 1), s = (a*k^2 - b*k + c), v = n * (n*k - k - 2*n + 4) / 2); if(issquare(s), my(t = sqrtint(s) + k - 3); if(t % (2*(k-1)) == 0, listput(terms, v); found += 1)); if(v >= limit, break)); if(found == 0, break)); Vec(vecsort(terms)); \\ Daniel Suteu, Dec 08 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Kelvin Voskuijl, Nov 20 2024
EXTENSIONS
a(12)-a(30) from Pontus von Brömssen, Dec 07 2024
STATUS
approved