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.

A162318 A positive integer n is included if |d(n+1)-d(n)| = 2, where d(n) is the number of divisors of n.

Original entry on oeis.org

5, 6, 7, 10, 13, 20, 22, 27, 32, 37, 45, 46, 50, 51, 58, 61, 62, 68, 73, 74, 76, 82, 91, 92, 106, 115, 117, 123, 124, 146, 152, 153, 157, 164, 166, 170, 174, 178, 187, 188, 193, 206, 212, 226, 235, 236, 245, 261, 262, 267, 272, 274, 277, 278, 284, 291, 313, 325
Offset: 1

Views

Author

Leroy Quet, Jul 01 2009

Keywords

Examples

			68 is included because |d(69)-d(68)| = |4 - 6| = 2. [_Emeric Deutsch_, Jul 12 2009]
		

Programs

  • Maple
    with(numtheory): a := proc (n) if abs(tau(n+1)-tau(n)) = 2 then n else end if end proc; seq(a(n), n = 1 .. 350); # Emeric Deutsch, Jul 12 2009
  • Mathematica
    Select[Range[500], Abs[DivisorSigma[0, # + 1] - DivisorSigma[0, #]] == 2 &] (* Indranil Ghosh, Mar 26 2017 *)
    Position[Abs[Differences[DivisorSigma[0,Range[350]]]],2]//Flatten (* Harvey P. Dale, Aug 14 2017 *)
  • PARI
    isok(n) = abs(numdiv(n+1) - numdiv(n)) == 2; \\ Michel Marcus, Mar 26 2017
    
  • Python
    from sympy import divisor_count
    print([n for n in range(500) if abs(divisor_count(n + 1) - divisor_count(n)) == 2]) # Indranil Ghosh, Mar 26 2017

Extensions

Extended by Emeric Deutsch, Jul 12 2009