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.

A282687 a(n) = strictly increasing number m, such that m+n is the next prime and m-n is the previous prime.

This page as a plain text file.
%I A282687 #8 Feb 20 2017 22:23:36
%S A282687 4,5,26,93,144,157,300,1839,1922,3099,3240,4189,5544,5967,6506,10815,
%T A282687 11760,12871,30612,33267,35002,36411,81486,86653,95676,103263,106060,
%U A282687 153219,181332,189097,190440,288615,294596,326403,399318,507253,515004,570291,642320
%N A282687 a(n) = strictly increasing number m, such that m+n is the next prime and m-n is the previous prime.
%H A282687 Daniel Suteu, <a href="/A282687/b282687.txt">Table of n, a(n) for n = 1..100</a>
%e A282687 For n = 5, a(5) = 144, because the next prime after 144 is 149 and the previous prime before 144 is 139, where both have an equal distance of 5 from 144.
%t A282687 a = {}; Do[If[n == 1, k = 1, k = Max@ a + 1]; While[Nand[k - n == NextPrime[k, -1], k + n == NextPrime@ k], k++]; AppendTo[a, k], {n, 41}]; a (* _Michael De Vlieger_, Feb 20 2017 *)
%o A282687 (Perl)
%o A282687 use ntheory qw(:all);
%o A282687 for (my ($n, $k) = (1, 1) ; ; ++$n) {
%o A282687     my $p = prev_prime($n) || next;
%o A282687     my $q = next_prime($n);
%o A282687     if ($n-$p == $k and $q-$n == $k) {
%o A282687         printf("%s %s\n", $k++, $n);
%o A282687     }
%o A282687 }
%Y A282687 Cf. A087378, A087711, A282690.
%K A282687 nonn
%O A282687 1,1
%A A282687 _Daniel Suteu_, Feb 20 2017