OFFSET
1,3
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.
EXAMPLE
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.
PROG
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Joseph L. Pe, Jan 19 2002
EXTENSIONS
More terms from Larry Reeves (larryr(AT)acm.org), Jun 12 2002
STATUS
approved