cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A195155 Number of divisors d of n such that d-1 also divides n or d-1 = 0.

Original entry on oeis.org

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

Views

Author

Omar E. Pol, Sep 19 2011

Keywords

Comments

First differs from A055874 at a(20).

Crossrefs

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) = A000005(n) - A195150(n).
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
a(n) <= A038548(n) <= A000005(n). - Charles R Greathouse IV, Jun 09 2025