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.

Original entry on oeis.org

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, 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, 1, 2, 1, 2, 6, 1, 2, 1, 1, 1, 1, 1, 1, 1, 4, 1, 2, 1
Offset: 2

Views

Author

Jonathan Vos Post, Feb 11 2006

Keywords

Comments

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.
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

Examples

			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.
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.
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.
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.
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.
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.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local p,k,j,count;
    p:= ithprime(n);
    count:= -1;
    for k from 0 do
      for j in [0,3] do
         count:= count+1;
         if not isprime (p + 1/2*(4*k+j)*(4*k+j+1)) then return count fi;
    od od
    end proc:
    map(f, [$2..100]); # Robert Israel, Jun 14 2016
  • Mathematica
    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 *)

Formula

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.

Extensions

Corrected and extended by Giovanni Resta, Jun 14 2016