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.

A166573 Prime numbers containing the string 13.

Original entry on oeis.org

13, 113, 131, 137, 139, 313, 613, 1013, 1213, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1613, 1913, 2113, 2131, 2137, 2213, 2713, 3137, 3313, 3413, 3613, 4013, 4133, 4139, 4513, 4813, 5113, 5413, 5813, 6113, 6131, 6133, 7013, 7213, 8513
Offset: 1

Views

Author

Vincenzo Librandi, Nov 01 2009

Keywords

Crossrefs

Complement of A076805 with respect to A000040.

Programs

  • Haskell
    import Data.List (isInfixOf)
    a166573 n = a166573_list !! (n-1)
    a166573_list = filter (("13" `isInfixOf`) . show) a000040_list
    -- Reinhard Zumkeller, Nov 09 2011
    
  • Mathematica
    p13Q[n_] := Module[{idn = IntegerDigits[n]}, MemberQ[Partition[idn, 2, 1], {1, 3}]]; Select[Prime[Range[1000]], p13Q] (* Vincenzo Librandi, Sep 14 2012 *)
    Select[Prime[Range[1500]], ! StringFreeQ[ToString[#], "13"] &] (* Vincenzo Librandi, May 03 2015 *)
  • PARI
    contains(n,k)=my(N=digits(n),K=digits(k)); for(i=0,#N-#K, for(j=1,#K,if(N[i+j]!=K[j],next(2))); return(1)); 0
    is(n)=isprime(n) && contains(n,13) \\ Charles R Greathouse IV, Jun 20 2014

Formula

a(n) ~ n log n. - Charles R Greathouse IV, Nov 09 2011

Extensions

Corrected (313 inserted) by R. J. Mathar, Nov 30 2009