[go: up one dir, main page]

login
A339526
Number of divisors of n that are adjacent to at least one prime.
0
1, 2, 2, 3, 1, 4, 1, 4, 2, 3, 1, 6, 1, 3, 2, 5, 1, 5, 1, 5, 2, 3, 1, 8, 1, 2, 2, 5, 1, 6, 1, 6, 2, 2, 1, 8, 1, 3, 2, 7, 1, 6, 1, 5, 2, 3, 1, 10, 1, 3, 2, 4, 1, 6, 1, 6, 2, 3, 1, 10, 1, 3, 2, 6, 1, 6, 1, 4, 2, 5, 1, 11, 1, 3, 2, 4, 1, 5, 1, 9, 2, 3, 1, 10, 1, 2, 2, 7, 1, 8, 1
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
Cf. A010051.
Sequence in context: A071450 A175457 A322025 * A072078 A322316 A260439
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Dec 07 2020
STATUS
approved