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.
%I A135642 #34 Aug 06 2022 07:15:05 %S A135642 110,120,121,122,130,131,132,133,134,140,141,142,143,144,145,146,150, %T A135642 151,152,153,154,155,156,157,158,160,161,162,163,164,165,166,167,168, %U A135642 169,170,171,172,173,174,175,176,177,178,179,180,181,182 %N A135642 Concave numbers. %C A135642 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. %C A135642 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 %C A135642 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 %H A135642 Rémy Sigrist, <a href="/A135642/b135642.txt">Table of n, a(n) for n = 1..10000</a> %e A135642 The number 12221 is a concave number. Note that the number of this sequence (A135642) is also a concave number as shown below: %e A135642 . %e A135642 9 . . . . . . . . . . . . %e A135642 8 . . . . . . . . . . . . %e A135642 7 . . . . . . . . . . . . %e A135642 6 . . . x . . . . . 6 . . %e A135642 5 . . x . . . . . 5 . . . %e A135642 4 . . . . x . . . . . 4 . %e A135642 3 . x . . . . . 3 . . . . %e A135642 2 . . . . . x . . . . . 2 %e A135642 1 x . . . . . 1 . . . . . %e A135642 0 . . . . . . . . . . . . %e A135642 . %e A135642 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 %t A135642 concaveQ[n_] := With[{dd = IntegerDigits[n]}, AllTrue[SequencePosition[dd, {_, _, _}][[All, 1]], dd[[#]] + dd[[#+2]] < 2 dd[[#+1]]&]]; %t A135642 Select[Range[100, 200], concaveQ] (* _Jean-François Alcover_, Nov 01 2018 *) %o A135642 (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 */ %o A135642 (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 %Y A135642 Cf. A135600, A135601, A135602, A135603, A135641, A135643, A163278. %K A135642 nonn,easy,base %O A135642 1,1 %A A135642 _Omar E. Pol_, Nov 30 2007