A138666 Numbers n such that every sum of consecutive positive numbers ending in n is not prime.
1, 8, 14, 18, 20, 25, 26, 28, 32, 33, 35, 38, 39, 44, 46, 48, 50, 56, 58, 60, 62, 63, 65, 68, 72, 74, 77, 78, 80, 81, 85, 86, 88, 92, 93, 94, 95, 98, 102, 104, 105, 108, 110, 111, 116, 118, 119, 122, 123, 124, 125, 128, 130, 133, 134, 138, 140, 143, 144, 145, 146, 148
Offset: 1
Examples
8 is in this sequence because 8, 15=7+8, 21=6+7+8, 26=5+6+7+8, 30=4+5+6+7+8, 33=3+4+5+6+7+8, 35=2+3+4+5+6+7+8 and 36=1+2+3+4+5+6+7+8 are all composite.
Links
- T. D. Noe, Table of n, a(n) for n=1..1000
Crossrefs
Cf. A010051.
Programs
-
Haskell
a138666 n = a138666_list !! (n-1) a138666_list = map (head . tail) $ filter (all (== 0) . map a010051 . tail) $ drop 2 a087401_tabl -- Reinhard Zumkeller, Oct 03 2012
-
Mathematica
Select[Range[200], !PrimeQ[ # ] && !PrimeQ[2#-1] &] Select[Range[150],AllTrue[Accumulate[Reverse[Range[#]]],!PrimeQ[#]&]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Mar 18 2017 *)
-
Python
from sympy import isprime from itertools import accumulate def ok(n): return all(not isprime(s) for s in accumulate(range(n, 0, -1))) def aupto(nn): return [m for m in range(1, nn+1) if ok(m)] print(aupto(148)) # Michael S. Branicky, Jan 08 2021
Comments