# convexity sequences

N. J. A. Sloane njas at research.att.com
Wed May 12 16:28:49 CEST 1999

```Given a function f, one can always
get a triangular array by

a(m,n) = f(m+n)-f(m)-f(n)

which studies how close f is to being convex.

For example:

%I A047885
%S A047885 0,0,0,0,1,0,0,1,1,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,
%T A047885 0,1,0,0,0,0,1,0,1,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,1,2,1,
%U A047885 2,1,2,1,0,0
%V A047885 0,0,0,0,1,0,0,1,1,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,-1,0,0,0,0,1,0,0,0,
%W A047885 0,1,0,0,0,0,-1,0,-1,0,0,0,0,0,-1,-1,-1,-1,-1,-1,0,0,0,0,-1,-2,-1,
%X A047885 -2,-1,-2,-1,0,0
%N A047885 Array a(m,n) = pi(m+n)-pi(m)-pi(n) read by antidiagonals, where pi() = A000720 (m,m>=0).
%O A047885 0,59
%K A047885 sign,done,tabl,easy,nice
%e A047885 Beginning of array is
%e A047885 0 0 0 0 0 0 0 0 ...
%e A047885 0 1 1 0 1 0 1 0 ...
%e A047885 0 1 0 0 0 0 -1 ...
%e A047885 0 0 0 -1 0 -1 -1 ...
%A A047885 njas

That creates a square array, symmetric about the main diagonal.
However, it is probably better just to give the part
on or below the main diagonal, which is a triangular array,
and gives a different kind of sequence:

%I A047886
%S A047886 0,0,1,0,1,0,0,0,0,1,0,1,0,0,0,0,0,0,1,1,2,0,0,0,1,1,2,0,1,0,
%T A047886 1,1,1,1,0,0,1,2,1,2,1,2
%V A047886 0,0,1,0,1,0,0,0,0,-1,0,1,0,0,0,0,0,0,-1,-1,-2,0,0,0,-1,-1,-2,0,1,0,
%W A047886 -1,-1,-1,-1,0,0,-1,-2,-1,-2,-1,-2
%N A047886 Triangle a(n,k) = pi(n+k)-pi(n)-pi(k), where pi() = A000720 (n>=0, 0<=k<=n).
%O A047886 0,21
%K A047886 sign,done,tabl,easy,more
%A A047886 njas

I think i prefer the second version, but i will put both versions
into the table.

NJAS

```