OFFSET
1,1
COMMENTS
The structure of digits represents a concave function or a concave object. In the graphic representation the points are connected by imaginary line segments from left to right.
Only strictly concave numbers are included in this sequence; the interpolation between at least one pair of digits must be strictly less than some intermediate digit. - Franklin T. Adams-Watters, Jan 26 2014
Also numbers where the second difference of consecutive digits is at most 0 and at least one of the second differences is negative. - David A. Corneth, Aug 02 2022
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
EXAMPLE
The number 12221 is a concave number. Note that the number of this sequence (A135642) is also a concave number as shown below:
.
9 . . . . . . . . . . . .
8 . . . . . . . . . . . .
7 . . . . . . . . . . . .
6 . . . x . . . . . 6 . .
5 . . x . . . . . 5 . . .
4 . . . . x . . . . . 4 .
3 . x . . . . . 3 . . . .
2 . . . . . x . . . . . 2
1 x . . . . . 1 . . . . .
0 . . . . . . . . . . . .
.
Another example is 1342. On the other hand, 3124 is not in the sequence, it's in A135641. 1234 is not in the sequence, it's in A135643. 1243 is not in the sequence, it's in A163278. - Omar E. Pol, Jan 29 2014
MATHEMATICA
concaveQ[n_] := With[{dd = IntegerDigits[n]}, AllTrue[SequencePosition[dd, {_, _, _}][[All, 1]], dd[[#]] + dd[[#+2]] < 2 dd[[#+1]]&]];
Select[Range[100, 200], concaveQ] (* Jean-François Alcover, Nov 01 2018 *)
PROG
(PARI) { isconcave(n) = my(t, r); t=eval(Vec(Str(n))); r=0; for(i=1, #t, for(j=i+2, #t, for(k=i+1, j-1, if( t[k]*(j-i) < t[i]*(j-k) + t[j]*(k-i), return(0)); if( t[k]*(j-i) > t[i]*(j-k) + t[j]*(k-i), r=1); ))); r } /* Franklin T. Adams-Watters and Max Alekseyev, Jan 30 2014 */
(PARI) is(n) = if(n<100, return(0)); my(d=digits(n), v=vector(#d-2, i, d[i+2] - 2*d[i+1] + d[i])); v=Set(v); v[1] < 0 && v[#v] <= 0 \\ David A. Corneth, Aug 02 2022
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Omar E. Pol, Nov 30 2007
STATUS
approved