A032858 Numbers whose base-3 representation Sum_{i=0..m} d(i)*3^i has d(m) > d(m-1) < d(m-2) > ...
0, 1, 2, 3, 6, 7, 10, 11, 19, 20, 23, 30, 33, 34, 57, 60, 61, 69, 70, 91, 92, 100, 101, 104, 172, 173, 181, 182, 185, 208, 209, 212, 273, 276, 277, 300, 303, 304, 312, 313, 516, 519, 520, 543, 546, 547, 555, 556, 624, 627, 628, 636, 637
Offset: 1
Examples
The base-3 representation of the initial terms is 0, 1, 2, 10, 20, 21, 101, 102, 201, 202, 212, 1010, 1020, 1021, 2010, 2020, 2021, 2120, 2121, 10101, 10102, ...
Links
- M. F. Hasler, Table of n, a(n) for n = 1..5000
Crossrefs
Programs
-
Mathematica
sdQ[n_]:=Module[{s=Sign[Differences[IntegerDigits[n, 3]]]}, s==PadRight[{}, Length[s], {-1, 1}]]; Select[Range[0, 700], sdQ] (* Vincenzo Librandi, Oct 06 2018 *)
-
PARI
is(n,b=3)=!for(i=2,#n=digits(n,b),(n[i-1]-n[i])*(-1)^i>0||return) \\ M. F. Hasler, Oct 05 2018
Formula
Extensions
Definition edited, cross-references and a(1) = 0 inserted by M. F. Hasler, Oct 05 2018
Comments