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.

A137921 Number of divisors d of n such that d+1 is not a divisor of n.

This page as a plain text file.
%I A137921 #52 May 22 2025 10:21:35
%S A137921 1,1,2,2,2,2,2,3,3,3,2,3,2,3,4,4,2,4,2,4,4,3,2,5,3,3,4,5,2,5,2,5,4,3,
%T A137921 4,6,2,3,4,6,2,5,2,5,6,3,2,7,3,5,4,5,2,6,4,6,4,3,2,7,2,3,6,6,4,6,2,5,
%U A137921 4,7,2,8,2,3,6,5,4,6,2,8,5,3,2,8,4,3,4,7,2,8,4,5,4,3,4,9,2,5,6,7,2,6,2,7,8
%N A137921 Number of divisors d of n such that d+1 is not a divisor of n.
%C A137921 a(n) = number of "divisor islands" of n. A divisor island is any set of consecutive divisors of a number where no pairs of consecutive divisors in the set are separated by 2 or more. - _Leroy Quet_, Feb 07 2010
%H A137921 Charles R Greathouse IV, <a href="/A137921/b137921.txt">Table of n, a(n) for n = 1..10000</a>
%H A137921 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/DivisorFunction.html">Divisor Function</a>.
%F A137921 a(n) <= A000005(n), with equality iff n is odd; a(A137922(n)) = 2.
%F A137921 a(n) = A000005(n) - A129308(n). - _Michel Marcus_, Jan 06 2015
%F A137921 a(n) = A001222(A328166(n)). - _Gus Wiseman_, Oct 16 2019
%F A137921 Sum_{k=1..n} a(k) ~ n * (log(n) + 2*gamma - 2), where gamma is Euler's constant (A001620). - _Amiram Eldar_, Jan 18 2024
%e A137921 The divisors of 30 are 1,2,3,5,6,10,15,30. The divisor islands are (1,2,3), (5,6), (10), (15), (30). (Note that the differences between consecutive divisors 5-3, 10-6, 15-10 and 30-15 are all > 1.) There are 5 such islands, so a(30)=5.
%p A137921 with(numtheory): disl := proc (b) local ct, j: ct := 1: for j to nops(b)-1 do if 2 <= b[j+1]-b[j] then ct := ct+1 else end if end do: ct end proc: seq(disl(divisors(n)), n = 1 .. 120); # _Emeric Deutsch_, Feb 12 2010
%t A137921 f[n_] := Length@ Split[ Divisors@n, #2 - #1 == 1 &]; Array[f, 105] (* f(n) from Bobby R. Treat *) (* _Robert G. Wilson v_, Feb 22 2010 *)
%t A137921 Table[Count[Differences[Divisors[n]],_?(#>1&)]+1,{n,110}] (* _Harvey P. Dale_, Jun 05 2012 *)
%t A137921 a[n_] := DivisorSum[n, Boole[!Divisible[n, #+1]]&]; Array[a, 100] (* _Jean-François Alcover_, Dec 01 2015 *)
%o A137921 (PARI) a(n)=my(d,s=0);if(n%2,numdiv(n),d=divisors(n);for(i=1,#d,if(n%(d[i]+1),s++));s)
%o A137921 (PARI) a(n)=sumdiv(n,d,(n%(d+1)!=0)); \\ _Joerg Arndt_, Jan 06 2015
%o A137921 (Haskell)
%o A137921 a137921 n = length $ filter (> 0) $
%o A137921    map ((mod n) . (+ 1)) [d | d <- [1..n], mod n d == 0]
%o A137921 -- _Reinhard Zumkeller_, Nov 23 2011
%o A137921 (Python)
%o A137921 from sympy import divisors
%o A137921 def A137921(n):
%o A137921     return len([d for d in divisors(n,generator=True) if n % (d+1)])
%o A137921 # _Chai Wah Wu_, Jan 05 2015
%Y A137921 Bisections: A099774, A174199.
%Y A137921 First appearance of n is at position A173569(n).
%Y A137921 Numbers whose divisors have no non-singleton runs are A005408.
%Y A137921 The longest run of divisors of n has length A055874(n).
%Y A137921 The number of successive pairs of divisors of n is A129308(n).
%Y A137921 Cf. A000005, A001620, A027750, A060680, A088723, A088725, A181063, A199970, A328165, A328166, A328448, A328450.
%K A137921 nonn,nice
%O A137921 1,3
%A A137921 _Reinhard Zumkeller_, Feb 23 2008
%E A137921 Corrected and edited by _Charles R Greathouse IV_, Apr 19 2010
%E A137921 Edited by _N. J. A. Sloane_, Aug 10 2010