A225253 Number of distinct values of the sum of 2 products of two 0..n integers.
1, 3, 8, 16, 27, 42, 59, 81, 105, 134, 167, 203, 241, 285, 331, 381, 436, 495, 556, 622, 690, 764, 841, 920, 1002, 1091, 1184, 1279, 1378, 1482, 1588, 1700, 1813, 1932, 2053, 2177, 2308, 2443, 2579, 2719, 2862, 3012, 3164, 3322, 3481, 3645, 3814, 3985, 4158, 4339
Offset: 0
Keywords
Examples
a(3) = 16 as the possible products i*j where 0 <= i, j <= 3 are 0, 1, 2, 3, 4, 6, 9. From these numbers we can find the 16 distinct sums, listed with a few examples, 0, 1, 2, 3, 4, 5, 6, 7 = 3+4, 8, 9, 10, 11, 12 = 6+6, 13 = 4+9, 15, 18. - _David A. Corneth_, Sep 07 2023
Links
- David A. Corneth, Table of n, a(n) for n = 0..3000 (first 999 terms from R. H. Hardin)
- David A. Corneth, PARI program
Programs
-
PARI
a(n) = #setbinop((x,y)->x+y, setbinop((x,y)->x*y, [0..n])); \\ Michel Marcus, Sep 06 2023
-
PARI
\\ See PARI link. David A. Corneth, Sep 07 2023
-
Python
from itertools import combinations_with_replacement def A225253(n): return len({x+y for x,y in combinations_with_replacement({i*j for i in range(n+1) for j in range(i+1)},2)}) # Chai Wah Wu, Oct 13 2023
Extensions
a(0)=1 prepended by Alois P. Heinz, Oct 13 2023
Comments