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.

A119752 a(1)=2; a(n)=first even number greater than a(n-1) such that a(i)+a(n)+1 is prime for all i=1,2,...,n.

Original entry on oeis.org

2, 8, 14, 44, 224, 638, 1274, 4004, 675404, 2203958, 3075158, 6195234164, 77989711184, 4566262987328
Offset: 1

Views

Author

Walter Kehowski, Jun 17 2006

Keywords

Crossrefs

Cf. A119751.

Programs

  • Maple
    R:= [2]: count:= 1:
    for k from 4 by 2 while count < 11 do
      if isprime(2*k+1) and andmap(isprime, [seq(R[i]+k+1,i=1..count)]) then
         R:= [op(R),k]; count:= count+1
      fi
    od:
    R; # Robert Israel, Mar 06 2023
  • Mathematica
    Table[If[n == 1, a[1] = 2, j = a[n - 1] + 2; While[a[n] = j; !
        AllTrue[Table[a[i] + a[n] + 1, {i, 1, n}], PrimeQ], j += 2]; j]
    , {n, 1, 9}] (* Robert Price, Apr 03 2019 *)
  • PARI
    isok(va, k, n) = if (isprime(2*k+1), for (i=1, n-1, if (! isprime(va[i]+k+1), return(0))); return(1));
    lista(nn) = my(va=vector(nn)); va[1]=2; for (n=2, nn, my(k=va[n-1]+2); while (!isok(va, k, n), k+=2); va[n] = k); va; \\ Michel Marcus, Mar 06 2023

Extensions

a(13)-a(14) from Donovan Johnson, Mar 23 2008