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.

User: , " for sieve_prime_cluster($lo, $hi, map { $

, " for sieve_prime_cluster($lo, $hi, map { $'s wiki page.

, " for sieve_prime_cluster($lo, $hi, map { $ has authored 8 sequences.

A378841 a(n) is the least prime p such that p + 9*k*(k+1) is prime for 0 <= k <= n-1 but not for k=n.

Original entry on oeis.org

2, 11, 13, 5, 19, 173, 3163, 83, 21013, 878359, 3676219, 239, 43, 5201390418463, 86927887467919
Offset: 1

Author

J.W.L. (Jan) Eerland, Dec 09 2024

Keywords

Crossrefs

Programs

  • Maple
    f:= proc(p) local k;
      for k from 1 while isprime(p+k*(k+1)*9) do od:
      k
    end proc:
    A:= Vector(12): count:= 0:
    for i from 1 while count < 12 do
      v:= f(ithprime(i));
      if A[v] = 0 then count:= count+1; A[v]:= ithprime(i) fi
    od:
    convert(A,list);
  • Mathematica
    Table[p=1;m=9;Monitor[Parallelize[While[True,If[And[MemberQ[PrimeQ[Table[p+m*k*(k+1),{k,0,n-1}]],False]==False,PrimeQ[p+m*n*(n+1)]==False],Break[]];p++];p],p],{n,1,10}]
  • PARI
    isok(p, n) = for (k=0, n-1, if (! isprime(p + 9*k*(k+1)), return(0))); return (!isprime(p + 9*n*(n+1)));
    a(n) = my(p=2); while (!isok(p, n), p=nextprime(p+1)); p;
    
  • Perl
    use ntheory qw(:all); sub a { my $n = $[0]; my $lo = 2; my $hi = 2*$lo; while (1) { my @terms = grep { !is_prime($ + 9*$n*($n+1)) } sieve_prime_cluster($lo, $hi, map { 9*$*($+1) } 1 .. $n-1); return $terms[0] if @terms; $lo = $hi+1; $hi = 2*$lo; } }; $| = 1; for my $n (1..100) { print a($n), ", " }; #

Extensions

a(14) from Daniel Suteu, Dec 17 2024
a(15) from Daniel Suteu, Dec 22 2024

A378839 a(n) is the least prime p such that p + 8*k*(k+1) is prime for 0 <= k <= n-1 but not for k=n.

Original entry on oeis.org

2, 3, 151, 181, 13, 811, 23671, 92221, 45417481, 5078503, 4861, 20379346831, 12180447943, 31, 10347699089473
Offset: 1

Author

J.W.L. (Jan) Eerland, Dec 09 2024

Keywords

Comments

No further terms < 2.5*10^11. - Michael S. Branicky, Dec 16 2024

Crossrefs

Programs

  • Maple
    f:= proc(p) local k;
      for k from 1 while isprime(p+k*(k+1)*8) do od:
      k
    end proc:
    A:= Vector(12): count:= 0:
    for i from 1 while count < 12 do
      v:= f(ithprime(i));
      if A[v] = 0 then count:= count+1; A[v]:= ithprime(i) fi
    od:
    convert(A,list);
  • Mathematica
    Table[p=1;m=8;Monitor[Parallelize[While[True,If[And[MemberQ[PrimeQ[Table[p+m*k*(k+1),{k,0,n-1}]],False]==False,PrimeQ[p+m*n*(n+1)]==False],Break[]];p++];p],p],{n,1,10}]
  • PARI
    isok(p, n) = for (k=0, n-1, if (! isprime(p + 8*k*(k+1)), return(0))); return (!isprime(p + 8*n*(n+1)));
    a(n) = my(p=2); while (!isok(p, n), p=nextprime(p+1)); p;
    
  • Perl
    use ntheory qw(:all); sub a { my $n = $[0]; my $lo = 2; my $hi = 2*$lo; while (1) { my @terms = grep { !is_prime($ + 8*$n*($n+1)) } sieve_prime_cluster($lo, $hi, map { 8*$*($+1) } 1 .. $n-1); return $terms[0] if @terms; $lo = $hi+1; $hi = 2*$lo; } }; $| = 1; for my $n (1..100) { print a($n), ", " }; #

Extensions

