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.

A356748 Numbers k such that k and k+1 are both products of 2 triangular numbers.

This page as a plain text file.
%I A356748 #16 Apr 05 2023 16:40:38
%S A356748 0,9,90,135,945,1710,1890,4959,5670,8910,10584,11025,11934,13860,
%T A356748 19305,21735,26334,32130,36855,44550,49140,65340,107415,138600,172080,
%U A356748 239085,305370,351540,366795,459360,849555,873180,933660,1100385,1413720,1516410,1904175,2297295
%N A356748 Numbers k such that k and k+1 are both products of 2 triangular numbers.
%C A356748 Numbers k such that k and k+1 are both terms of A085780.
%C A356748 Are all the terms divisible by 9?
%C A356748 Yes, because the product of two triangular numbers == 0, 1, 3 or 6 (mod 9). - _Robert Israel_, Apr 05 2023
%H A356748 Robert Israel, <a href="/A356748/b356748.txt">Table of n, a(n) for n = 1..138</a>
%e A356748 9 is a term since 9 = 3*3 and 10 = 1*10 are both products of 2 triangular numbers.
%p A356748 N:= 10^9: # for terms <= N
%p A356748 S:= {0}:
%p A356748 for x from 1 do
%p A356748   s:= x*(x+1)/2;
%p A356748   if s^2 > N then break fi;
%p A356748   for y from x do
%p A356748     t:= y*(y+1)/2;
%p A356748     if s*t > N then break fi;
%p A356748     S:= S union {s*t};
%p A356748 od od:
%p A356748 L:= sort(convert(S,list)):
%p A356748 DL:= L[2..-1]-L[1..-2]:
%p A356748 J:= select(t -> DL[t]=1, [$1..nops(DL)]):
%p A356748 L[J]; # _Robert Israel_, Apr 05 2023
%t A356748 t = Table[n*(n + 1)/2, {n, 0, 3000}]; s = Select[Union[Flatten[Outer[Times, t, t]]], # <= t[[-1]] &]; i = Position[Differences[s], 1] // Flatten; s[[i]]
%t A356748 Take[Select[Partition[Union[Times@@@Tuples[Accumulate[Range[0,2500]],2]],2,1],#[[2]] - #[[1]]==1&][[All,1]],40] (* _Harvey P. Dale_, Oct 23 2022 *)
%o A356748 (Python)
%o A356748 from itertools import count, islice
%o A356748 from sympy import divisors, integer_nthroot
%o A356748 def A356748_gen(startvalue=0): # generator of terms >= startvalue
%o A356748     if startvalue <= 0:
%o A356748         yield 0
%o A356748     flag = False
%o A356748     for n in count(max(startvalue,1)):
%o A356748         for d in divisors(m:=n<<2):
%o A356748             if d**2 > m:
%o A356748                 flag = False
%o A356748                 break
%o A356748             if integer_nthroot((d<<2)+1,2)[1] and integer_nthroot((m//d<<2)+1,2)[1]:
%o A356748                 if flag: yield n-1
%o A356748                 flag = True
%o A356748                 break
%o A356748         else:
%o A356748             flag = False
%o A356748 A356748_list = list(islice(A356748_gen(),10)) # _Chai Wah Wu_, Aug 28 2022
%Y A356748 Cf. A085780.
%K A356748 nonn
%O A356748 1,2
%A A356748 _Amiram Eldar_, Aug 25 2022