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.

A256421 Odd numbers and twice primes, sorted.

This page as a plain text file.
%I A256421 #15 Oct 15 2024 15:43:10
%S A256421 1,3,4,5,6,7,9,10,11,13,14,15,17,19,21,22,23,25,26,27,29,31,33,34,35,
%T A256421 37,38,39,41,43,45,46,47,49,51,53,55,57,58,59,61,62,63,65,67,69,71,73,
%U A256421 74,75,77,79,81,82,83,85,86,87,89,91,93,94
%N A256421 Odd numbers and twice primes, sorted.
%H A256421 Charles R Greathouse IV, <a href="/A256421/b256421.txt">Table of n, a(n) for n = 1..10000</a>
%F A256421 a(n) ~ 2n. - _Charles R Greathouse IV_, Apr 07 2015
%t A256421 Select[Range@94,PrimeQ[#/2]||OddQ[#]&] (* _Ivan N. Ianakiev_, Apr 08 2015 *)
%o A256421 (PARI) lista(nn) = nb = primepi(nn)\2; vecsort(setunion(vector(prime(nb), n, 2*n-1), 2*primes(nb))); \\ _Michel Marcus_, Apr 07 2015
%o A256421 (PARI) list(lim)=setunion(vector((lim+1)\2,i,2*i-1), 2*primes([2,lim])) \\ _Charles R Greathouse IV_, Apr 07 2015
%o A256421 (Python)
%o A256421 from sympy import primepi
%o A256421 def A256421(n):
%o A256421     def f(x): return int(n+(m:=x>>1)-primepi(m))
%o A256421     m, k = n, f(n)
%o A256421     while m != k: m, k = k, f(k)
%o A256421     return m # _Chai Wah Wu_, Oct 15 2024
%Y A256421 Cf. A256420.
%K A256421 nonn
%O A256421 1,2
%A A256421 _N. J. A. Sloane_, Apr 07 2015