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.

A068374 Primes p such that positive values of p - A002110(k) are all primes for k > 0.

Original entry on oeis.org

2, 5, 13, 19, 43, 73, 103, 109, 229, 313, 883, 1093, 1489, 1699, 1789, 2143, 3463, 3853, 5653, 15649, 21523, 43789, 47743, 50053, 51199, 59473, 86293, 88819, 93493, 101533, 176053, 197299, 205663, 235009, 257503, 296509, 325543, 338413, 347989
Offset: 1

Views

Author

Naohiro Nomoto, Mar 01 2002

Keywords

Crossrefs

Cf. A002110.

Programs

  • MATLAB
    Primes = primes(10^8);
    A = Primes;
    primorial = 1;
    for k =1:10
      primorial = primorial*Primes(k);
    j = find(A > primorial,1,'first');
      if numel(j) == 0
        break
      end
      A = [A(1:j-1),intersect(A(j:end),Primes + primorial)];
    end
    A % Robert Israel, Dec 14 2015
  • Maple
    primo:= proc(k) option remember; ithprime(k)*procname(k-1) end proc:
    primo(1):= 2:
    filter:= proc(p)
      local k;
      if not isprime(p) then return false fi;
      for k from 1 do
        if primo(k) >= p then return true
        elif not isprime(p - primo(k)) then return false
        fi
      od
    end proc:
    select(filter, [2,seq(i,i=3..10^6,2)]); # Robert Israel, Dec 14 2015
  • Mathematica
    s = Table[Product[Prime@ k, {k, n}], {n, 12}]; Select[Prime@ Range@ 30000, AllTrue[# - TakeWhile[s, Function[k, k < #]], PrimeQ@ # && # > 0 &] &] (* Michael De Vlieger, Dec 14 2015, Version 10 *)
  • PARI
    primo(n) = prod(k=1, n, prime(k));
    isok(p) = {my(k=1); while ((pp=primo(k)) < p, if (! isprime(p-pp), return (0)); k++;); return (1);}
    lista(nn) = forprime(p=2, nn, if (isok(p), print1(p, ", "));); \\ Michel Marcus, Dec 14 2015