a(12)-a(14) from Michael S. Branicky, Dec 15 2024
a(15) from Daniel Suteu, Dec 17 2024

A376675 a(n) is the least prime p such that p + 7*k*(k+1) is prime for 0 <= k <= n-1 but not for k=n.

Original entry on oeis.org

2, 3, 59, 5, 89, 599, 3329, 617, 269, 21107, 9833477, 19497833669, 215830859597, 111338387, 251704297005767, 17
Offset: 1

Author

J.W.L. (Jan) Eerland, Oct 01 2024

Keywords

Crossrefs

Programs

  • Maple
    f:= proc(p) local k;
      for k from 1 while isprime(p+k*(k+1)*7) do od:
      k
    end proc:
    A:= Vector(12): count:= 0:
    for i from 1 while count < 12 do
      v:= f(ithprime(i));
      if A[v] = 0 then count:= count+1; A[v]:= ithprime(i) fi
    od:
    convert(A,list);
  • Mathematica
    Table[p=1;m=7;Monitor[Parallelize[While[True,If[And[MemberQ[PrimeQ[Table[p+m*k*(k+1),{k,0,n-1}]],False]==False,PrimeQ[p+m*n*(n+1)]==False],Break[]];p++];p],p],{n,1,10}]
  • PARI
    isok(p, n) = for (k=0, n-1, if (! isprime(p + 7*k*(k+1)), return(0))); return (!isprime(p + 7*n*(n+1)));
    a(n) = my(p=2); while (!isok(p, n), p=nextprime(p+1)); p;
    
  • Perl
    use ntheory qw(:all); sub a { my $n = $[0]; my $lo = 2; my $hi = 2*$lo; while (1) { my @terms = grep { !is_prime($ + 7*$n*($n+1)) } sieve_prime_cluster($lo, $hi, map { 7*$*($+1) } 1 .. $n-1); return $terms[0] if @terms; $lo = $hi+1; $hi = 2*$lo; } }; $| = 1; for my $n (1..100) { print a($n), ", " }; # Daniel Suteu, Oct 04 2024

Extensions

a(11)-a(12) from Hugo Pfoertner, Oct 01 2024
a(13)-a(14) from Hugo Pfoertner, Oct 03 2024
a(15)-a(16) from Daniel Suteu, Oct 04 2024

A371024 a(n) is the least prime p such that p + 4*k*(k+1) is prime for 0 <= k <= n-1 but not for k=n.

Original entry on oeis.org

2, 3, 29, 5, 23, 269, 272879, 149, 61463, 929, 7426253, 2609, 233, 59, 78977932125503
Offset: 1

Author

J.W.L. (Jan) Eerland, Mar 08 2024

Keywords

Comments

a(15) > 3277860277, a(16) > 3103623446, a(17) > 2853255995,
a(18) = 653, a(19) > 2480173428, a(20) > 2058783580, a(21) > 1894529774, a(22) > 1896261075, a(23) > 1836831342, a(24), ..., a(100) > 15000000.
Other than a(1)-a(14) and a(18), no terms < 24870000007. - Michael S. Branicky, Apr 12 2024
From David A. Corneth, Apr 12 2024: (Start)
Using remainders mod q we can restrict the search. For example for a(15) a term can only be 2, 3 or 5 (mod 7). Or maybe 7 itself. If a(15) = p == 1 (mod 7) then for k = 3 we have q + 4*3*(3+1) == 0 mod 7. Similarily number 0, 4 and 6 (mod 7) produce a multiple of 7 where they should not.
Doing so for various primes mod q we can reduce the number of remainders and with that the search space by combining the possible remainders using the Chinese Remainder Theorem (CRT).
So the possible remainders mod 2 are 1. The possible remainders mod 3 are 2. Using the CRT, a number of the form 1 (mod 2) and 2 (mod 3) simultaneously is of the form 5 (mod 6).
a(15) > 2.3*10^13 if it exists. (End)

Crossrefs

