cp's OEIS Frontend

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.

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.

This page as a plain text file.
%I A375088 #22 Jul 30 2024 15:21:03
%S A375088 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,
%T A375088 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,
%U A375088 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
%N 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.
%C A375088 A mountain with base b and height h is a segment starting with b, then climbs to b+h, and goes back to b. So as an example, (1, 2, 3, 2, 1) is a mountain with base of 1 and height of 2.
%C A375088 All positive integers appear in the sequence infinitely many times.
%H A375088 Bryle Morga, <a href="/A375088/b375088.txt">Table of n, a(n) for n = 1..16384</a>
%H A375088 Bryle Morga, <a href="/A375088/a375088.png">Visualization of the first 10,000,000 terms.</a>
%F A375088 |a(n+1) - a(n)| = 1.
%e A375088 a(1) = 1, so the first non-overlapping mountain is 1, 2, 1 with h = b = 1.
%e A375088 Now, a(2) = 2, so the mountain 2, 3, 4, 3, 2 with b = h = 2 is appended to the sequence, and so on.
%o A375088 (Python)
%o A375088 from itertools import islice
%o A375088 def mountain(h):
%o A375088     return list(range(h, 2*h + 1)) + list(range(2*h-1, h-1, -1))
%o A375088 def agen():
%o A375088     a = [1, 2, 1]
%o A375088     yield 1
%o A375088     i = 1
%o A375088     while 1:
%o A375088        a += mountain(a[i])
%o A375088        yield a[i]
%o A375088        i += 1
%o A375088 print(islice(agen(), 104))
%K A375088 nonn,look
%O A375088 1,2
%A A375088 _Bryle Morga_, Jul 29 2024