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.

A051169 Smallest number m such that 2*m - p is composite for the first n primes p.

Original entry on oeis.org

3, 6, 15, 49, 49, 49, 49, 110, 154, 154, 278, 278, 278, 278, 496, 496, 496, 496, 496, 496, 1321, 1321, 1321, 1321, 1321, 1321, 2686, 2686, 2686, 2686, 2686, 2686, 2686, 3713, 3713, 3713, 3713, 3713, 3713, 21766, 21766, 21766, 21766, 21766, 21766, 21766
Offset: 1

Views

Author

Paul S. Bruckman (pbruckman(AT)hotmail.com)

Keywords

Examples

			a(2) = 6 because 2*6-2 = 10 and 2*6-3 = 9 are composite.
		

References

  • Computed by Peter G. Anderson at the Rochester Institute of Technology.

Crossrefs

See A051610 and A116111 for records. Cf. A025017.

Programs

  • Haskell
    a051169 n = head [m | m <- [2..],
                all (== 0) $ map (a010051' . (2*m -)) $ take n a000040_list]
    -- Reinhard Zumkeller, Apr 09 2015
  • Mathematica
    a[n_] := a[n] = Catch[For[m = 2, True, m++, If[And @@ (! PrimeQ[2*m - #] &) /@ Prime /@ Range[n], Throw[m]]]]; Table[ Print[a[n]]; a[n], {n, 1, 46}] (* Jean-François Alcover, Jul 17 2012 *)
    Module[{nn=50,prs},prs=Prime[Range[nn]];Table[SelectFirst[Range[50000], AllTrue[Table[2#-p,{p,Take[prs,n]}],CompositeQ]&],{n,nn}]] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Mar 18 2015 *)

Extensions

More terms from Paul S. Bruckman, Jan 20 2007
Edited by N. J. A. Sloane, Apr 14 2007, May 04 2007, Jun 10 2008