# Array generalizing A031165

Jonathan Post jvospost3 at gmail.com
Thu Aug 14 23:37:00 CEST 2008

```Since I see that A031165 has just been (re)edited, and comments
already read: "This sequence is the k=3 case of the family of
sequences a(k,n) = prime(n+k) - prime(n). See A001223 and A031131 for
k = 1 and 2."  it seems to me worth looking at the array a(k,n) =
prime(n+k) - prime(n) by value (rather than just by reference). Is
there anbything worth saying about it, or worth entering it as a seq
by antidiagonals?

.......|n=1.|.n=2.|.n=3.|.n=4.|.n=5.|.n=6.|.n=7.|.n=8.|.n=9.|.n=10.|.n=11.|.n=12.|.n=13.|.n=14.|.n=15.|.n=16.|.n=17.|.n=18.|.n=19.|.n=20.|.
k=1.|...1..|...2...|...2...|...4..|...2...|...4...|...2...|...4...|...6..|.....2...|....6....|....4...|....2...|.....4...|....6...|...6.....|....2...|....6....|....4...|...2..|.A001223
k=2.|...4..|...6...|...6...|...6..|...6...|...6...|..10..|...8...|...8...|...10..|....6....|....6...|..10...|...12...|....8...|...8.....|..10...|.....6....|....8...|..10..|.A031131
k=3.|...5..|...8...|...8...|..10.|...8...|..10..|..12...|..12..|..14..|...12..|..12....|...10...|..12..|...16...|...14..|...14...|...12..|...12.....|...12...|..12..|.A031165
k=4.|...9..|..10..|..12...|..12..|.12..|..16..|..14..|...18..|..18..|...14..|..16...|....16...|..18..|...18...|...20..|...18...|...14..|...18.....|...16...|..18..|.new
k=5.|..11.|..14..|..14...|..16..|.18..|..18..|..20...|..22..|..20...|..18..|...22..|....22...|..20..|...24....|..24..|...20...|...20..|...22......|..22...|..26..|.new
k=6.|..15.|..16..|..18...|..22..|.20.|...24..|..24...|..24..|..24...|..24..|...28..|....24...|..26..|...28....|..26,.|...26...|...24..|..28.......|..30...|..30.|.new

and so forth.
The n=1 column is 1,4,5,9,11,15,... which is not in OEIS.
The main diagonal is 1, 6, 8, 12, 18, 24,... which is not in OEIS

For instance, we get the k=4 case this way

In[3]:= t = Array[Prime, 75]; Drop[t, 4] - Drop[t, -4]

Out[3]= {9, 10, 12, 12, 12, 16, 14, 18, 18, 14, 16, 16, 18, 18, 20,
18, 14, 18, 16, 18, 24, 22, 20, 18, 12, 12, 24,

>    24, 28, 26, 22, 20, 20, 24, 18, 22, 22, 18, 24, 20, 18, 18, 20, 30, 30, 30, 22, 16, 14, 22, 24, 24, 28, 20,

>    20, 18, 14, 22, 30, 30, 30, 24, 24, 26, 34, 32, 22, 22, 20, 24, 26}

and the k=5 case

In[4]:= t = Array[Prime, 75]; Drop[t, 5] - Drop[t, -5]

Out[4]= {11, 14, 14, 16, 18, 18, 20, 22, 20, 18, 22, 22, 20, 24, 24,
20, 20, 22, 22, 26, 28, 24, 24, 20, 16, 26,

>    28, 30, 30, 36, 24, 26, 26, 28, 24, 28, 24, 28, 26, 24, 20, 30, 32, 34, 32, 34, 28, 18, 24, 28, 30, 30, 30,

>    26, 24, 20, 24, 36, 34, 32, 34, 38, 30, 36, 36, 36, 28, 30, 26, 30}

and n=6
In[5]:= t = Array[Prime, 75]; Drop[t, 6] - Drop[t, -6]

Out[5]= {15, 16, 18, 22, 20, 24, 24, 24, 24, 24, 28, 24, 26, 28, 26,
26, 24, 28, 30, 30, 30, 28, 26, 24, 30, 30,

>    34, 32, 40, 38, 30, 32, 30, 34, 30, 30, 34, 30, 30, 26, 32, 42, 36, 36, 36, 40, 30, 28, 30, 34, 36, 32, 36,

>    30, 26, 30, 38, 40, 36, 36, 48, 44, 40, 38, 40, 42, 36, 36, 32}

```