OFFSET
1,3
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
a(n) ~ (n log n)/2. - Charles R Greathouse IV, Dec 12 2024
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 *)
PROG
(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
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Peter Luschny, Jul 15 2019
STATUS
approved