OFFSET
1,2
COMMENTS
Main diagonal is A047800.
LINKS
Peter Kagey, Table of n, a(n) for n = 1..10000
EXAMPLE
The 4 X 6 pegboard has 17 distinct distances: 0, 1, sqrt(2), 2, sqrt(5), sqrt(8), 3, sqrt(10), sqrt(13), 4, sqrt(17), sqrt(18), sqrt(20), 5, sqrt(26), sqrt(29), and sqrt(34).
+---+---+---+---+---+---+
| * | | | | 16| 25|
+---+---+---+---+---+---+
| 1 | 2 | | | 17| 26|
+---+---+---+---+---+---+
| 4 | 5 | 8 | | 20| 29|
+---+---+---+---+---+---+
| 9 | 10| 13| 18| | 34|
+---+---+---+---+---+---+
(As depicted, the pegs are at the center of each face.)
Square array begins:
n\k| 1 2 3 4 5 6 7 8
---+----------------------------------------
1| 1 2 3 4 5 6 7 8
2| 2 3 5 7 9 11 13 15
3| 3 5 6 9 12 15 18 21
4| 4 7 9 10 14 17 21 25
5| 5 9 12 14 15 19 24 29
6| 6 11 15 17 19 20 26 31
7| 7 13 18 21 24 26 27 33
8| 8 15 21 25 29 31 33 34
PROG
(Haskell)
import Data.List (nub)
a301851 n k = length $ nub [i^2 + j^2 | i <- [0..n-1], j <- [0..k-1]]
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Peter Kagey, Mar 27 2018
STATUS
approved