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.

A232879 The y-axis intercept of the line y = n*x + b tangent to the curve y = prime(k), k = 1, 2, 3, ....

This page as a plain text file.
%I A232879 #12 Dec 04 2013 16:20:03
%S A232879 1,-1,-5,-13,-37,-83,-194,-469,-1111,-2743,-6698,-16379,-40543,
%T A232879 -101251,-254053,-640483,-1622840,-4133371,-10578367,-27130829,
%U A232879 -69814219
%N A232879 The y-axis intercept of the line y = n*x + b tangent to the curve y = prime(k), k = 1, 2, 3, ....
%C A232879 This sequence contains the y intercepts for lines with integer slopes, such that all primes fall at or above the line.  Verified for primes less than 2*10^9.
%C A232879 The first 15 tangent lines intercept prime(k) at the following primes: 2, 3, 5, 7, 13, 19, 23, 31, 43, 47, 113, 283, 1129, 2803, 7043, 24137, 59753, 59797, 155893, 445033, 1195247, 3278837.
%H A232879 John R Phelan, <a href="/A232879/a232879.pdf">First 5 integer tangents to prime(n)</a>
%F A232879 n*k + a(n) <= prime(k), where n is the slope, and a(n) is the y intercept.
%e A232879 The 2nd tangent line, a(2)+2*k tangent line intercepts p(k) at 3,5,7.
%e A232879 a(n)+n*k = ...
%e A232879 a(2)+2*2 = -1+2*2 = 3 = p(2).
%e A232879 a(2)+2*3 = -1+2*3 = 5 = p(3).
%e A232879 a(2)+2*4 = -1+2*4 = 7 = p(4).
%e A232879 But other primes fall above the 2nd tangent line.
%e A232879 a(2)+2*1 = -1+2*1 = 1 < 2=p(1).
%e A232879 a(2)+2*5 = -1+2*5 = 9 < 11=p(5).
%e A232879 a(2)+2*6 = -1+2*6 = 11 < 13=p(6).
%e A232879 For the 11th tangent line...
%e A232879 a(11)+11*6041 = -6698+6041*11 = 59753 = p(6041).
%e A232879 a(11)+11*6045 = -6698+6045*11 = 59797 = p(6045).
%e A232879 But other primes fall above the 11th tangent line...
%e A232879 a(11)+11*6040 = -6698+6040*11 = 59742 < 59747 = p(6040)
%e A232879 a(11)+11*6042 = -6698+6042*11 = 59764 < 59771 = p(6042)
%e A232879 a(11)+11*6043 = -6698+6043*11 = 59765 < 59779 = p(6043)
%e A232879 a(11)+11*6044 = -6698+6044*11 = 59776 < 59791 = p(6044)
%e A232879 a(11)+11*6046 = -6698+6046*11 = 59798 < 59809 = p(6046)
%t A232879 nn = 10^6; pt = Table[Prime[k], {k, nn}]; Table[r = n*Range[nn] - pt;
%t A232879 mx = Max[r]; Print[{-mx, Flatten[Prime[Position[r, mx]]]}]; -mx, {n, 16}] (* _T. D. Noe_, Dec 04 2013 *)
%o A232879 (Java) public class Itp {private static long LIMIT = 10000000; private static long[] a = new long[100]; private static long[] p = new long[100]; public static void main(String[] args) {for (int n = 1; n < a.length; n++) {a[n] = Integer.MAX_VALUE;} long k = 1; for (int i = 2; i < LIMIT; i++) {if (isPrime(i)) {for (int n = 1; n < a.length; n++) {long l = i - n * k; if (l < a[n]) {a[n] = l; p[n] = i;}} k++;}} for (int n = 1; p[n] < LIMIT / 2; n++) {System.out.print(a[n] + ",");} System.out.println("");} private static boolean isPrime(int i) {if (i < 2) {return false;} int m = (int) Math.sqrt(i); for (int j = 2; j <= m; j++) {if (i % j == 0) {return false;}} return true;}}
%K A232879 sign,hard
%O A232879 1,3
%A A232879 _John R Phelan_, Dec 01 2013
%E A232879 a(16)-a(21) from _T. D. Noe_, Dec 04 2013