OFFSET
0,8
EXAMPLE
For n=24 (2n=48), we have a(24)=3 since 48=1+47, 48=13+35, and 48=23+25. These are the only sums containing one prime and one nonprime, both of which are relatively prime to n.
MAPLE
f:= proc(n) local k;
nops(select(k -> igcd(n, k) = 1 and igcd(n, 2*n-k) = 1 and isprime(k) and not isprime(2*n-k), [seq(k, k=1..2*n-1, 2)]))
end proc:
map(f, [$0..100]); # Robert Israel, Jul 03 2023
PROG
(Sage)
def d(a):
"""
This function returns the number of ways n=2a can be expressed as the sum of one prime number and an odd composite that are relatively prime to n
"""
d=0
for i in range(1, a+1):
if ((is_prime(i) and not is_prime(2*a-i) and gcd(i, 2*a-i) == 1)) or ((not is_prime(i) and is_prime(2*a-i) and gcd(i, 2*a-i) == 1)):
d=d+1
return d
CROSSREFS
KEYWORD
nonn
AUTHOR
Brian Darrow, Jr., Jun 30 2023
STATUS
approved