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.

A179328 a(n) is the smallest prime q > a(n-1) such that, for the previous prime p and the following prime r, the fraction (q-p)/(r-q) has denominator prime(n) (or 0, if such a prime does not exist).

Original entry on oeis.org

3, 23, 139, 293, 1129, 2477, 8467, 30593, 81463, 85933, 190409, 404597, 535399, 840353, 1100977, 2127163, 4640599, 6613631, 6958667, 10343761, 24120233, 49269581, 83751121, 101649649, 166726367, 273469741, 310845683, 568951459
Offset: 1

Views

Author

Vladimir Shevelev, Jan 06 2011

Keywords

Comments

Conjecture: a(n) > 0 for all n.

Crossrefs

Programs

  • Maple
    with(numtheory):
    a:= proc(n) option remember; local k, p, q, r, pn;
          pn:= ithprime(n);
          for k from `if`(n=1, 1, pi(a(n-1))) do
            p:= ithprime(k);
            q:= ithprime(k+1);
            r:= ithprime(k+2);
            if denom((q-p)/(r-q)) = pn then break fi
          od; q
        end:
    seq(a(n), n=1..10);  # Alois P. Heinz, Jan 06 2011
  • Mathematica
    a[n_] := a[n] = Module[{k, p, q, r, pn},
         pn = Prime[n];
         For[k = If[n == 1, 1, PrimePi[a[n - 1]]], True, k++,
         p = Prime[k];
         q = Prime[k + 1];
         r = Prime[k + 2];
         If [Denominator[(q - p)/(r - q)] == pn, Break[]]]; q];
    Table[a[n], {n, 1, 10}] (* Jean-François Alcover, Mar 18 2022, after Alois P. Heinz *)

Extensions

More terms from Alois P. Heinz, Jan 06 2011