%I #88 Jul 12 2023 11:09:05
%S 0,6,30,35,84,180,204,210,297,330,546,840,1170,1189,1224,1710,2310,
%T 2940,2970,3036,3230,3900,4914,6090,6930,7134,7140,7245,7440,8976,
%U 10710,12654,14175,14820,16296,16380,17220,19866,22770,25172,25944,29103
%N Numbers k with the property that k^2 is a product of two distinct triangular numbers.
%C From _Robert G. Wilson v_, Jul 24 2010: (Start)
%C Terms in the i-th row are products contributed with a factor A000217(i):
%C (1) 0, 6, 35, 204, 1189, 6930, 40391, 235416, 1372105, 7997214, 46611179, ...
%C (2) 30, 297, 2940, 29103, 288090, 2851797, 28229880, ...
%C (3) 84, 1170, 16296, 226974, 3161340, ...
%C (4) 180, 3230, 57960, 1040050, 18662940, ...
%C (5) 330, 7245, 159060, 3492075, 76666590, ...
%C (6) 546, 14175, 368004, 9553929, ...
%C (7) 840, 25172, 754320, 22604428, ...
%C (8) 210, 1224, 7134, 41580, 242346, 1412496, 8232630, 47983284, ...
%C (9) 1710, 64935, 2465820, 93636225, ...
%C (10) 2310, 96965, 4070220, ...
%C (11) 3036, 139590, 6418104, ...
%C (12) 3900, 194922, 9742200, ...
%C (13) 4914, 265265, 14319396, ...
%C (14) 6090, 353115, 20474580, ...
%C (15) 7440, 461160, 28584480, ...
%C (End)
%C Numbers m with property that m^2 is a product of two distinct triangular numbers T(i) and T(j) such that i and j are in the same row of the square array A(n, k) defined in A322699. - _Onur Ozkan_, Mar 17 2023
%H R. J. Mathar, <a href="/A175497/b175497.txt">Table of n, a(n) for n = 1..1000</a> replacing a b-file of _Robert G. Wilson v_ of 2010.
%H R. J. Mathar, <a href="/A175497/a175497.pdf">OEIS A175497</a>, Mar 16 2023
%H Project Euler, <a href="https://projecteuler.net/problem=833">Problem 833. Square Triangle Products</a>.
%H M. Ulas, <a href="https://arxiv.org/abs/0811.2477">On certain diophantine equations related to triangular and tetrahedral numbers</a>, arXiv:0811.2477 [math.NT], 2008. Theorem 5.6.
%F a(n)^2 = A169836(n). - _R. J. Mathar_, Mar 12 2023
%p isA175497 := proc(n)
%p local i,Ti,Tj;
%p if n = 0 then
%p return true;
%p end if;
%p for i from 1 do
%p Ti := i*(i+1)/2 ;
%p if Ti > n^2 then
%p return false;
%p else
%p Tj := n^2/Ti ;
%p if Tj <> Ti and type(Tj,'integer') then
%p if isA000217(Tj) then # code in A000217
%p return true;
%p end if;
%p end if;
%p end if;
%p end do:
%p end proc:
%p for n from 0 do
%p if isA175497(n) then
%p printf("%d,\n",n);
%p end if;
%p end do: # _R. J. Mathar_, May 26 2016
%t triangularQ[n_] := IntegerQ[Sqrt[8n + 1]];
%t okQ[n_] := Module[{i, Ti, Tj}, If[n == 0, Return[True]]; For[i = 1, True, i++, Ti = i(i+1)/2; If[Ti > n^2, Return[False], Tj = n^2/Ti; If[Tj != Ti && IntegerQ[Tj], If[ triangularQ[Tj], Return[True]]]]]];
%t Reap[For[k = 0, k < 30000, k++, If[okQ[k], Print[k]; Sow[k]]]][[2, 1]] (* _Jean-François Alcover_, Jun 13 2023, after _R. J. Mathar_ *)
%o (Python)
%o from itertools import count, islice, takewhile
%o from sympy import divisors
%o from sympy.ntheory.primetest import is_square
%o def A175497_gen(startvalue=0): # generator of terms >= startvalue
%o return filter(lambda k:not k or any(map(lambda d: is_square((d<<3)+1) and is_square((k**2//d<<3)+1), takewhile(lambda d:d**2<k,divisors(k**2)))),count(max(startvalue,0)))
%o A175497_list = list(islice(A175497_gen(),20)) # _Chai Wah Wu_, Mar 13 2023
%o (Python)
%o def A175497_list(n):
%o def A322699_A(k, n):
%o p, q, r, m = 0, k, 4*k*(k+1), 0
%o while m < n:
%o p, q, r = q, r, (4*k+3)*(r-q) + p
%o m += 1
%o return p
%o def a(k, n, j):
%o if n == 0: return 0
%o p = A322699_A(k, n)*(A322699_A(k, n)+1)*(2*k+1) - a(k, n-1, 1)
%o q = (4*k+2)*p - A322699_A(k, n)*(A322699_A(k, n)+1)//2
%o m = 1
%o while m < j: p, q = q, (4*k+2)*q - p; m += 1
%o return p
%o A = set([a(k, 1, 1) for k in range(n+1)])
%o k, l, m = 1, 1, 2
%o while True:
%o x = a(k, l, m)
%o if x < max(A):
%o A |= {x}
%o A = set(sorted(A)[:n+1])
%o m += 1
%o else:
%o if m == 1 and l == 1:
%o if k > n:
%o return sorted(A)
%o k += 1
%o elif m > 1:
%o l += 1; m = 1
%o elif l > 1:
%o k += 1; l, m = 1, 1
%o # _Onur Ozkan_, Mar 15 2023
%Y From _Robert G. Wilson v_, Jul 24 2010: (Start)
%Y A001109 (with the exception of 1), A011945, A075848 and A055112 are all proper subsets.
%Y Many terms are in common with A147779.
%Y Cf. A001108, A132596, A007654, A001108, A132593. (End)
%Y Cf. A152005 (two distinct tetrahedral numbers).
%K nonn
%O 1,2
%A _Zak Seidov_, May 30 2010