A375088 Mountain Sequence: Sequence that when expressed as non-overlapping mountains, the n-th term is the height and base of the n-th mountain.
1, 2, 1, 2, 3, 4, 3, 2, 1, 2, 1, 2, 3, 4, 3, 2, 3, 4, 5, 6, 5, 4, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 4, 5, 6, 5, 4, 3, 2, 3, 4, 3, 2, 1, 2, 1, 2, 3, 4, 3, 2, 1, 2, 1, 2, 3, 4, 3, 2, 3, 4, 5, 6, 5, 4, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 4, 5, 6, 5, 4, 3, 2, 3, 4, 3, 2, 3, 4, 5, 6, 5, 4, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4
Offset: 1
Examples
a(1) = 1, so the first non-overlapping mountain is 1, 2, 1 with h = b = 1. Now, a(2) = 2, so the mountain 2, 3, 4, 3, 2 with b = h = 2 is appended to the sequence, and so on.
Links
- Bryle Morga, Table of n, a(n) for n = 1..16384
- Bryle Morga, Visualization of the first 10,000,000 terms.
Programs
-
Python
from itertools import islice def mountain(h): return list(range(h, 2*h + 1)) + list(range(2*h-1, h-1, -1)) def agen(): a = [1, 2, 1] yield 1 i = 1 while 1: a += mountain(a[i]) yield a[i] i += 1 print(islice(agen(), 104))
Formula
|a(n+1) - a(n)| = 1.
Comments