Programs

  • Maple
    f:= proc(p) local k;
      for k from 1 while isprime(p+k*(k+1)*4) do od:
      k
    end proc:
    A:= Vector(12): count:= 0:
    for i from 1 while count < 12 do
      v:= f(ithprime(i));
      if A[v] = 0 then count:= count+1; A[v]:= ithprime(i) fi
    od:
    convert(A,list);
  • Mathematica
    Table[p=1;m=4;Monitor[Parallelize[While[True,If[And[MemberQ[PrimeQ[Table[p+m*k*(k+1),{k,0,n-1}]],False]==False,PrimeQ[p+m*n*(n+1)]==False],Break[]];p++];p],p],{n,1,10}]
  • PARI
    isok(p, n) = for (k=0, n-1, if (! isprime(p + 4*k*(k+1)), return(0))); return (!isprime(p + 4*n*(n+1)));
    a(n) = my(p=2); while (!isok(p, n), p=nextprime(p+1)); p; \\ Michel Marcus, Mar 12 2024
    
  • Perl
    use ntheory qw(:all); sub a { my $n = $[0]; my $lo = 2; my $hi = 2*$lo; while (1) { my @terms = grep { !is_prime($ + 4*$n*($n+1)) } sieve_prime_cluster($lo, $hi, map { 4*$*($+1) } 1 .. $n-1); return $terms[0] if @terms; $lo = $hi+1; $hi = 2*$lo; } }; $| = 1; for my $n (1..100) { print a($n), ", " }; # Daniel Suteu, Dec 17 2024
  • Python
    from sympy import isprime, nextprime
    from itertools import count, islice
    def f(p):
        k = 1
        while isprime(p+4*k*(k+1)): k += 1
        return k
    def agen(verbose=False): # generator of terms
        adict, n, p = dict(), 1, 1
        while True:
            p = nextprime(p)
            v = f(p)
            if v not in adict:
                adict[v] = p
                if verbose: print("FOUND", v, p)
            while n in adict:
                yield adict[n]; n += 1
    print(list(islice(agen(), 14))) # Michael S. Branicky, Apr 12 2024
    

Extensions

a(15) from Daniel Suteu, Dec 17 2024

A370387 a(n) is the least prime p such that p + 6*k*(k+1) is prime for 0 <= k <= n-1 but not for k=n.

Original entry on oeis.org

2, 19, 5, 67, 7, 281, 1051, 6791, 11, 115599457, 365705201, 79352440891, 286351937491, 5810592517241, 17, 1942721697854617
Offset: 1

Author

J.W.L. (Jan) Eerland, Mar 12 2024

Keywords

Comments

a(10), ..., a(14) > 10^7, a(15) = 17, a(16), ..., a(20) > 10^7.
a(29) = 31. - Chai Wah Wu, Apr 10 2024

Crossrefs

Programs

  • Maple
    f:= proc(p) local k;
      for k from 1 while isprime(p+k*(k+1)*6) do od:
      k
    end proc:
    A:= Vector(12): count:= 0:
    for i from 1 while count < 12 do
      v:= f(ithprime(i));
      if A[v] = 0 then count:= count+1; A[v]:= ithprime(i) fi
    od:
    convert(A,list);
  • Mathematica
    Table[p=1;m=6;Monitor[Parallelize[While[True,If[And[MemberQ[PrimeQ[Table[p+m*k*(k+1),{k,0,n-1}]],False]==False,PrimeQ[p+m*n*(n+1)]==False],Break[]];p++];p],p],{n,1,10}]
  • PARI
    isok(p, n) = for (k=0, n-1, if (! isprime(p + 6*k*(k+1)), return(0))); return (!isprime(p + 6*n*(n+1)));
    a(n) = my(p=2); while (!isok(p, n), p=nextprime(p+1)); p;
    
  • Perl
    use ntheory qw(:all); sub a { my $n = $[0]; my $lo = 2; my $hi = 2*$lo; while (1) { my @terms = grep { !is_prime($ + 6*$n*($n+1)) } sieve_prime_cluster($lo, $hi, map { 6*$*($+1) } 1 .. $n-1); return $terms[0] if @terms; $lo = $hi+1; $hi = 2*$lo; } }; $| = 1; for my $n (1..100) { print a($n), ", " } # Daniel Suteu, Dec 30 2024

Extensions

a(10)-a(11) from Chai Wah Wu, Apr 10 2024
a(12) from Chai Wah Wu, Apr 11 2024
a(13)-a(14) from David A. Corneth, Apr 11 2024
a(15) from J.W.L. (Jan) Eerland, Mar 12 2024
a(16) from Daniel Suteu, Dec 30 2024

