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 A379697 #15 Jan 31 2025 04:28:03 %S A379697 0,2,5,0,1,20,4,0,2,6,8,2,0,10,119,3,4,20,0,1,5,14,2,5,1,0,32,6,7,464, %T A379697 20,2,8,0,24,8,2,4,65,9,10,47,0,3,11,30,17,2,3,1,59,12,0,2,21,4,14,38, %U A379697 40,14,4,42,101,0,16,74,2,5,17,46,48,17,5,1,11,0,19,125,10,6,20,54,1,20,6,44,272,21,0 %N A379697 For n >= 3, a(n) is the least k >= 0 such that (k + 1)*(2*n + k) / 2 is a triangular number (A000217). %C A379697 Also for n >= 3, a(n) is the least k >= 0 such that the Sum_{i = 0..k} (n + i) is a triangular number (A000217). For n = 0, 1 the Sum is a triangular number for all n. For n = 2, there is no solution. %H A379697 Robert Israel, <a href="/A379697/b379697.txt">Table of n, a(n) for n = 3..10000</a> %F A379697 a(n) = 0 for n from A000217. %F A379697 a(n) = 1 for n from A074377 AND n is not a triangular number. %e A379697 n = 4: the least k >= 0 such that (k + 1)*(8 + k)/2 is a triangular number is k = 2, thus a(4) = 2. %e A379697 n = 6: the least k >= 0 such that (k + 1)*(12 + k)/2 is a triangular number is k = 0, thus a(6) = 0. %p A379697 f:= proc(n) local t, alpha, beta; %p A379697 t:= n^2-n; %p A379697 alpha:= convert(select(type, numtheory:-divisors(t),odd),list); %p A379697 beta:= map(s -> (s+t/s - 1)/2 - n, alpha); %p A379697 min(select(`>=`,beta,0)) %p A379697 end proc: %p A379697 map(f, [$3..100]); # _Robert Israel_, Jan 30 2025 %t A379697 a[n_] := Module[{k = 0}, While[! IntegerQ[Sqrt[4*(k + 1)*(2*n + k) + 1]], k++]; k]; Array[a, 100, 3] (* _Amiram Eldar_, Dec 30 2024 *) %o A379697 (PARI) a(n) = my(k=0); while (!ispolygonal((k + 1)*(2*n + k)/2, 3), k++); k; \\ _Michel Marcus_, Dec 30 2024 %Y A379697 Cf. A000217, A074377, A379676. %K A379697 nonn,look %O A379697 3,2 %A A379697 _Ctibor O. Zizka_, Dec 30 2024