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”).

A230584
Either two less than a square or two more than a square.
4
2, 3, 6, 7, 11, 14, 18, 23, 27, 34, 38, 47, 51, 62, 66, 79, 83, 98, 102, 119, 123, 142, 146, 167, 171, 194, 198, 223, 227, 254, 258, 287, 291, 322, 326, 359, 363, 398, 402, 439, 443, 482, 486, 527, 531, 574, 578, 623, 627, 674, 678, 727, 731, 782, 786, 839, 843, 898, 902, 959, 963
OFFSET
1,1
COMMENTS
Numbers n such that the polynomial x^4 - n*x^2 + 1 is reducible.
The corresponding factorizations are (x^2 + k*x - 1)*(x^2 - k*x - 1) == x^4 - (k^2 + 2)*x^2 + 1 and (x^2 + k*x + 1)*(x^2 - k*x + 1) == x^4 - (k^2 - 2)*x^2 + 1. - Joerg Arndt, Feb 07 2015
Union of A008865 and A059100.
For k > 1: a(2*k+1) - a(2*k) = 4 and a(2*k) - a(2*k-1) = k - 1; for n > 4: a(n) - a(n-2) = 2*floor(n/2) + 1 = A109613(n). - Reinhard Zumkeller, Feb 10 2015
FORMULA
From Colin Barker, Oct 24 2013: (Start)
a(n) = (5-13*(-1)^n+2*(3+(-1)^n)*n+2*n^2)/8 for n>2.
a(n) = (n^2+4*n-4)/4 for n>2 and even.
a(n) = (n^2+2*n+9)/4 for n>2 and odd.
a(n) = a(n-1)+2*a(n-2)-2*a(n-3)-a(n-4)+a(n-5) for n>7.
G.f.: x*(x^6-2*x^5+x^3+x^2-x-2) / ((x-1)^3*(x+1)^2). (End)
After the first two terms 0^2+2 = 2^2-2, 1^2+2, the squares are sufficiently spaced to ensure that the sequence continues 2^2+2, 3^2-2, 3^2+2, 4^2-2, 4^2+2,..., i.e., a(2n-1) = n^2+2, a(2n)=(n+1)^2-2. - M. F. Hasler, Oct 26 2013
PROG
(PARI) is(n)=issquare(n-2)||issquare(n+2)
(PARI) A230584_vec(N)=Vec((2+x-x^2-x^3+2*x^5-x^6)/((1-x)^3*(1+x)^2)+O(x^N)) \\ M. F. Hasler, Oct 26 2013
(Haskell)
import Data.List (transpose)
a230584 n = a230584_list !! (n-1)
a230584_list = 2 : 3 : concat
(transpose [drop 2 a059100_list, drop 2 a008865_list])
-- Reinhard Zumkeller, Feb 10 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Ralf Stephan, Oct 24 2013
STATUS
approved