OFFSET
1,1
COMMENTS
Position where the composites first outnumber the primes by n, among the first natural numbers. - Lekraj Beedassy, Jul 11 2006
REFERENCES
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.
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
J. Stauduhar, Table of n, a(n) for n = 1..10000
M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards, Applied Math. Series 55, Tenth Printing, 1972 [alternative scanned copy].
R. P. Boas & N. J. A. Sloane, Correspondence, 1974
B. W. J. Irwin, Recursive Modular Conjecture for pi(n).
FORMULA
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
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
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
MAPLE
isA005381 := proc(n)
not isprime(n) and not isprime(n-1) ;
end proc:
A005381 := proc(n)
local a;
option remember;
if n = 1 then
9;
else
for a from procname(n-1)+1 do
if isA005381(a) then
return a;
end if;
end do:
end if;
end proc: # R. J. Mathar, Jul 14 2015
# second Maple program:
q:= n-> ormap(isprime, [n, n-1]):
remove(q, [$2..130])[]; # Alois P. Heinz, Dec 26 2021
MATHEMATICA
Select[Range[2, 200], ! PrimeQ[# - 1] && ! PrimeQ[#] &]
PROG
(PARI) is(n)=!isprime(n)&&!isprime(n-1) \\ M. F. Hasler, Jan 07 2019
(Python)
from sympy import isprime
def ok(n): return n > 3 and not isprime(n) and not isprime(n-1)
print([k for k in range(122) if ok(k)]) # Michael S. Branicky, Dec 26 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved