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.

A359273 a(n) = least positive integer k such that (prime(n+k)-prime(n))/n is an integer.

Original entry on oeis.org

1, 1, 2, 1, 6, 2, 4, 6, 4, 7, 5, 6, 6, 6, 13, 10, 14, 4, 23, 12, 16, 4, 42, 6, 20, 5, 10, 10, 10, 10, 23, 6, 24, 6, 37, 12, 38, 14, 40, 22, 151, 6, 16, 16, 46, 22, 60, 10, 49, 25, 65, 43, 16, 18, 18, 27, 19, 38, 56, 19, 144, 30, 21, 21, 21, 10, 42, 32, 66
Offset: 1

Views

Author

Clark Kimberling, Jan 26 2023

Keywords

Examples

			a(5) = 6 because 5 divides 20, which is prime(5+6) - prime(5), and if 0 < k < 6, then 5 does not divide prime(5+k) - prime(5).
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local p,k,q;
      p:= ithprime(n); q:= p;
      for k from 1 do
        q:= nextprime(q);
        if (q - p) mod n = 0 then return k fi;
      od
    end proc:
    map(f, [$1..100]); # Robert Israel, Jan 26 2023
  • Mathematica
    p[n_] := Prime[n];
    a[n_] := Select[Range[1000], IntegerQ[(p[n + #] - p[n])/n] &, 1]
    Flatten[Table[a[n], {n, 1, 130}]]