login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A326583
Integers k >= 0 such that 2*k + 1 is prime or square.
2
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,3
LINKS
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