login
Triangle read by rows in which row n lists differences between prime(n) and prime(k) for 1 <= k <= n.
5

%I #11 Aug 08 2017 08:18:55

%S 0,1,0,3,2,0,5,4,2,0,9,8,6,4,0,11,10,8,6,2,0,15,14,12,10,6,4,0,17,16,

%T 14,12,8,6,2,0,21,20,18,16,12,10,6,4,0,27,26,24,22,18,16,12,10,6,0,29,

%U 28,26,24,20,18,14,12,8,2,0,35,34,32,30,26,24,20,18,14,8,6,0

%N Triangle read by rows in which row n lists differences between prime(n) and prime(k) for 1 <= k <= n.

%C Primes in this sequence are of course twin primes.

%H Michel Marcus, <a href="/A086800/b086800.txt">Rows n=1..100 of triangle, flattened</a>

%e 2-2=0; 3-2=1, 3-3=0; 5-2=3, 5-3=2, 5=5=5; 7-2=5, 7-3=4, 7-5=2, 7-7=0, ...

%e 0;

%e 1, 0;

%e 3, 2, 0;

%e 5, 4, 2, 0;

%e 9, 8, 6, 4, 0;

%e 11, 10, 8, 6, 2, 0;

%e 15, 14, 12, 10, 6, 4, 0;

%e 17, 16, 14, 12, 8, 6, 2, 0;

%o (PARI) fn(n) = forprime(x=2,n, forprime(y=2,x,print1(x-y",")))

%o (PARI) T(n, k) = prime(n) - prime(k);

%o tabl(nn) = for (n=1, nn, for (k=1, n, print1(T(n, k), ", ")); print); \\ _Michel Marcus_, Aug 08 2017

%Y Cf. A040976 (1st column).

%K easy,tabl,nonn

%O 1,4

%A _Cino Hilliard_, Aug 05 2003

%E Offset corrected by _Michel Marcus_, Aug 08 2017