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.

This page as a plain text file.
%I A195155 #43 Jun 09 2025 12:37:05
%S A195155 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,
%T A195155 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,
%U A195155 1,2,1,5,1,2,1,2,1,3,1,3,1,2,1,5,1,2
%N A195155 Number of divisors d of n such that d-1 also divides n or d-1 = 0.
%C A195155 First differs from A055874 at a(20).
%H A195155 Harvey P. Dale, <a href="/A195155/b195155.txt">Table of n, a(n) for n = 1..1000</a>
%F A195155 a(n) = A000005(n) - A195150(n).
%F A195155 a(n) = 1 + A129308(n).
%F A195155 a(2n-1) = 1; a(2n) = 1 + A007862(n).
%F A195155 Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 2. - _Amiram Eldar_, Dec 31 2023
%F A195155 a(n) <= A038548(n) <= A000005(n). - _Charles R Greathouse IV_, Jun 09 2025
%p A195155 with(numtheory):
%p A195155 a:= n-> add(`if`(d=1 or irem(n, d-1)=0, 1, 0), d=divisors(n)):
%p A195155 seq(a(n), n=1..200);  # _Alois P. Heinz_, Oct 17 2011
%t A195155 d1[n_]:=Module[{d=Rest[Divisors[n]]},Count[d,_?(Divisible[n,#-1]&)]+1]; Array[d1, 90] (* _Harvey P. Dale_, Oct 31 2013 *)
%o A195155 (Python)
%o A195155 from itertools import pairwise
%o A195155 from sympy import divisors
%o A195155 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
%Y A195155 Cf. A000005, A007862, A049820, A055874, A129308, A137921, A195150, A195153.
%K A195155 nonn,easy
%O A195155 1,2
%A A195155 _Omar E. Pol_, Sep 19 2011