login
A380763
List triangular numbers up to increasingly large values and back down to 0.
1
0, 1, 0, 1, 3, 1, 0, 1, 3, 6, 3, 1, 0, 1, 3, 6, 10, 6, 3, 1, 0, 1, 3, 6, 10, 15, 10, 6, 3, 1, 0, 1, 3, 6, 10, 15, 21, 15, 10, 6, 3, 1, 0, 1, 3, 6, 10, 15, 21, 28, 21, 15, 10, 6, 3, 1, 0, 1, 3, 6, 10, 15, 21, 28, 36, 28, 21, 15, 10, 6, 3, 1, 0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 36, 28, 21, 15, 10, 6, 3, 1, 0, 1, 3, 6, 10, 15, 21, 28, 36, 45
OFFSET
0,5
COMMENTS
Analog of the pyramidal sequence A053615 = (0, 1; 0, 1, 2, 1; 0, 1, 2, 3, 2, 1; ...), but with (only) triangular numbers A000217 = (0, 1, 3, 6, 10, ...).
A simple nontrivial example of a sequence in which increasingly large values appear in order, but not all nonnegative integers appear.
RECORDS transform is A000217; RECORD INDICES transform (indices where records occur) is A000290, the squares.
FORMULA
a(n) = A000217(A053615(n)).
a(n) = A000217(m) for n = m^2; for n < m^2, a(n) <= A000217(m-1).
a(n) = 0 iff n = 2*A000217(k) for some k.
EXAMPLE
The triangular numbers are A000217 = (0, 1, 3, 6, 10, 15, ...)
This sequence lists these numbers up to the first, second, third, ... and back to 0 (excluded in order to not repeat): 0, 1; 0, 1, 3, 1; 0, 1, 3, 6, 3, 1; ....
PROG
(Python) A380763 = lambda n: (n := A053615(n))*(n+1)//2
(Python)
def A380763(upto = 999): # generator of the sequence
for m in range(0, 2*upto, 2):
for x in range(m): yield (x := min(x, m-x))*(x+1)//2
list(A380763(upto=5)) # first 4 "peaks"
list(a for a, _ in zip(A380763(), range(99))) # first 99 terms
CROSSREFS
Cf. A053615 (pyramidal sequence), A000217 (triangular numbers), A000290 (the squares: indices where records occur).
Sequence in context: A099905 A268441 A264435 * A356656 A085391 A394284
KEYWORD
nonn
AUTHOR
M. F. Hasler, Feb 01 2025
STATUS
approved