A379697 For n >= 3, a(n) is the least k >= 0 such that (k + 1)*(2*n + k) / 2 is a triangular number (A000217).
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, 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, 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
Offset: 3
Examples
n = 4: the least k >= 0 such that (k + 1)*(8 + k)/2 is a triangular number is k = 2, thus a(4) = 2. n = 6: the least k >= 0 such that (k + 1)*(12 + k)/2 is a triangular number is k = 0, thus a(6) = 0.
Links
- Robert Israel, Table of n, a(n) for n = 3..10000
Programs
-
Maple
f:= proc(n) local t, alpha, beta; t:= n^2-n; alpha:= convert(select(type, numtheory:-divisors(t),odd),list); beta:= map(s -> (s+t/s - 1)/2 - n, alpha); min(select(`>=`,beta,0)) end proc: map(f, [$3..100]); # Robert Israel, Jan 30 2025
-
Mathematica
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 *)
-
PARI
a(n) = my(k=0); while (!ispolygonal((k + 1)*(2*n + k)/2, 3), k++); k; \\ Michel Marcus, Dec 30 2024
Comments