A072628 Number of divisors d of n such that d-1 is not prime.
1, 2, 1, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 3, 3, 3, 2, 3, 2, 4, 3, 4, 2, 2, 3, 4, 3, 4, 2, 5, 2, 3, 3, 4, 4, 4, 2, 3, 3, 5, 2, 4, 2, 4, 5, 4, 2, 3, 3, 6, 3, 5, 2, 4, 4, 5, 3, 4, 2, 5, 2, 3, 5, 4, 4, 6, 2, 4, 3, 7, 2, 4, 2, 3, 5, 4, 4, 6, 2, 6, 4, 4, 2, 5, 4, 4, 3, 5, 2, 7, 4, 5, 3, 4, 4, 4, 2, 4, 5, 7, 2, 5, 2, 5, 7
Offset: 1
Keywords
Examples
If n = p is prime then divisors - 1 = {1, p} - 1 = {0, p-1} so a(p) = 2 if p <> 3. 240 has 20 divisors, of them 8 divisors d have nonprime value of d-1, {0, 1, 4, 9, 14, 15, 39, 119}, so a(240) = 8.
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
di[x_] := Divisors[x]; dp[x_] := Part[di[x], Flatten[Position[PrimeQ[ -1+di[x]], True]]]-1; Table[DivisorSigma[0, w]-Length[dp[w]], {w, 1, 128}] a[n_] := DivisorSum[n, 1 &, !PrimeQ[#-1] &]; Array[a, 100] (* Amiram Eldar, Apr 13 2024 *)
-
PARI
a(n) = sumdiv(n, d, !isprime(d-1)); \\ Amiram Eldar, Apr 13 2024
Comments