OFFSET
1,16
LINKS
FORMULA
EXAMPLE
Array T(n, k) begins:
n\k| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
---+------------------------------------------------------------
1| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
3| 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
4| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
5| 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
6| 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
7| 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
8| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
9| 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
10| 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
11| 3 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
12| 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
13| 3 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
PROG
(PARI) gpf(n) = if (n==1, 1, my (f=factor(n)); f[#f~, 1])
T(n, k) = my (p=prime(k)); for (d=0, oo, if (gpf(n-d) <= p || gpf(n+d) <= p, return (d)))
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Rémy Sigrist, Apr 29 2018
STATUS
approved