login
a(n) is the number of ways n can be written as x + y with x >= y, x and y coprime, and so that the distinct prime factors of x*y*n are consecutive primes starting with 2.
1

%I #74 Nov 13 2024 16:32:28

%S 0,1,1,1,1,1,0,1,2,2,0,1,0,1,2,1,0,0,0,0,3,1,0,0,4,0,2,1,0,0,0,1,1,0,

%T 4,1,0,0,0,1,0,0,0,1,0,0,0,0,3,0,0,0,0,1,4,1,0,0,0,1,0,0,1,1,1,0,0,0,

%U 0,0,0,0,0,0,0,0,5,0,0,1,3,0,0,0,0,0,0,1,0,1

%N a(n) is the number of ways n can be written as x + y with x >= y, x and y coprime, and so that the distinct prime factors of x*y*n are consecutive primes starting with 2.

%H Robert Israel, <a href="/A376926/b376926.txt">Table of n, a(n) for n = 1..10000</a>

%e The a(25) = 4 solutions are:

%e 24 + 1 = 25 and 24 * 1 * 25 = 2^3 * 3 * 5^2;

%e 21 + 4 = 25 and 21 * 4 * 25 = 2^2 * 3 * 5^2 * 7;

%e 18 + 7 = 25 and 18 * 7 * 25 = 2 * 3^2 * 5^2 * 7;

%e 16 + 9 = 25 and 16 * 9 * 25 = 2^4 * 3^2 * 5^2.

%e The a(27) = 2 solutions are:

%e 25 + 2 = 27 and 25 * 2 * 27 = 2 * 3^3 * 5^2;

%e 20 + 7 = 27 and 20 * 7 * 27 = 2^2 * 3^3 * 5 * 7.

%p f:= proc(n) local t,x,y,Pn,Px,Py,L;

%p t:= 0:

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

%p for y from 1 to n/2 do

%p x:= n-y;

%p if igcd(x,y) > 1 then next fi;

%p L:= Pn union numtheory:-factorset(x) union numtheory:-factorset(y);

%p if max(L) = ithprime(nops(L)) then t:= t+1 fi

%p od;

%p t

%p end proc:

%p map(f, [$0..100]); # _Robert Israel_, Nov 12 2024

%o (PARI) a(n)={sum(k=1, n\2, if(gcd(k,n-k)==1, my(f=factor(k*(n-k)*n)[,1]~); f[#f]==prime(#f)))} \\ _Andrew Howroyd_, Oct 12 2024

%Y Cf. A055932, A346970.

%K nonn

%O 1,9

%A _Zhicheng Wei_, Oct 10 2024