cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A365314 Number of unordered pairs of distinct positive integers <= n that can be linearly combined using nonnegative coefficients to obtain n.

This page as a plain text file.
%I A365314 #25 Sep 13 2023 05:58:51
%S A365314 0,0,1,3,6,8,14,14,23,24,33,28,52,36,55,58,73,53,95,62,110,94,105,81,
%T A365314 165,105,133,132,176,112,225,123,210,174,192,186,306,157,223,218,328,
%U A365314 180,354,192,324,315,288,216,474,260,383,311,404,254,491,338,511,360
%N A365314 Number of unordered pairs of distinct positive integers <= n that can be linearly combined using nonnegative coefficients to obtain n.
%C A365314 Is there only one case of nonzero adjacent equal parts, at position n = 6?
%H A365314 Chai Wah Wu, <a href="/A365314/b365314.txt">Table of n, a(n) for n = 0..10000</a>
%e A365314 We have 19 = 4*3 + 1*7, so the pair (3,7) is counted under a(19).
%e A365314 The a(2) = 1 through a(7) = 14 pairs:
%e A365314   (1,2)  (1,2)  (1,2)  (1,2)  (1,2)  (1,2)
%e A365314          (1,3)  (1,3)  (1,3)  (1,3)  (1,3)
%e A365314          (2,3)  (1,4)  (1,4)  (1,4)  (1,4)
%e A365314                 (2,3)  (1,5)  (1,5)  (1,5)
%e A365314                 (2,4)  (2,3)  (1,6)  (1,6)
%e A365314                 (3,4)  (2,5)  (2,3)  (1,7)
%e A365314                        (3,5)  (2,4)  (2,3)
%e A365314                        (4,5)  (2,5)  (2,5)
%e A365314                               (2,6)  (2,7)
%e A365314                               (3,4)  (3,4)
%e A365314                               (3,5)  (3,7)
%e A365314                               (3,6)  (4,7)
%e A365314                               (4,6)  (5,7)
%e A365314                               (5,6)  (6,7)
%t A365314 combs[n_,y_]:=With[{s=Table[{k,i},{k,y},{i,0,Floor[n/k]}]},Select[Tuples[s],Total[Times@@@#]==n&]];
%t A365314 Table[Length[Select[Subsets[Range[n],{2}], combs[n,#]!={}&]],{n,0,30}]
%o A365314 (Python)
%o A365314 from itertools import count
%o A365314 from sympy import divisors
%o A365314 def A365314(n):
%o A365314     a = set()
%o A365314     for i in range(1,n+1):
%o A365314         if not n%i:
%o A365314             a.update(tuple(sorted((i,j))) for j in range(1,n+1) if j!=i)
%o A365314         else:
%o A365314             for j in count(0,i):
%o A365314                 if j > n:
%o A365314                     break
%o A365314                 k = n-j
%o A365314                 for d in divisors(k):
%o A365314                     if d>=i:
%o A365314                         break
%o A365314                     a.add((d,i))
%o A365314     return len(a) # _Chai Wah Wu_, Sep 12 2023
%Y A365314 The unrestricted version is A000217, ranks A001358.
%Y A365314 For all subsets instead of just pairs we have A365073, complement A365380.
%Y A365314 For strict partitions we have A365311, complement A365312.
%Y A365314 The case of positive coefficients is A365315, for all subsets A088314.
%Y A365314 The binary complement is A365320, positive A365321.
%Y A365314 For partitions we have A365379, complement A365378.
%Y A365314 A004526 counts partitions of length 2, shift right for strict.
%Y A365314 A007865 counts sum-free subsets, complement A093971.
%Y A365314 A179822 and A326080 count sum-closed subsets.
%Y A365314 A364350 counts combination-free strict partitions.
%Y A365314 A364914/A365046 count combination-full subsets, complement A326083/A124506.
%Y A365314 Cf. A070880, A088809, A151897, A326020, A365043, A365322, A365383.
%K A365314 nonn
%O A365314 0,4
%A A365314 _Gus Wiseman_, Sep 05 2023