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.

A297038 Number of pieces in the list d(m), d(m-1), ..., d(0) of base-10 digits of n; see Comments.

This page as a plain text file.
%I A297038 #13 Mar 27 2025 11:07:29
%S A297038 0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
%T A297038 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
%U A297038 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2
%N A297038 Number of pieces in the list d(m), d(m-1), ..., d(0) of base-10 digits of n; see Comments.
%C A297038 The definition of "piece" starts with the base-b digits d(m), d(m-1), ..., d(0) of n.  First, an *ascent* is a list (d(i), d(i-1), ..., d(i-h)) such that d(i) < d(i-1) < ... < d(i-h), where d(i+1) >= d(i) if i < m, and d(i-h-1) >= d(i-h) if i > h.  A *descent* is a list (d(i), d(i-1), ..., d(i-h)) such that d(i) > d(i-1) > ... > d(i-h), where d(i+1) <= d(i) if i < m, and d(i-h-1) <= d(i-h) if i > h.  A *flat* is a list (d(i), d(i-1), ..., d(i-h)), where h > 0, such that d(i) = d(i-1) = ... = d(i-h), where d(i+1) != d(i) if i < m, and d(i-h-1) != d(i-h) if i > h. A *piece* is an ascent, a descent, or a flat.  Example:  235621103 has five pieces:  (2,3,5,6), (6,2,1), (1,1), (1,0), and (0,3); that's 2 ascents, 2 descents, and 1 flat. For every b, the "piece sequence" includes every positive integer infinitely many times. See A297030 for a guide to related sequences.
%H A297038 Clark Kimberling, <a href="/A297038/b297038.txt">Table of n, a(n) for n = 1..10000</a>
%e A297038 Base-10 digits for 123321:  1,2,3,3,2,1, so that a(123321) = 3.
%t A297038 a[n_, b_] := Length[Map[Length, Split[Sign[Differences[IntegerDigits[n, b]]]]]];
%t A297038 b = 10; Table[a[n, b], {n, 1, 1000}]
%Y A297038 Cf. A297030 (pieces), A296712 (rises and falls), A296882 (pits and peaks).
%K A297038 nonn,easy,base
%O A297038 1,100
%A A297038 _Clark Kimberling_, Jan 13 2018