login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A066868 a(n) is the least k such that n + Sum_{i=1..k} A005385(i) is prime; or 0 if none exists. 0

%I #7 Aug 01 2020 11:38:03

%S 2,1,10,5,2,1,2,1,12,5,2,1,4,1,4,5,2,1,2,3,4,7,12,1,2,1,4,7,2,3,2,1,4,

%T 5,2,1,4,1,6,17,2,1,4,3,6,5,2,1,2,3,4,11,12,1,2,1,4,5,2,3,2,1,4,5,14,

%U 1,2,1,10,5,2,7,10,1,6,7,2,1,8,3,4,7,26,1

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

%C Conjecture: a(n) is nonzero for all n, so every n can be represented as the difference between a prime and a partial sum of the safe primes series. See A066753 for a similar conjecture.

%e 4 + (5 + 7 + 11 + 23 + 47) = 97, a prime and 5 consecutive safe primes, starting from the first safe prime 5, are needed to achieve this. Hence a(4) = 5.

%o (PARI) a(n) = my(p=3, s=n); for(k=1, oo, until(isprime((p-1)/2), p=nextprime(p+1)); if(isprime(s+=p), return(k))); \\ _Jinyuan Wang_, Jul 30 2020

%Y Cf. A005385, A066753.

%K nonn,less

%O 1,1

%A _Joseph L. Pe_, Jan 21 2002

%E Offset changed to 1 by _Jinyuan Wang_, Jul 30 2020

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 20:08 EDT 2024. Contains 371963 sequences. (Running on oeis4.)