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.

A066805 a(n) is the least k such that n + Sum_{i=1..k} A018252(i) is prime; or 0 if none exists.

Original entry on oeis.org

1, 1, 5, 1, 6, 1, 8, 2, 5, 1, 7, 1, 5, 2, 5, 1, 7, 1, 5, 3, 6, 1, 6, 2, 5, 2, 13, 1, 6, 1, 5, 2, 5, 4, 6, 1, 8, 2, 5, 1, 6, 1, 5, 10, 5, 1, 7, 2, 8, 3, 5, 1, 7, 2, 5, 2, 7, 1, 6, 1, 5, 2, 6, 4, 6, 1, 8, 2, 5, 1, 6, 1, 5, 2, 5, 27, 7, 1, 5, 11, 5, 1, 15, 2, 5
Offset: 1

Views

Author

Joseph L. Pe, Jan 19 2002

Keywords

Comments

Is a(n) nonzero for all n? If so, then every n can be represented as the difference of a prime and a partial sum of the nonprime numbers series. See A066753 for a related possible representation of n as the difference of a prime and a partial sum of the prime numbers series.

Examples

			3 + (1 + 4 + 6 + 8 + 9) = 31, a prime and 5 consecutive nonprime numbers starting with 1 are required to achieve this. Hence a(3) = 5.
		

Crossrefs

Programs

  • PARI
    a(n) = my(c=0, s=n); for(k=1, oo, until(!isprime(c), c++); if(isprime(s+=c), return(k))); \\ Jinyuan Wang, Jul 30 2020

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Jun 12 2002