A242660 Nonnegative numbers of the form x^2+xy-2y^2.
0, 1, 4, 7, 9, 10, 13, 16, 18, 19, 22, 25, 27, 28, 31, 34, 36, 37, 40, 43, 45, 46, 49, 52, 54, 55, 58, 61, 63, 64, 67, 70, 72, 73, 76, 79, 81, 82, 85, 88, 90, 91, 94, 97, 99, 100, 103, 106, 108, 109, 112, 115, 117, 118, 121, 124, 126, 127, 130, 133, 135, 136, 139, 142, 144, 145, 148, 151, 153, 154, 157, 160, 162, 163, 166, 169, 171, 172, 175, 178, 180, 181
Offset: 1
Links
- N. J. A. Sloane, Table of n, a(n) for n = 1..22223
- N. J. A. Sloane et al., Binary Quadratic Forms and OEIS (Index to related sequences, programs, references)
- Index entries for linear recurrences with constant coefficients, signature (1,0,0,1,-1).
Crossrefs
Primes in this sequence = A002476.
Programs
-
Maple
# Maple Program fb, for indefinite binary quadratic forms # f = ax^2+bxy+cy^2 with discriminant d = b^2-4ac = s^2 a perfect square. # Looks for numbers 0 <= n <= M represented and also primes represented. fb:=proc(a,b,c,M) local s,t1,t2,n,d,dp; if not issqr(b^2-4*a*c) then error "disct not a square"; return; fi; s:=sqrt(b^2-4*a*c); t1:={0}; t2:={}; for n from 1 to M do for d in numtheory[divisors](4*a*n) do dp:=4*a*n/d; if ((d-dp) mod 2*s) = 0 and (((b+s)*dp-(b-s)*d) mod 4*a*s) = 0 then t1:={op(t1),n}; if isprime(n) then t2:={op(t2),n}; fi; break; fi; od: od: [sort(convert(t1,list)), sort(convert(t2,list))]; end; fb(1,1,-2,500);
-
Mathematica
Select[Range[0, 1000], MatchQ[Mod[#, 9], Alternatives[0, 1, 4, 7]]&] (* Jean-François Alcover, Oct 31 2016 *)
-
PARI
concat(0, Vec(x^2*(1+2*x)*(1+x+x^2)/((1-x)^2*(1+x)*(1+x^2)) + O(x^100))) \\ Colin Barker, Oct 31 2016
Formula
From Colin Barker, Oct 31 2016: (Start)
a(n) = a(n-1)+a(n-4)-a(n-5) for n>5.
G.f.: x^2*(1+2*x)*(1+x+x^2) / ((1-x)^2*(1+x)*(1+x^2)). (End)
E.g.f.: (8 + 3*cos(x) + (9*x - 11)*cosh(x) + sin(x) + (9*x - 10)*sinh(x))/4. - Stefano Spezia, Aug 05 2024
Comments