A279817 a(1) = -1; for n>1, Sum_{d|n} a(n-d+1) = 0.
-1, 1, 1, 0, 1, 0, 1, -1, 0, 1, 1, -2, 1, 1, -1, 1, 1, -3, 1, -3, 1, 2, 1, -6, 0, 0, 0, 0, 1, -2, 1, -2, -1, 5, -1, -4, 1, 3, 0, 3, 1, -3, 1, -7, -3, 10, 1, -9, 0, -10, 2, -4, 1, -7, 2, 6, -1, 4, 1, -25, 1, 2, -2, 4, -1, -11, 1, 6, -1, 13, 1, -20, 1, -3, -4, 0
Offset: 1
Keywords
Examples
When n is any prime p, we have Sum_{d|p} a(p-d+1) = 0, so a(p-1+1) + a(p-p+1) = 0, hence a(p)=1. For n=4, we have a(4-1+1) + a(4-2+1) + a(4-4+1) = 0, so a(4) + a(3) + a(1) = 0, hence a(4)=0.
Programs
-
Maple
a := proc (n) option remember; -add(a(n-d+1), d = `minus`(numtheory:-divisors(n), {1})) end proc; a(1) := -1; seq(simplify(a(i)), i = 1 .. 1000)
Formula
For primes p and q:
a(p) = 1.
If p^2 - p + 1 is prime then a(p^2) = 0.
If p*q - p + 1 and p*q - q + 1 are primes then a(p*q) = -1.