login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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
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,2
COMMENTS
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.
FORMULA
a(n) = 0 for n from A000217.
a(n) = 1 for n from A074377 AND n is not a triangular number.
EXAMPLE
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.
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 *)
PROG
(PARI) a(n) = my(k=0); while (!ispolygonal((k + 1)*(2*n + k)/2, 3), k++); k; \\ Michel Marcus, Dec 30 2024
CROSSREFS
KEYWORD
nonn,new
AUTHOR
Ctibor O. Zizka, Dec 30 2024
STATUS
approved