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.

A007811 Numbers k for which 10k+1, 10k+3, 10k+7 and 10k+9 are primes.

Original entry on oeis.org

1, 10, 19, 82, 148, 187, 208, 325, 346, 565, 943, 1300, 1564, 1573, 1606, 1804, 1891, 1942, 2101, 2227, 2530, 3172, 3484, 4378, 5134, 5533, 6298, 6721, 6949, 7222, 7726, 7969, 8104, 8272, 8881, 9784, 9913, 10111, 10984, 11653, 11929, 12220, 13546, 14416, 15727
Offset: 1

Views

Author

N. J. A. Sloane and J. H. Conway, Mar 15 1996

Keywords

Crossrefs

Programs

  • Haskell
    a007811 n = a007811_list !! (n-1)
    a007811_list = map (pred . head) $ filter (all (== 1) . map a010051') $
       iterate (zipWith (+) [10, 10, 10, 10]) [1, 3, 7, 9]
    -- Reinhard Zumkeller, Jul 18 2014
    
  • Magma
    [n: n in [0..10000] | forall{10*n+r: r in [1,3,7,9] | IsPrime(10*n+r)}]; // Bruno Berselli, Sep 04 2012
    
  • Maple
    for n from 1 to 10000 do m := 10*n: if isprime(m+1) and isprime(m+3) and isprime(m+7) and isprime(m+9) then print(n); fi: od: quit
  • Mathematica
    Select[ Range[ 1, 10000, 3 ], PrimeQ[ 10*#+1 ] && PrimeQ[ 10*#+3 ] && PrimeQ[ 10*#+7 ] && PrimeQ[ 10*#+9 ]& ]
    Select[Range[15000], And @@ PrimeQ /@ ({1, 3, 7, 9} + 10#) &] (* Ray Chandler, Jan 12 2007 *)
  • PARI
    p=2;q=3;r=5;forprime(s=7,1e5,if(s-p==8 && r-p==6 && q-p==2 && p%10==1, print1(p", ")); p=q;q=r;r=s) \\ Charles R Greathouse IV, Mar 21 2013
    
  • Perl
    use ntheory ":all"; my @s = map { ($-1)/10 } sieve_prime_cluster(10,1e9, 2,6,8); say for @s; # _Dana Jacobsen, May 04 2017

Formula

a(n) = 3*A014561(n) + 1. - Zak Seidov, Sep 21 2009