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.

A326583 Integers k >= 0 such that 2*k + 1 is prime or square.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 8, 9, 11, 12, 14, 15, 18, 20, 21, 23, 24, 26, 29, 30, 33, 35, 36, 39, 40, 41, 44, 48, 50, 51, 53, 54, 56, 60, 63, 65, 68, 69, 74, 75, 78, 81, 83, 84, 86, 89, 90, 95, 96, 98, 99, 105, 111, 112, 113, 114, 116, 119, 120
Offset: 1

Views

Author

Peter Luschny, Jul 15 2019

Keywords

Crossrefs

Programs

  • Maple
    s := n -> if irem(n,2) = 1 and (isprime(n) or issqr(n)) then (n-1)/2 else NULL fi:
    seq(s(n), n=0..241);
  • Mathematica
    Select[Range[0, 120], Or[IntegerQ@ Sqrt@ #, PrimeQ@ #] &[2 # + 1] &] (* Michael De Vlieger, Jul 15 2019 *)
  • PARI
    list(lim)=my(v=List()); lim\=1; forprime(p=3,2*lim+1, listput(v,p\2)); forstep(n=1,sqrtint(2*lim+1),2, listput(v,n^2\2)); Set(v) \\ Charles R Greathouse IV, Dec 12 2024

Formula

a(n) ~ (n log n)/2. - Charles R Greathouse IV, Dec 12 2024