cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A138666 Numbers n such that every sum of consecutive positive numbers ending in n is not prime.

This page as a plain text file.
%I A138666 #13 Jan 08 2021 14:29:20
%S A138666 1,8,14,18,20,25,26,28,32,33,35,38,39,44,46,48,50,56,58,60,62,63,65,
%T A138666 68,72,74,77,78,80,81,85,86,88,92,93,94,95,98,102,104,105,108,110,111,
%U A138666 116,118,119,122,123,124,125,128,130,133,134,138,140,143,144,145,146,148
%N A138666 Numbers n such that every sum of consecutive positive numbers ending in n is not prime.
%C A138666 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.
%H A138666 T. D. Noe, <a href="/A138666/b138666.txt">Table of n, a(n) for n=1..1000</a>
%e A138666 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.
%t A138666 Select[Range[200], !PrimeQ[ # ] && !PrimeQ[2#-1] &]
%t A138666 Select[Range[150],AllTrue[Accumulate[Reverse[Range[#]]],!PrimeQ[#]&]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, Mar 18 2017 *)
%o A138666 (Haskell)
%o A138666 a138666 n = a138666_list !! (n-1)
%o A138666 a138666_list = map (head . tail) $
%o A138666    filter (all (== 0) . map a010051 . tail) $ drop 2 a087401_tabl
%o A138666 -- _Reinhard Zumkeller_, Oct 03 2012
%o A138666 (Python)
%o A138666 from sympy import isprime
%o A138666 from itertools import accumulate
%o A138666 def ok(n): return all(not isprime(s) for s in accumulate(range(n, 0, -1)))
%o A138666 def aupto(nn): return [m for m in range(1, nn+1) if ok(m)]
%o A138666 print(aupto(148)) # _Michael S. Branicky_, Jan 08 2021
%Y A138666 Cf. A010051.
%K A138666 nice,nonn
%O A138666 1,2
%A A138666 _T. D. Noe_, Mar 26 2008