# Re New Transforms

N. J. A. Sloane njas at research.att.com
Tue Jan 4 21:06:52 CET 2000

```Implicit in Christian Bower's helpful comments was the notion
that the set of all differences of a sequence is another
transform worth including:  Thus:

# Calculate all differences of a sequence
ALLDIFFS:=proc(a)  local b,i,j:
if whattype(a) <> list then RETURN([]); fi:
if nops(a) <= 1 then RETURN([]); fi:
b:={}:
for i from 1 to nops(a)-1 do
for j from i+1 to nops(a) do b:={op(b), a[j]-a[i] }: od: od:
RETURN(sort(convert(b,list)));
end:

applying this to the primes and taking the complement gives

%I A007921
%S A007921 7,13,19,23,25,31,33,37,43,47,49,53,55,61,63,67,73,75,79,83,85,
%T A007921 89,91,93,97,103,109,113,115,117,119,121,123,127,131,133,139,141,
%U A007921 143,145,151,153,157,159,163,167,169,173,175,181,183,185,187,193
%N A007921 Not the difference of two primes.
%K A007921 nonn,easy,nice
%O A007921 1,1
%A A007921 R. Muller (smarandache%eccx.dnet at esu36.ateng.az.honeywell.COM)
%D A007921 F. Smarandache, "Only Problems, not Solutions!", Xiquan Publ., Phoenix-Chicago, 1993
%H A007921 <a href="http://www.gallup.unm.edu/~smarandache/">Smarandache web site</a>

applying it to the Catalan numbers gives the new

%I A047075
%S A047075 0,1,3,4,9,12,13,28,37,40,41,90,118,127,130,131,297,387,415,424,
%T A047075 427,428,1001,1298,1388,1416,1425,1428,1429,3432,4433,4730,4820,
%U A047075 4848,4857,4860,4861,11934,15366,16367,16664,16754,16782,16791
%N A047075 All differences C(j)-C(i), j>i, of Catalan numbers A000108.
%O A047075 0,3
%K A047075 nonn
%A A047075 njas, Jan 04 2000

Of course this transform isn't to be confused with "take first differences"
which is

# Calculate first differences of a sequence
DIFF:=proc(a)  local b,i:
if whattype(a) <> list then RETURN([]); fi:
if nops(a) <= 1 then RETURN([]); fi:
b:=[]:
for i from 2 to nops(a) do b:=[op(b), a[i]-a[i-1] ]: od:
RETURN(b);
end:

NJAS

```