OFFSET
1,1
COMMENTS
Values of n for which composite n X n magic squares are possible. - J. Lowell, May 20 2010
If n is in the sequence, k*n is in the sequence for all k > 1. So odd semiprimes (A046315) and numbers of the form 4*p where p is an odd prime are core subsequences which give the initial terms of arithmetic progressions in this sequence. - Altug Alkan, Nov 29 2015
Numbers appearing more than once in A009004. - Sean A. Irvine, Apr 20 2018
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = A264828(n+2). - Chai Wah Wu, Oct 17 2024
MAPLE
filter:= proc(n) not isprime(n) and (n::odd or not isprime(n/2)) end proc:
select(filter, [$9 .. 10000]); # Robert Israel, Nov 30 2015
MATHEMATICA
filterQ[n_] := !PrimeQ[n] && (OddQ[n] || !PrimeQ[n/2]);
Select[Range[9, 120], filterQ] (* Jean-François Alcover, Feb 28 2019, from Maple *)
PROG
(PARI) forcomposite(n=9, 1e3, if(n % 2 == 1 || !isprime(n/2), print1(n, ", "))) \\ Altug Alkan, Dec 01 2015
(Python)
from sympy import primepi
def A009188(n):
def f(x): return int(n+2+primepi(x)+primepi(x>>1))
m, k = n+2, f(n+2)
while m != k: m, k = k, f(k)
return m # Chai Wah Wu, Oct 17 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved