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.

A239723 Least number k such that n^k + (n+1)^k + ... + (n+k-1)^k is prime or 0 if no such number exists.

Original entry on oeis.org

2, 1, 1, 2, 1, 0, 1, 0, 2, 0, 1, 2, 1, 2, 0, 6, 1, 0, 1, 0, 6, 2, 1, 2, 2, 0, 0, 0, 1, 2, 1, 2, 0, 2, 2, 0, 1, 0, 2, 0, 1, 2, 1, 0, 0, 0, 1, 6, 0, 2, 0, 0, 1, 0, 0, 0, 0, 6, 1, 2, 1, 0, 0, 0, 2, 0, 1, 0, 2, 2, 1, 2, 1, 0, 0, 6, 0, 0, 1, 0, 0, 2, 1, 2, 2, 0, 2, 0, 1, 2, 6
Offset: 1

Views

Author

Derek Orr, May 30 2014

Keywords

Comments

a(119) = 42. Is a(n) only equal to 0, 1, 2, 6, or 42?
a(n) = 0 is confirmed for k <= 500. See A242927.

Examples

			1^1 = 1 is not prime. 1^2+2^2 = 5 is prime. Thus a(1) = 2.
		

Crossrefs

Cf. A242927.

Programs

  • PARI
    a(n)=for(k=1,500,if(ispseudoprime(sum(i=0,k-1,(n+i)^k)),return(k)))
    n=1;while(n<200,print1(a(n),", ");n+=1)