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.

A275785 Primes such that the ratio between the distance to the next prime and from the previous prime appears for the first time.

This page as a plain text file.
%I A275785 #39 Feb 26 2018 18:58:49
%S A275785 3,5,11,23,29,31,37,89,113,127,139,149,199,251,293,331,337,367,409,
%T A275785 521,523,631,701,787,797,953,1087,1129,1151,1259,1277,1327,1361,1381,
%U A275785 1399,1657,1669,1847,1933,1949,1951,1973,2477,2503,2579,2633,2861,2879,2971,2999,3089,3137,3163,3229,3407
%N A275785 Primes such that the ratio between the distance to the next prime and from the previous prime appears for the first time.
%C A275785 Number of terms less than 10^n: 2, 8, 26, 85, 224, 511, 1035, 1905, 3338, ..., . - _Robert G. Wilson v_, Nov 30 2016
%H A275785 Robert G. Wilson v, <a href="/A275785/b275785.txt">Table of n, a(n) for n = 1..7589</a>
%e A275785 a(1) = 3 because this is the first prime for which it is possible to determine the ratio between the distance to the next prime (5) and from the previous prime (2). This first ratio is 2.
%e A275785 a(2) = 5 because the ratio between the distance to the next prime (7) and from the previous prime (3) is 1 and this ratio has not appeared before.
%e A275785 The third element a(3) is not 7 because (11-7)/(7-5) = 2, a ratio that appeared before with a(1), so a(3) = 11 because (13-11)/(11-7) = 1/2, a ratio that did not appear before.
%t A275785 nmax = 720;
%t A275785 a = Prime[Range[nmax]];
%t A275785 gaps = Rest[a] - Most[a];
%t A275785 gapsratio = Rest[gaps]/Most[gaps];
%t A275785 newpindex = {}; newgratios = {}; i = 1;
%t A275785 While[i < Length[gapsratio] + 1,
%t A275785 If[Cases[newgratios, gapsratio[[i]]] == {},
%t A275785   AppendTo[newpindex, i + 1];
%t A275785   AppendTo[newgratios, gapsratio[[i]]] ];
%t A275785   i++];
%t A275785 Prime[newpindex]
%t A275785 p = 2; q = 3; r = 5; rtlst = qlst = {}; While[q < 10000, rt = (r - q)/(q - p); If[ !MemberQ[rtlst, rt], AppendTo[rtlst, rt]; AppendTo[qlst, q]]; p = q; q = r; r = NextPrime@ r]; qlst (* _Robert G. Wilson v_, Nov 30 2016 *)
%Y A275785 Cf. A168253, A179210, A179234, A179256, A274263, A276309, A276812.
%K A275785 nonn
%O A275785 1,1
%A A275785 _Andres Cicuttin_, Nov 14 2016