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.

Showing 1-1 of 1 results.

A256421 Odd numbers and twice primes, sorted.

Original entry on oeis.org

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, 37, 38, 39, 41, 43, 45, 46, 47, 49, 51, 53, 55, 57, 58, 59, 61, 62, 63, 65, 67, 69, 71, 73, 74, 75, 77, 79, 81, 82, 83, 85, 86, 87, 89, 91, 93, 94
Offset: 1

Views

Author

N. J. A. Sloane, Apr 07 2015

Keywords

Crossrefs

Cf. A256420.

Programs

  • Mathematica
    Select[Range@94,PrimeQ[#/2]||OddQ[#]&] (* Ivan N. Ianakiev, Apr 08 2015 *)
  • PARI
    lista(nn) = nb = primepi(nn)\2; vecsort(setunion(vector(prime(nb), n, 2*n-1), 2*primes(nb))); \\ Michel Marcus, Apr 07 2015
    
  • PARI
    list(lim)=setunion(vector((lim+1)\2,i,2*i-1), 2*primes([2,lim])) \\ Charles R Greathouse IV, Apr 07 2015
    
  • Python
    from sympy import primepi
    def A256421(n):
        def f(x): return int(n+(m:=x>>1)-primepi(m))
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return m # Chai Wah Wu, Oct 15 2024

Formula

a(n) ~ 2n. - Charles R Greathouse IV, Apr 07 2015
Showing 1-1 of 1 results.