A253605 Primes p such that the polynomial x^2 + x + p generates only primes for x=1..13.

Original entry on oeis.org

17, 41, 27649987598537, 30431463129071, 58326356511581, 161966446726157, 291598227841757
Offset: 1

Author

Zak Seidov, Jan 05 2015

Keywords

Crossrefs

Subsequence of A253592 and A191458. Cf. A164926.

Programs

Extensions

a(5)-a(7) from Daniel Suteu, Dec 22 2024

A230663 Least prime p such that x^2 + 3*x + p produces primes for x = 0..n-1 but not x = n.

Original entry on oeis.org

2, 67, 3, 349, 79, 439, 21559, 14713, 13, 8123233, 223, 3468214093, 1701300344203, 11613197109589, 19
Offset: 1

Author

Zak Seidov, Oct 27 2013

Keywords

Comments

a(39) = 43 and all other terms > 128865958933.

Crossrefs

Cf. A164926.

Programs

  • Mathematica
    Table[p = 2; While[! (Union[Table[PrimeQ[x^2 + 3*x + p], {x, 0, n - 1}]] == {True} && PrimeQ[n^2 + 3*n + p] == False), p = NextPrime[p]]; p, {n, 9}] (* T. D. Noe, Oct 29 2013 *)
  • PARI
    isok(p, n) = for (k=0, n-1, if(!isprime(p + k*(k+3)), return(0))); return(!isprime(p + n*(n+3)));
    a(n) = forprime(p=2, oo, if(isok(p, n), return(p))); \\ Daniel Suteu, Dec 22 2024
    
  • Perl
    use ntheory qw(:all); sub a { my $n = $[0]; my $lo = 2; my $hi = 2*$lo; while (1) { my @terms = grep { !is_prime($ + $n*($n+3)) } sieve_prime_cluster($lo, $hi, map { $*($+3) } 1 .. $n-1); return $terms[0] if @terms; $lo = $hi+1; $hi = 2*$lo; } }; $| = 1; for my $n (1..100) { print a($n), ", " } # Daniel Suteu, Dec 22 2024

Extensions

a(13)-a(15) from Daniel Suteu, Dec 22 2024

A165234 Least prime p such that 2x^2 + p produces primes for x=0..n-1 and composite for x=n.

Original entry on oeis.org

2, 17, 3, 1481, 5, 149, 569, 2081, 2339, 5939831, 11, 33164857769, 3217755097229, 272259344081, 17762917045631
Offset: 1

Author

T. D. Noe, Sep 09 2009

Keywords

Comments

Other known values: a(14)=272259344081 and a(29)=29. There are no other terms less than 10^12. The primes p = 3, 5, 11, and 29 produce p consecutive distinct primes because the imaginary quadratic field Q(sqrt(-2p)) has class number 2. Assuming the prime k-tuples conjecture, this sequence is defined for n>0.

References

  • Paulo Ribenboim, My Numbers, My Friends, Springer,2000, pp. 349-350.

Crossrefs

Programs

  • Mathematica
    PrimeRun[p_Integer] := Module[{k=0}, While[PrimeQ[2k^2+p], k++ ]; k]; nn=9; t=Table[0,{nn}]; cnt=0; p=1; While[cnt
    				
  • PARI
    isok(p, n) = for (k=0, n-1, if(!isprime(p + 2*k^2), return(0))); return(!isprime(p + 2*n^2));
    a(n) = forprime(p=2, oo, if(isok(p, n), return(p))); \\ Daniel Suteu, Dec 22 2024
    
  • Perl
    use ntheory qw(:all); sub a { my $n = $[0]; my $lo = 2; my $hi = 2*$lo; while (1) { my @terms = grep { !is_prime($ + 2*$n*$n) } sieve_prime_cluster($lo, $hi, map { 2*$*$ } 1 .. $n-1); return $terms[0] if @terms; $lo = $hi+1; $hi = 2*$lo; } }; $| = 1; for my $n (1..100) { print a($n), ", " } # Daniel Suteu, Dec 22 2024

Extensions

a(13) and a(15) from Daniel Suteu, Dec 22 2024