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.

A264828 Nonprimes that are not twice a prime.

This page as a plain text file.
%I A264828 #62 Oct 17 2024 17:44:20
%S A264828 1,8,9,12,15,16,18,20,21,24,25,27,28,30,32,33,35,36,39,40,42,44,45,48,
%T A264828 49,50,51,52,54,55,56,57,60,63,64,65,66,68,69,70,72,75,76,77,78,80,81,
%U A264828 84,85,87,88,90,91,92,93,95,96,98,99,100,102,104
%N A264828 Nonprimes that are not twice a prime.
%C A264828 Except for the initial 1, if n is in the sequence, so is k*n for all k > 1. So the odd semiprimes (A046315) and numbers of the form 4*p (A001749) where p is prime are core subsequences which give the initial terms of arithmetic progressions in this sequence. - _Altug Alkan_, Nov 29 2015
%H A264828 N. J. A. Sloane, <a href="/A264828/b264828.txt">Table of n, a(n) for n = 1..20000</a> [Terms 1 to 10000 from _Robert Israel_.]
%F A264828 a(n) = A009188(n-2) for n>=3. - _Alois P. Heinz_, Oct 17 2024
%p A264828 Primes, Nonprimes:= selectremove(isprime, {$1..1000}):
%p A264828 sort(convert(Nonprimes minus map(`*`,Primes,2),list)); # _Robert Israel_, Nov 30 2015
%t A264828 Select[Range@ 104, And[! PrimeQ@ #, Or[PrimeOmega@ # != 2, OddQ@ #]] &] (* _Michael De Vlieger_, Nov 27 2015 *)
%t A264828 Select[Range@110, Nor[PrimeQ[#], PrimeQ[#/2]] &] (* _Vincenzo Librandi_, Jan 22 2016 *)
%o A264828 (PARI) print1(1, ", "); forcomposite(n=1, 1e3, if(n % 2 == 1 || !isprime(n/2), print1(n, ", "))) \\ _Altug Alkan_, Dec 01 2015
%o A264828 (Python)
%o A264828 from itertools import count, islice
%o A264828 from sympy import isprime
%o A264828 def A264828_gen(startvalue=1): # generator of terms >= startvalue
%o A264828     return filter(lambda n:not (isprime(n) or (n&1^1 and isprime(n>>1))),count(max(startvalue,1)))
%o A264828 A264828_list = list(islice(A264828_gen(),20)) # _Chai Wah Wu_, Mar 26 2024
%o A264828 (Python)
%o A264828 from sympy import primepi
%o A264828 def A264828(n):
%o A264828     def f(x): return int(n+primepi(x)+primepi(x>>1))
%o A264828     m, k = n, f(n)
%o A264828     while m != k: m, k = k, f(k)
%o A264828     return m # _Chai Wah Wu_, Oct 17 2024
%Y A264828 Cf. A009188, A018252, A100484.
%K A264828 nonn,easy
%O A264828 1,2
%A A264828 _Giovanni Teofilatto_, Nov 26 2015