%I M4598 #47 Sep 18 2022 11:06:20
%S 9,10,15,16,21,22,25,26,27,28,33,34,35,36,39,40,45,46,49,50,51,52,55,
%T 56,57,58,63,64,65,66,69,70,75,76,77,78,81,82,85,86,87,88,91,92,93,94,
%U 95,96,99,100,105,106,111,112,115,116,117,118,119,120,121,122
%N Numbers k such that k and k-1 are composite.
%C Position where the composites first outnumber the primes by n, among the first natural numbers. - _Lekraj Beedassy_, Jul 11 2006
%D M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 844.
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H J. Stauduhar, <a href="/A005381/b005381.txt">Table of n, a(n) for n = 1..10000</a>
%H M. Abramowitz and I. A. Stegun, eds., <a href="http://www.convertit.com/Go/ConvertIt/Reference/AMS55.ASP">Handbook of Mathematical Functions</a>, National Bureau of Standards, Applied Math. Series 55, Tenth Printing, 1972 [alternative scanned copy].
%H R. P. Boas & N. J. A. Sloane, <a href="/A005381/a005381.pdf">Correspondence, 1974</a>
%H B. W. J. Irwin, <a href="https://www.authorea.com/users/5445/articles/111406/_show_article">Recursive Modular Conjecture for pi(n)</a>.
%F Conjecture: pi(n)=Sum_{k=1..n} k mod a(m) mod a(m-1) ... mod a(1) mod 2, for all values 1<n<=a(m), where the mod are evaluated from left to right. Verified for first 10000 a(n). - _Benedict W. J. Irwin_, May 04 2016
%F As a check, take n=9, m=2, a(m)=10. Then we must take the numbers 1 through 9 and reduce them mod 10 then mod 9 then mod 2. The results are 1,0,1,0,1,0,1,0,0, whose sum is 4 = pi(9), as predicted. - _N. J. A. Sloane_, May 05 2016
%F For an attempt at a proof for the conjecture above, see the link. If it is true, then for n>2, isprime(n)=(n mod x) mod 2, where x is the largest a(n)<=n. - _Benedict W. J. Irwin_, May 06 2016
%p isA005381 := proc(n)
%p not isprime(n) and not isprime(n-1) ;
%p end proc:
%p A005381 := proc(n)
%p local a;
%p option remember;
%p if n = 1 then
%p 9;
%p else
%p for a from procname(n-1)+1 do
%p if isA005381(a) then
%p return a;
%p end if;
%p end do:
%p end if;
%p end proc: # _R. J. Mathar_, Jul 14 2015
%p # second Maple program:
%p q:= n-> ormap(isprime, [n, n-1]):
%p remove(q, [$2..130])[]; # _Alois P. Heinz_, Dec 26 2021
%t Select[Range[2, 200], ! PrimeQ[# - 1] && ! PrimeQ[#] &]
%o (PARI) is(n)=!isprime(n)&&!isprime(n-1) \\ _M. F. Hasler_, Jan 07 2019
%o (Python)
%o from sympy import isprime
%o def ok(n): return n > 3 and not isprime(n) and not isprime(n-1)
%o print([k for k in range(122) if ok(k)]) # _Michael S. Branicky_, Dec 26 2021
%Y Equals A068780 + 1. Cf. A007921.
%Y Cf. A093515 (complement, apart from 1 which is in neither sequence), A323162 (characteristic function).
%K nonn,easy
%O 1,1
%A _N. J. A. Sloane_