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.

A068901 Least number that when added to the n-th prime gives a multiple of n.

Original entry on oeis.org

0, 1, 1, 1, 4, 5, 4, 5, 4, 1, 2, 11, 11, 13, 13, 11, 9, 11, 9, 9, 11, 9, 9, 7, 3, 3, 5, 5, 7, 7, 28, 29, 28, 31, 26, 29, 28, 27, 28, 27, 26, 29, 24, 27, 28, 31, 24, 17, 18, 21, 22, 21, 24, 19, 18, 17, 16, 19, 18, 19, 22, 17, 8, 9, 12, 13, 4, 3, 67, 1
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 05 2002

Keywords

Crossrefs

Cf. A090973. - Reinhard Zumkeller, Aug 16 2009

Programs

  • Haskell
    a068901 n = head $
       filter ((== 0) . (`mod` fromIntegral n) . (+ a000040 n)) $ [0..]
    -- Reinhard Zumkeller, Feb 18 2012
  • Mathematica
    f[n_] := Module[{p=Prime[n]}, n*Ceiling[p/n]-p]; Array[f,100]  (* Harvey P. Dale, Apr 06 2011 *)

Formula

a(n) = Min_{k | n divides (prime(n)+k)}.
a(n) = A068902(n) - A000040(n).
a(n) = n*ceiling(prime(n)/n) - prime(n). - Vladeta Jovovic, Apr 06 2003