%I #43 Nov 26 2019 04:17:37
%S 4,8,10,13,14,16,19,20,21,22,26,28,30,32,34,38,39,40,43,44,46,50,52,
%T 53,56,58,60,62,63,64,68,70,72,74,76,80,82,86,88,89,90,92,94,98,99,
%U 100,103,104,106,110,111,112,116,117,118,122,124,128,130,132,134,135
%N Numbers m such that sum of its i first divisors equals the sum of its j first non-divisors for some i, j.
%C Or numbers m such that Sum_{k=1..i} d(k) = Sum_{k=1..j} nd(k) for some i, j where d(k) are the i first divisors and nd(k) the j non-divisors of m.
%C The corresponding sums are 3, 3, 3, 14, 3, 3, 20, 3, 11, 3, 3, (3 or 14), 11, 3, 3, 3, 17, 3, 44, 3, 3, 3, 3, 54, 3, 3, 15, 3, 11, 3, 3, 3, 33, 3, 3, 3, ... containing the set of primes {3, 11, 17, 23, 29, 37, 41, 43, 53, 59, 61, 71, 79, ...}.
%C The equality Sum_{k=1..i} d(k) = Sum_{k=1..j} nd(k) is not always unique, for instance for a(12) = 28, we find 1 + 2 = 3 and 1 + 2 + 4 + 7 = 3 + 5 + 6 = 14.
%C The primes of the sequence are 13, 19, 43, 53, 89, 103, 151, 229, 251, 349, 433, ... (primes of the form k(k+1)/2 - 2; see A124199).
%C +-----+-----+-----+------+-----------------------------------------+
%C | n | i | j | a(n) | Sum_{k=1..i} d(k) = Sum_{k=1..j} nd(k) |
%C +-----+-----+-----+------+-----------------------------------------+
%C | 1 | 2 | 1 | 4 | 1 + 2 = 3 |
%C | 2 | 2 | 1 | 8 | 1 + 2 = 3 |
%C | 3 | 2 | 1 | 10 | 1 + 2 = 3 |
%C | 4 | 2 | 4 | 13 | 1 + 13 = 2 + 3 + 4 + 5 = 14 |
%C | 5 | 2 | 1 | 14 | 1 + 2 = 3 |
%C | 6 | 2 | 1 | 16 | 1 + 2 = 3 |
%C | 7 | 2 | 5 | 19 | 1 + 19 = 2 + 3 + 4 + 5 + 6 = 20 |
%C | 8 | 2 | 1 | 20 | 1 + 2 = 3 |
%C | 9 | 3 | 3 | 21 | 1 + 3 + 7 = 2 + 4 + 5 = 11 |
%C | 10 | 2 | 1 | 22 | 1 + 2 = 3 |
%C | 11 | 2 | 1 | 26 | 1 + 2 = 3 |
%C | 12 | 2 | 1 | 28 | 1 + 2 = 3 |
%C | | 4 | 3 | 28 | 1 + 2 + 4 + 7 = 3 + 5 + 6 = 14 |
%C | 13 | 4 | 2 | 30 | 1 + 2 + 3 + 5 = 4 + 7 = 11 |
%C | 14 | 2 | 1 | 32 | 1 + 2 = 3 | (End)
%H Amiram Eldar, <a href="/A295265/b295265.txt">Table of n, a(n) for n = 1..10000</a>
%e 30 is in the sequence because d(1) + d(2) + d(3) + d(4) = 1 + 2 + 3 + 5 = 11 and nd(1) + nd(2) = 4 + 7 = 11.
%p with(numtheory):nn:=300:
%p for n from 1 to nn do:
%p d:=divisors(n):n0:=nops(d):lst:={}:ii:=0:
%p for i from 1 to n do:
%p lst:=lst union {i}:
%p od:
%p lst:=lst minus d:n1:=nops(lst):
%p for m from 1 to n0 while(ii=0) do:
%p s1:=sum(‘d[i]’, ‘i’=1..m):
%p for j from 1 to n1 while(ii=0) do:
%p s2:=sum(‘lst[i]’, ‘i’=1..j):
%p if s1=s2
%p then
%p ii:=1:printf(`%d, `,n):
%p else
%p fi:
%p od:
%p od:
%p od:
%t fQ[n_] := Block[{d = Divisors@ n}, nd = nd = Complement[Range@ n, d]; Intersection[Accumulate@ d, Accumulate@ nd] != {}]; Select[ Range@135, fQ] (* _Robert G. Wilson v_, Mar 06 2018 *)
%o (PARI) isok(n) = {d = divisors(n); psd = vector(#d, k, sum(j=1, k, d[j])); nd = setminus([1..n], d); psnd = vector(#nd, k, sum(j=1, k, nd[j])); #setintersect(psd, psnd) != 0;} \\ _Michel Marcus_, May 05 2018
%Y Cf. A064510, A124199, A185729, A240698.
%K nonn
%O 1,1
%A _Michel Lagneau_, Feb 22 2018