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.
%I A081974 #16 Jul 24 2025 05:17:48 %S A081974 1,3,2,5,9,4,7,13,6,11,21,10,12,23,45,14,27,53,26,30,33,16,31,15,20, %T A081974 41,81,40,52,103,51,25,49,24,47,93,46,91,60,76,151,75,37,18,112,115, %U A081974 57,28,55,39,19,87,43,22,133,66,58,117,35,17,8,395,126,141,70,102,90,116,231 %N A081974 a(1) = 1 and smallest number not occurring earlier such that the product of two neighboring terms is a distinct triangular number, where "distinct" means that a(n)*a(n+1) may not equal the product of any two previous consecutive terms. %C A081974 Perhaps another re-arrangement of natural numbers. %H A081974 Robert Israel, <a href="/A081974/b081974.txt">Table of n, a(n) for n = 1..10000</a> %e A081974 5 and 4 are the neighbors of 9 giving the triangular numbers 45 and 36 respectively. %p A081974 Acands:= [$2..10^4]: ncands:= 10^4-1: Tused:= {}: %p A081974 a[1]:= 1: %p A081974 for i from 2 to 100 do %p A081974 found:= false; %p A081974 for j from 1 to ncands do %p A081974 if istri(a[i-1]*Acands[j]) and not member(a[i-1]*Acands[j],Tused) then %p A081974 found:= true; a[i]:= Acands[j]; %p A081974 Acands:= subsop(j=NULL, Acands); %p A081974 ncands:= ncands - 1; %p A081974 Tused:= Tused union {a[i-1]*a[i]}; %p A081974 break %p A081974 fi %p A081974 od; %p A081974 if not found then break fi %p A081974 od: %p A081974 seq(a[k],k=1..100); # _Robert Israel_, Jul 23 2025 %t A081974 istriang[n_] := With[{x = Floor[Sqrt[2*n]]}, n == x*(x + 1)/2]; %t A081974 nmax = 75; %t A081974 Clear[a, used, tris]; %t A081974 a[_] = 0; used[_] = 0; tris[_] = 0; a[1] = 1; used[1] = 1; %t A081974 For[i = 2, i <= nmax, i++, f = a[i-1]; j = 2; While[used[j] == 1 || !istriang[f*j] || tris[f*j] == 1, j++]; a[i] = j; used[j] = 1; tris[f*j] = 1]; %t A081974 Table[a[n], {n, 1, nmax}] (* _Jean-François Alcover_, May 23 2024, after PARI code *) %o A081974 (PARI) istriang(n) = local(x); x = floor(sqrt(2*n)); n == x*(x + 1)/2; %o A081974 A = vector(75); used = vector(1000); tris = vector(50000); A[1] = 1; used[1] = 1; for (i = 2, 75, f = A[i - 1]; j = 2; while (used[j] || !istriang(f*j) || tris[f*j], j = j + 1); A[i] = j; used[j] = 1; tris[f*j] = 1); print(A) %Y A081974 Cf. A081975, A081976, A081977. %K A081974 nonn %O A081974 1,2 %A A081974 _Amarnath Murthy_, Apr 03 2003 %E A081974 More terms from _David Wasserman_, Jul 26 2004