OFFSET
1,2
COMMENTS
If p > 3 is prime, then a(p) = 1. - Wesley Ivan Hurt, May 21 2021
FORMULA
a(n) = Sum_{d|n} sign(c(d-1) + c(d+1)), where c is the prime characteristic (A010051).
EXAMPLE
a(6) = 4; All 4 divisors of 6 are adjacent to at least one prime number since 1 ( +1 ) = 2, 2 ( +1 ) = 3, 3 ( -1 ) = 2 and 6 ( +1 ) = 7.
MATHEMATICA
Table[Sum[Sign[PrimePi[n/i + 1] - PrimePi[n/i] + PrimePi[n/i - 1] - PrimePi[n/i - 2]] (1 - Ceiling[n/i] + Floor[n/i]), {i, n}], {n, 100}]
(* Second program: *)
Array[DivisorSum[#, 1 &, AnyTrue[# + {-1, 1}, PrimeQ] &] &, 100] (* Michael De Vlieger, Dec 10 2020 *)
PROG
(PARI) a(n) = sumdiv(n, d, ispseudoprime(d-1)||ispseudoprime(d+1)) \\ Felix Fröhlich, Dec 09 2020
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Dec 07 2020
STATUS
approved