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!)
A257393 Primes which are not the sum of two or more consecutive nonprime numbers. 3
2, 3, 7, 13, 47, 61, 73, 107, 167, 179, 313, 347, 421, 479, 719, 863, 1153, 1213, 1283, 1307, 1523, 3467, 3733, 4007, 4621, 4787, 5087, 5113, 5413, 7523, 7703, 9817, 10333, 12347, 12539, 13381, 17027, 18553, 19717, 19813, 23399, 26003, 31873, 36097, 38833 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Numbers n such that A257392(n) = 0.
LINKS
EXAMPLE
2 and 3 are in this sequence because nonnegative nonprime(1) + nonnegative nonprime(2) = 0 + 1 = 1 < 2 and nonnegative nonprime(2) + nonnegative nonprime(3) = 1 + 4 = 5 > 3 where 2, 3 are primes.
MAPLE
N:= 5000: # to get all terms <= N
Primes:= select(isprime, {2, seq(2*i+1, i=1..floor((N-1)/2))}):
Nonprimes:= sort(convert({$1..N} minus Primes, list)):
nnp:= nops(Nonprimes):
PSums:= [0, op(ListTools[PartialSums](Nonprimes))]:
A:= Primes:
mA:= max(A):
for i from 1 to nnp do
for j from i+2 to nnp+1 while PSums[j] - PSums[i] <= mA do od;
A:= A minus {seq(PSums[k]-PSums[i], k=i+2..j-1)};
od od:
A;
# if using Maple 11 or earlier, uncomment the next line
# sort(convert(A, list)); # Robert Israel, Apr 21 2015
MATHEMATICA
lim = 1000; s = {1}~Join~Select[Range@lim, CompositeQ]; Complement[Prime@ Range[PrimePi@ lim], DeleteDuplicates@ Sort@ Flatten[Plus @@@ Partition[s, #, 1] & /@ Range[lim - PrimePi@ lim]]] (* Michael De Vlieger, Apr 21 2015 *)
CROSSREFS
Sequence in context: A206579 A349327 A166945 * A273814 A371131 A361988
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
a(7) - a(26) from Michael De Vlieger, Apr 21 2015
a(27) - a(45) from Robert Israel, Apr 21 2015
STATUS
approved

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 June 27 00:54 EDT 2024. Contains 373723 sequences. (Running on oeis4.)