OFFSET
1,4
EXAMPLE
a(5) = 5 because:
Products: Sums:
* | 1 | 2 | 3 | 4 | 5 + | 1 | 2 | 3 | 4 | 5
------------------------- -----------------------
1 | 1 | 2 | 3 | 4 | 5 1 | 2 | 3 | 4 | 5 | 6
2 | 2 | 4 | 6 | 8 | 10 2 | 3 | 4 | 5 | 6 | 7
3 | 3 | 6 | 9 | 12 | 15 3 | 4 | 5 | 6 | 7 | 8
4 | 4 | 8 | 12 | 16 | 20 4 | 5 | 6 | 7 | 8 | 9
5 | 5 | 10 | 15 | 20 | 25 5 | 6 | 7 | 8 | 9 | 10
The number of distinct products [1,2,3,4,5,6,8,9,10,12,15,16,20,25] is 14.
The number of distinct sums [2,3,4,5,6,7,8,9,10] is 9.
So a(5) = 14 - 9 = 5.
PROG
(Python)
A027424 = lambda n: len({i*j for i in range(1, n+1) for j in range(1, i+1)})
a = lambda n: A027424(n)-((n<<1)-1)
print([a(n) for n in range(1, 58)])
(PARI) a(n) = #setbinop((x, y)->x*y, vector(n, i, i)) - 2*n + 1; \\ Michel Marcus, Jun 23 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Darío Clavijo, Jun 22 2024
STATUS
approved