|
|
A365314
|
|
Number of unordered pairs of distinct positive integers <= n that can be linearly combined using nonnegative coefficients to obtain n.
|
|
11
|
|
|
0, 0, 1, 3, 6, 8, 14, 14, 23, 24, 33, 28, 52, 36, 55, 58, 73, 53, 95, 62, 110, 94, 105, 81, 165, 105, 133, 132, 176, 112, 225, 123, 210, 174, 192, 186, 306, 157, 223, 218, 328, 180, 354, 192, 324, 315, 288, 216, 474, 260, 383, 311, 404, 254, 491, 338, 511, 360
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,4
|
|
COMMENTS
|
Is there only one case of nonzero adjacent equal parts, at position n = 6?
|
|
LINKS
|
|
|
EXAMPLE
|
We have 19 = 4*3 + 1*7, so the pair (3,7) is counted under a(19).
The a(2) = 1 through a(7) = 14 pairs:
(1,2) (1,2) (1,2) (1,2) (1,2) (1,2)
(1,3) (1,3) (1,3) (1,3) (1,3)
(2,3) (1,4) (1,4) (1,4) (1,4)
(2,3) (1,5) (1,5) (1,5)
(2,4) (2,3) (1,6) (1,6)
(3,4) (2,5) (2,3) (1,7)
(3,5) (2,4) (2,3)
(4,5) (2,5) (2,5)
(2,6) (2,7)
(3,4) (3,4)
(3,5) (3,7)
(3,6) (4,7)
(4,6) (5,7)
(5,6) (6,7)
|
|
MATHEMATICA
|
combs[n_, y_]:=With[{s=Table[{k, i}, {k, y}, {i, 0, Floor[n/k]}]}, Select[Tuples[s], Total[Times@@@#]==n&]];
Table[Length[Select[Subsets[Range[n], {2}], combs[n, #]!={}&]], {n, 0, 30}]
|
|
PROG
|
(Python)
from itertools import count
from sympy import divisors
a = set()
for i in range(1, n+1):
if not n%i:
a.update(tuple(sorted((i, j))) for j in range(1, n+1) if j!=i)
else:
for j in count(0, i):
if j > n:
break
k = n-j
for d in divisors(k):
if d>=i:
break
a.add((d, i))
|
|
CROSSREFS
|
For all subsets instead of just pairs we have A365073, complement A365380.
The case of positive coefficients is A365315, for all subsets A088314.
A004526 counts partitions of length 2, shift right for strict.
A364350 counts combination-free strict partitions.
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|