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.

A252096 Largest prime divisor of n^2+1 - smallest prime divisor of n^2+1.

Original entry on oeis.org

0, 0, 3, 0, 11, 0, 3, 8, 39, 0, 59, 24, 15, 0, 111, 0, 27, 8, 179, 0, 15, 92, 51, 0, 311, 0, 71, 152, 419, 36, 35, 36, 107, 76, 611, 0, 135, 12, 759, 0, 27, 348, 35, 136, 1011, 44, 15, 456, 1199, 20, 1299, 536, 279, 0, 87, 0, 11, 668, 1739, 264, 1859, 764, 395
Offset: 1

Views

Author

Michel Lagneau, Dec 14 2014

Keywords

Examples

			a(5)= 11 because 5^2+1 = 2*13 and 13-2 = 11.
		

Crossrefs

Cf. A002522 (n^2+1), A005574 (n^2+1 is prime).
Cf. A014442 (largest prime factor of n2+1), A089120 (smallest prime factor).

Programs

  • Maple
    with(numtheory):
    a:= n-> (f-> max(f[])-min(f[]))(factorset(n^2+1)):
    seq(a(n), n=1..100);  # Alois P. Heinz, Jan 07 2015
  • Mathematica
    f[n_]:=Transpose[FactorInteger[n^2+1]][[1]]; Table[Last[f[n]-First[f[n]]], {n, 200}]
  • PARI
    a(n) = {my(f = factor(n^2+1)); f[#f~,1] - f[1,1];} \\ Michel Marcus, Dec 15 2014

Formula

a(n) = A014442(n) - A089120(n).
a(A005574(n)) = 0. - Michel Marcus, Dec 15 2014