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.

A260930 Differences between the numbers n such that n^2 + 2 is prime.

Original entry on oeis.org

1, 2, 6, 6, 6, 12, 6, 6, 12, 24, 18, 6, 6, 6, 6, 24, 24, 48, 6, 12, 6, 6, 6, 18, 24, 6, 6, 12, 24, 6, 12, 6, 6, 12, 30, 6, 6, 12, 6, 6, 24, 24, 12, 36, 6, 6, 12, 30, 6, 42, 24, 6, 18, 12, 42, 24, 30, 12, 18, 30, 18, 12, 6, 6, 24, 24, 12, 12, 30, 24, 36, 42, 18
Offset: 1

Views

Author

Michel Lagneau, Aug 04 2015

Keywords

Comments

Sequence A067201 has the values of n. This sequence is the first differences of A067201.
a(n) is divisible by 6 for n>2.

Examples

			a(6)=12 because A067201(7) - A067201(6) = 33 - 21 = 12.
		

Crossrefs

Cf. A056899 (primes of the form n^2+2), A067201 (values of n).

Programs

  • Maple
    i0:=0:
    for k from 1 to 1500 do:
       p:=k^2+2:
       if isprime(p) then printf(`%d, `,k-i0):i0:=k:
       else
       fi:
    od:
  • Mathematica
    Differences[Select[Range[1500], PrimeQ[2 + #^2] &, 100]]
  • PARI
    first(m)=my(u=vector(m+1),v=vector(m),r=0);for(i=1,m+1,while(!isprime(r^2 + 2),r++);u[i]=r;r++);for(i=1,m,v[i]=u[i+1]-u[i]);v; \\ Anders Hellström, Aug 14 2015