A195155 Number of divisors d of n such that d-1 also divides n or d-1 = 0.
1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 3, 1, 3, 1, 2, 1, 4, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 4, 1, 2, 1, 3, 1, 4, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 3, 1, 3, 1, 2, 1, 6, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 5, 1, 2, 1, 2, 1, 3, 1, 3, 1, 2, 1, 5, 1, 2
Offset: 1
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..1000
Programs
-
Maple
with(numtheory): a:= n-> add(`if`(d=1 or irem(n, d-1)=0, 1, 0), d=divisors(n)): seq(a(n), n=1..200); # Alois P. Heinz, Oct 17 2011
-
Mathematica
d1[n_]:=Module[{d=Rest[Divisors[n]]},Count[d,?(Divisible[n,#-1]&)]+1]; Array[d1, 90] (* _Harvey P. Dale, Oct 31 2013 *)
-
Python
from itertools import pairwise from sympy import divisors def A195155(n): return 1 if n&1 else 1+sum(1 for a, b in pairwise(divisors(n)) if a+1==b) # Chai Wah Wu, Jun 09 2025
Formula
a(n) = 1 + A129308(n).
a(2n-1) = 1; a(2n) = 1 + A007862(n).
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 2. - Amiram Eldar, Dec 31 2023
Comments