OFFSET
1,2
COMMENTS
Also numbers n such that all terms in row n of A087401 are not prime. Also the index of the triangular numbers in A076768. See A087572 for the least prime, if it exists. David Wasserman points out (in A087572) that n is in this sequence if and only if n and 2n-1 are both not prime. This sequence is infinite because 2k^2 is a term for all k>1.
LINKS
T. D. Noe, Table of n, a(n) for n=1..1000
EXAMPLE
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.
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 *)
PROG
(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
(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
CROSSREFS
KEYWORD
nice,nonn
AUTHOR
T. D. Noe, Mar 26 2008
STATUS
approved