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.

Showing 1-3 of 3 results.

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

A178942 a(1) = 3; for n >= 2, 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 equal to A001223(n)/2 (or 0, if no such prime exists).

Original entry on oeis.org

3, 5, 11, 13, 17, 19, 29, 37, 47, 53, 61, 67, 71, 79, 83, 131, 137, 151, 163, 173, 233, 277, 331, 359, 379, 397, 401, 419, 439, 773, 823, 941, 947, 1021, 1031, 1033, 1063, 1087, 1097, 1117, 1123, 1153, 1187, 1237, 1277, 1709, 1789, 1823
Offset: 1

Views

Author

Vladimir Shevelev, Jan 06 2011

Keywords

Comments

Conjecture: a(n) > 0 for all n.
The smallest prime(k) > a(n-1) such that the denominator of A001223(k-1)/A001223(k) equals A001223(n)/2. - R. J. Mathar, Jan 07 2011

Crossrefs

Programs

  • Maple
    A001223 := proc(n) ithprime(n+1)-ithprime(n) ; end proc:
    A178942 := proc(n) option remember; local p,q,r ; if n = 1 then 3; else for q from procname(n-1)+1 do if isprime(q) then p := prevprime(q) ; r := nextprime(q) ; denom((q-p)/(r-q)) ; if % = A001223(n)/2 then return q; end if; end if; end do: end if; end proc: # R. J. Mathar, Jan 07 2011
  • Mathematica
    A001223[n_] := Prime[n + 1] - Prime[n];
    a[n_] := a[n] = Module[{p, q, r, d}, If[n == 1, 3, For[q = a[n - 1] + 1, True, q++, If [PrimeQ[q], p = NextPrime[q, -1]; r = NextPrime[q]; d = Denominator[(q - p)/(r - q)]; If[d == A001223[n]/2, Return[q]]]]]];
    Array[a, 48] (* Jean-François Alcover, May 21 2020, after Maple *)

Extensions

More terms from Alois P. Heinz, Jan 06 2011

A179479 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 2, for odd n and 1 for even n (or 0, if such a prime does not exist).

Original entry on oeis.org

3, 5, 7, 11, 13, 17, 19, 29, 43, 53, 67, 71, 79, 97
Offset: 1

Views

Author

Vladimir Shevelev, Jan 08 2011

Keywords

Comments

Conjecture: a(n) > 0 for all n.
Since, as it is accepted in the OEIS, we consider the uncancelled fractions, then, by the condition, for even n, we have (r-q)|(q-p).

Examples

			If n=1, then denominator should be 2. Thus a(1)=3, since (3-2)/(5-3)=1/2. If n=2, then denominator should be 1. Thus a(2)=5, since (5-3)/(7-5)=1/1, etc.
		

Crossrefs

Showing 1-3 of 3 results.