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.

A114383 Length of all-prime chain of prime(n) + successive even triangular numbers.

This page as a plain text file.
%I A114383 #16 Jun 15 2016 09:21:21
%S A114383 1,2,3,2,4,2,1,2,1,9,3,2,1,2,2,1,12,2,1,8,1,2,1,3,2,5,2,1,1,1,2,1,1,1,
%T A114383 2,3,1,2,2,1,1,2,2,1,1,1,4,2,1,2,1,1,2,2,2,1,3,2,1,1,1,3,2,1,1,2,1,2,
%U A114383 1,2,1,2,6,1,2,1,1,1,1,1,1,1,4,1,2,1
%N A114383 Length of all-prime chain of prime(n) + successive even triangular numbers.
%C A114383 a(1) is undefined, as prime(1) is the only even prime, for which the length-5 chain is of 2 + successive odd triangular numbers A014493: 2 prime, 2+1 = 3 prime, 2+3 = 5 prime, 2+15 = 17 prime, 2+21 = 23 prime, 2+45 = 47 prime and then 2+55 = 57 = 3*19 nonprime.
%C A114383 a(18) = 12.  The next n for which a(n) >= 10 is a(22509) = 10.  What is the next for which a(n) >= 12?  Such n >  5761440. - _Robert Israel_, Jun 14 2016
%H A114383 Robert Israel, <a href="/A114383/b114383.txt">Table of n, a(n) for n = 2..10000</a>
%F A114383 a(n) = k = length of chain prime[n] + A014493(1) + ... + A014493(k) such that each term in the chain is prime. a(n) = k = length of chain A000040(n) + A000217(A014601(1)) + ... + A000217(A014601(k)) such that each term in the chain is in A000040.
%e A114383 a(2) = 1 because prime(2) = 3 is prime, but prime(2) + EvenTriangular(1) = 3 + 6 = 9 = 3^2 is nonprime, giving a chain of just 1 successive prime.
%e A114383 a(3) = 2 because prime(3) + EvenTriangular(1) = 5 + 6 = 11 is prime, but prime(3) + EvenTriangular(2) = 5 + 10 = 15 = 3*5 is nonprime, giving a chain of 2 successive primes.
%e A114383 a(4) = 3 because 7 is prime, 7+6 = 13 is prime, 7+10 = 17 is prime, but 7+28 = 35 = 5*7 is nonprime, for a chain of 3 successive primes.
%e A114383 a(6) = 4 because 13 is prime, 13+6 = 19 is prime, 13+10 = 23 is prime, 13+28 = 41 is prime, but 13+36 = 49 = 7^2 is nonprime.
%e A114383 a(11) = 9 because 31 is prime, as is 31+6 = 37; 31+10 = 41; 31+28 = 59; 31+36 = 67; 31+66 = 97; 31+78 = 109; 31+120 = 151; 31+136 = 167; but 31+190 = 221 = 13*17 is nonprime.
%e A114383 a(18) = 11 because of the prime chain 61; 61+6 = 67; 61+10 = 71; 61+28 = 89; 61+36 = 97; 61+66 = 127; 61+78 = 139; 61+120 = 181; 61+136= 197; 61+190 = 251; 61+276 = 337; but 61+300 = 361 = 19^2 is nonprime.
%p A114383 f:= proc(n) local p,k,j,count;
%p A114383 p:= ithprime(n);
%p A114383 count:= -1;
%p A114383 for k from 0 do
%p A114383   for j in [0,3] do
%p A114383      count:= count+1;
%p A114383      if not isprime (p + 1/2*(4*k+j)*(4*k+j+1)) then return count fi;
%p A114383 od od
%p A114383 end proc:
%p A114383 map(f, [$2..100]); # _Robert Israel_, Jun 14 2016
%t A114383 evt = Select[(# + 1) #/2 &@Range[200], EvenQ]; a[n_] := Block[{s = Prime@n, c = 1}, While[PrimeQ[s + evt[[c]]], c++]; c]; a /@ Range[2, 90] (* _Giovanni Resta_, Jun 14 2016 *)
%Y A114383 Cf. A000040, A000217, A014601.
%K A114383 nonn,easy
%O A114383 2,2
%A A114383 _Jonathan Vos Post_, Feb 11 2006
%E A114383 Corrected and extended by _Giovanni Resta_, Jun 14 2016