A264828 Nonprimes that are not twice a prime.
1, 8, 9, 12, 15, 16, 18, 20, 21, 24, 25, 27, 28, 30, 32, 33, 35, 36, 39, 40, 42, 44, 45, 48, 49, 50, 51, 52, 54, 55, 56, 57, 60, 63, 64, 65, 66, 68, 69, 70, 72, 75, 76, 77, 78, 80, 81, 84, 85, 87, 88, 90, 91, 92, 93, 95, 96, 98, 99, 100, 102, 104
Offset: 1
Links
- N. J. A. Sloane, Table of n, a(n) for n = 1..20000 [Terms 1 to 10000 from _Robert Israel_.]
Programs
-
Maple
Primes, Nonprimes:= selectremove(isprime, {$1..1000}): sort(convert(Nonprimes minus map(`*`,Primes,2),list)); # Robert Israel, Nov 30 2015
-
Mathematica
Select[Range@ 104, And[! PrimeQ@ #, Or[PrimeOmega@ # != 2, OddQ@ #]] &] (* Michael De Vlieger, Nov 27 2015 *) Select[Range@110, Nor[PrimeQ[#], PrimeQ[#/2]] &] (* Vincenzo Librandi, Jan 22 2016 *)
-
PARI
print1(1, ", "); forcomposite(n=1, 1e3, if(n % 2 == 1 || !isprime(n/2), print1(n, ", "))) \\ Altug Alkan, Dec 01 2015
-
Python
from itertools import count, islice from sympy import isprime def A264828_gen(startvalue=1): # generator of terms >= startvalue return filter(lambda n:not (isprime(n) or (n&1^1 and isprime(n>>1))),count(max(startvalue,1))) A264828_list = list(islice(A264828_gen(),20)) # Chai Wah Wu, Mar 26 2024
-
Python
from sympy import primepi def A264828(n): def f(x): return int(n+primepi(x)+primepi(x>>1)) m, k = n, f(n) while m != k: m, k = k, f(k) return m # Chai Wah Wu, Oct 17 2024
Formula
a(n) = A009188(n-2) for n>=3. - Alois P. Heinz, Oct 17 2024
Comments