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.

Showing 1-2 of 2 results.

A253827 a(n) is the number of primes of the form x^2 + x + prime(n) for 0 <= x <=prime(n).

Original entry on oeis.org

1, 2, 4, 4, 10, 4, 16, 6, 10, 13, 14, 16, 40, 8, 26, 19, 34, 21, 36, 28, 18, 18, 34, 27, 31, 68, 16, 71, 30, 23, 37, 37, 67, 44, 54, 55, 54, 26, 65, 50, 70, 68, 79, 43, 60, 70, 52, 51, 132, 38, 60, 100, 59, 111, 114, 84, 77, 68, 78, 105, 49, 67, 124, 145, 35
Offset: 1

Views

Author

Michel Lagneau, Jan 16 2015

Keywords

Comments

Equivalently, number of distinct primes of the form x^2 - x + prime(n) for 0 <= x <= prime(n). (The point is that x^2 + x = (x+1)^2 - (x+1), so the two forms give the same numbers. x^2 - x + prime(n) is the same for x=0 and x=1, which is why the "distinct" in the comment. - Robert Israel, Oct 09 2016)
1 <= a(n) <= prime(n)-1. a(n) = prime(n)-1 iff n is in A014556. Are there any n > 1 such that a(n) = 1? - Robert Israel, Jan 16 2015

Examples

			a(13) = 40 because prime(13) = 41 and x^2 + x + 41 generates 40 prime numbers for x = 0..41.
		

Crossrefs

Programs

  • Maple
    f:= proc(n)
    local p,x;
    p:= ithprime(n);
    nops(select(isprime, [seq(x^2+x+p,x=0..p)]))
    end proc:
    seq(f(n), n=1..100); # Robert Israel, Jan 16 2015
  • Mathematica
    lst={};Do[p=Prime[n];k=0;Do[If[PrimeQ[x^2+x+p],k=k+1],{x,0,p}];AppendTo[lst,k],{n,1,100}];lst
    Table[With[{p=Prime[n]},Count[Table[x^2+x+p,{x,0,p}],?PrimeQ]],{n,70}] (* _Harvey P. Dale, May 27 2018 *)
  • PARI
    a(n) = my(p=prime(n)); sum(k=0, p, isprime(subst(x^2+x+p, x, k))); \\ Michel Marcus, Jan 16 2015

A228185 Number of semiprimes generated from Euler's polynomial x^2 + x + 41 from x = 1 to 10^n.

Original entry on oeis.org

0, 14, 393, 4761, 47938, 456157, 4293575, 40357922
Offset: 1

Views

Author

Shyam Sunder Gupta, Aug 15 2013

Keywords

Examples

			a(4) = 4761 because the number of semiprimes generated from Euler's polynomial x^2 + x + 41 from x = 1 to 10^4 are 4761.
		

Crossrefs

Cf. A228123.

Programs

  • Mathematica
    a = 0; n = 1; t = {}; Do[If[PrimeOmega[x^2 + x + 41]== 2, a = a + 1]; If[Mod[x, n] == 0, n = n*10; AppendTo[t, a]], {x, 1, 100000000}]; t
    nn=8;With[{ep=If[PrimeOmega[#]==2,1,0]&/@Table[x^2+x+41,{x,10^nn}]}, Table[ Total[Take[ep,10^n]],{n,nn}]] (* Harvey P. Dale, Dec 12 2014 *)
Showing 1-2 of 2 results.