Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
A125557
Primes in the sequence a(n)=n^2+3/2-1/2*(-1)^n.
0
3, 5, 11, 17, 37, 83, 101, 197, 227, 257, 401, 443, 577, 677, 1091, 1297, 1523, 1601, 2027, 2917, 3137, 3251, 4357, 5477, 6563, 7057, 8101, 8837, 9803, 11027, 12101, 12323, 13457, 13691, 14401, 15131, 15377, 15877, 16901, 17957, 21317, 21611
OFFSET
1,1
COMMENTS
3/2 - (-1)^n/2 adds 1 for any even number and 2 for any odd number.
EXAMPLE
5 is a member because 2^2+3/2-1/2=5
MAPLE
P:=proc(n) local i, j; for i from 0 by 1 to n do j:=i^2+3/2-1/2*(-1)^i; if isprime(j) then print(j); fi; od; end: P(200);
MATHEMATICA
Select[Table[n^2+3/2-1/(2(-1)^n), {n, 200}], PrimeQ] (* Harvey P. Dale, Dec 21 2011 *)
CROSSREFS
Sequence in context: A060647 A320353 A155989 * A007455 A034729 A115786
KEYWORD
easy,nonn
AUTHOR
STATUS
approved