A034017 Numbers that are primitively represented by x^2 + xy + y^2.
0, 1, 3, 7, 13, 19, 21, 31, 37, 39, 43, 49, 57, 61, 67, 73, 79, 91, 93, 97, 103, 109, 111, 127, 129, 133, 139, 147, 151, 157, 163, 169, 181, 183, 193, 199, 201, 211, 217, 219, 223, 229, 237, 241, 247, 259, 271, 273, 277, 283, 291, 301, 307, 309, 313, 327, 331
Offset: 1
References
- B. C. Berndt and R. A. Rankin, Ramanujan: Letters and Commentary, see p. 184, AMS, Providence, RI, 1995.
- D. A. Buell, Binary Quadratic Forms, Springer, 1989, pp. 15, 19.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
- N. J. A. Sloane et al., Binary Quadratic Forms and OEIS (Index to related sequences, programs, references)
- Linda Stannard, Principles of Virus Architecture (1995).
Crossrefs
Programs
-
Haskell
a034017 n = a034017_list !! (n-1) a034017_list = 0 : filter ((> 0) . a000086) [1..] -- Reinhard Zumkeller, Jun 23 2013
-
Maple
N:= 1000: # to get all terms <= N P:= select(isprime, [seq(6*n+1, n=1..floor((N-1)/6))]): A:= {1,3}: for p in P do A:= {seq(seq(a*p^k, k=0..floor(log[p](N/a))),a=A)}: od: sort(convert(A,list)); # Robert Israel, Nov 04 2015
-
Mathematica
lst = {0}; maxLen = 331; Do[If[Reduce[m^2 + m*n + n^2 == k && m >= n >= 0 && GCD[m, n] == 1, {m, n}, Integers] === False, , AppendTo[lst, k]], {k, maxLen}]; lst (* Frank M Jackson, Jan 10 2013 *) (* simplified by T. D. Noe, Feb 05 2013 *)
-
PARI
is(n)=my(f=factor(n));for(i=1,#f[,1],if(f[i,1]%3!=1 && (f[i,1]!=3 || f[i,2]>1), return(n==0))); 1 \\ Charles R Greathouse IV, Jan 10 2013
-
PARI
list(lim)=if(lim<7, return(select(n->n<=lim, [0,1,3]))); my(v=List([0,1,3])); for(x=1,sqrtint(lim\=1), my(y,t); while(y++
Charles R Greathouse IV, Jan 20 2022
Formula
n >= 2: 3^{0 or 1} X product of primes of form 3a+1 (A002476) to any nonnegative power.
Extensions
Extended by Ray Chandler, Jan 29 2009
Comments