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.

A365321 Number of pairs of distinct positive integers <= n that cannot be linearly combined with positive coefficients to obtain n.

This page as a plain text file.
%I A365321 #11 Sep 13 2023 06:05:01
%S A365321 0,0,1,2,4,6,10,13,18,24,30,37,46,54,63,77,85,99,111,127,141,161,171,
%T A365321 194,210,235,246,277,293,322,342,372,389,428,441,491,504,545,561,612,
%U A365321 635,680,701,753,773,836,846,911,932,1000,1017,1082,1103,1176,1193
%N A365321 Number of pairs of distinct positive integers <= n that cannot be linearly combined with positive coefficients to obtain n.
%C A365321 We consider (for example) that 2x + y + 3z is a positive linear combination of (x,y,z), but 2x + y is not, as the coefficient of z is 0.
%e A365321 For the pair p = (2,3) we have 4 = 2*2 + 0*3, so p is not counted under A365320(4), but it is not possible to write 4 as a positive linear combination of 2 and 3, so p is counted under a(4).
%e A365321 The a(2) = 1 through a(7) = 13 pairs:
%e A365321   (1,2)  (1,3)  (1,4)  (1,5)  (1,6)  (1,7)
%e A365321          (2,3)  (2,3)  (2,4)  (2,3)  (2,4)
%e A365321                 (2,4)  (2,5)  (2,5)  (2,6)
%e A365321                 (3,4)  (3,4)  (2,6)  (2,7)
%e A365321                        (3,5)  (3,4)  (3,5)
%e A365321                        (4,5)  (3,5)  (3,6)
%e A365321                               (3,6)  (3,7)
%e A365321                               (4,5)  (4,5)
%e A365321                               (4,6)  (4,6)
%e A365321                               (5,6)  (4,7)
%e A365321                                      (5,6)
%e A365321                                      (5,7)
%e A365321                                      (6,7)
%t A365321 combp[n_,y_]:=With[{s=Table[{k,i},{k,y},{i,1,Floor[n/k]}]},Select[Tuples[s],Total[Times@@@#]==n&]];
%t A365321 Table[Length[Select[Subsets[Range[n],{2}], combp[n,#]=={}&]],{n,0,30}]
%o A365321 (Python)
%o A365321 from itertools import count
%o A365321 from sympy import divisors
%o A365321 def A365321(n):
%o A365321     a = set()
%o A365321     for i in range(1,n+1):
%o A365321         for j in count(i,i):
%o A365321             if j >= n:
%o A365321                 break
%o A365321             for d in divisors(n-j):
%o A365321                 if d>=i:
%o A365321                     break
%o A365321                 a.add((d,i))
%o A365321     return (n*(n-1)>>1)-len(a) # _Chai Wah Wu_, Sep 12 2023
%Y A365321 The unrestricted version is A000217, ranks A001358.
%Y A365321 For strict partitions we have A088528, complement A088314.
%Y A365321 The (binary) complement is A365315, nonnegative A365314.
%Y A365321 For nonnegative coefficients we have A365320, for subsets A365380.
%Y A365321 For all subsets instead of just pairs we have A365322, complement A088314.
%Y A365321 A004526 counts partitions of length 2, shift right for strict.
%Y A365321 A007865 counts sum-free subsets, complement A093971.
%Y A365321 A179822 and A326080 count sum-closed subsets.
%Y A365321 A326083 and A124506 count combination-free subsets.
%Y A365321 A364350 counts combination-free strict partitions.
%Y A365321 A364914 and A365046 count combination-full subsets.
%Y A365321 Cf. A070880, A088571, A088809, A151897, A326020, A365043, A365073, A365311, A365312, A365378, A365380.
%K A365321 nonn
%O A365321 0,4
%A A365321 _Gus Wiseman_, Sep 06 2023