login
Numbers n such that 1/n is a difference of Egyptian fractions with all denominators < n.
2

%I #40 Jul 29 2020 05:08:58

%S 6,12,15,18,20,21,24,28,30,33,35,36,40,42,44,45,48,52,54,55,56,60,63,

%T 65,66,68,70,72,75,76,77,78,80,84,85,88,90,91,95,96,99,100,102,104,

%U 105,108,110,112,114,115,117,119,120,126,130,132,133,135,136,138,140,143,144,145,147,150,152,153

%N Numbers n such that 1/n is a difference of Egyptian fractions with all denominators < n.

%C Numbers n such that we can write 1/n = Sum_{1<=k<n} c(k)/k with all c(k) in {-1,0,1}.

%C Numbers n such that A072207(n) < 2*A072207(n-1).

%C If n is in the sequence, so is k*n for all k>1 (cf. A328226).

%C Contains A001284, because 1/(m*k) = 1/(m*(k-m))-1/(k*(k-m)).

%C Disjoint from A000961.

%C 2*p^k with p prime is in the sequence if and only if p=3.

%C 3*p^k with p prime is in the sequence if and only if p=2,5,7 or 11.

%C 4*p^k with p prime is in the sequence if and only if p=3,5,7,11,13,17 or 19.

%C For each m that is not a term, there are only finitely many primes p such that some m*p^k is a term. [Corrected by _Max Alekseyev_, Oct 08 2019]

%H Robert Israel, <a href="/A278638/b278638.txt">Table of n, a(n) for n = 1..431</a>

%H Robert Israel, <a href="/A278638/a278638_1.txt">Examples for n = 1..431</a>

%H Robert Israel, <a href="https://math.stackexchange.com/q/2029163">1/n as a difference of Egyptian fractions with all denominators < n</a>, Math StackExchange, 2017.

%e 44 is in the sequence because 1/44 = (1/12 + 1/33) - 1/11.

%e 4 is not in the sequence because 1/4 can't be written as the difference of sums of two subsets of {1, 1/2, 1/3}.

%p N:= 200: # to get all terms <= N

%p V:= Vector(N):

%p f:= proc(n) option remember;

%p local F,E,p,e,k,m,L,L1,i,s,t,sg,Maybe;

%p global Rep;

%p F:= numtheory:-factorset(n);

%p if nops(F) = 1 then return false fi;

%p if ormap(m -> n < m^2 and m^2 < 2*n, numtheory:-divisors(n)) then

%p for m in numtheory:-divisors(n) do

%p if n < m^2 and m^2 < 2*n then

%p k:= n/m; Rep[n]:= [m*(k-m),-k*(k-m)]; return true

%p fi

%p od

%p fi;

%p F:= convert(F,list);

%p E:= map(p -> padic:-ordp(n,p), F);

%p i:= max[index](zip(`^`,F,E));

%p p:= F[i];

%p e:= E[i];

%p k:= n/p^e;

%p Maybe:= false;

%p for i from 3^(k-1) to 2*3^(k-1)-1 do

%p L:= (-1) +~ convert(i,base,3);

%p s:= 1/k - add(L[i]/i,i=1..k-1);

%p if numer(s) mod p = 0 then

%p Maybe:= true;

%p t:= abs(s/p^e); sg:= signum(s);

%p if (numer(t) <= 1 and (denom(t) < n or (denom(t) < N and V[denom(t)] = 1))) or (numer(t) = 2 and denom(t) < N and V[denom(t)] = 1) then

%p L1:= subs(0=NULL, [seq(L[i]*i*p^e,i=1..k-1)]);

%p if t = 0 then ;

%p elif numer(t) = 1 and denom(t) < n then L1:= [op(L1),sg/t]

%p elif procname(2/t) then

%p L1:= ([op(L1), 2*sg/t, op(expand(sg*Rep[2/t]))])

%p else next

%p fi;

%p if max(abs~(L1)) < n then Rep[n]:= L1; return true fi;

%p fi;

%p fi

%p od:

%p if Maybe then printf("Warning: %d is uncertain\n",n)

%p else false

%p fi;

%p end proc:

%p for n from 6 to N do

%p if V[n] = 0 and f(n) then

%p V[n] := 1;

%p for j from 2*n to N by n do

%p if not assigned(Rep[j]) then

%p V[j]:= 1;

%p Rep[j] := map(`*`,Rep[n],j/n);

%p f(j):= true;

%p fi

%p od;

%p fi;

%p od:

%p select(t -> V[t]=1,[$6..N]);

%t sol[n_] := Module[{c, cc}, cc = Array[c, n-1]; FindInstance[AllTrue[cc, -1 <= # <= 1&] && 1/n == Total[cc/Range[n-1]], cc, Integers, 1]];

%t Reap[For[n = 6, n <= 200, n++, If[sol[n] != {}, Print[n]; Sow[n]]]][[2, 1]] (* _Jean-François Alcover_, Jul 29 2020 *)

%Y Cf. A000961, A001284, A072207.

%Y Contains A005279. - _Robert G. Wilson v_, Nov 27 2016

%K nonn

%O 1,1

%A _Robert Israel_, Nov 24 2016