cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-10 of 48 results. Next

A155562 Intersection of A001481 and A002479: N = a^2 + b^2 = c^2 + 2d^2 for some integers a,b,c,d.

Original entry on oeis.org

0, 1, 2, 4, 8, 9, 16, 17, 18, 25, 32, 34, 36, 41, 49, 50, 64, 68, 72, 73, 81, 82, 89, 97, 98, 100, 113, 121, 128, 136, 137, 144, 146, 153, 162, 164, 169, 178, 193, 194, 196, 200, 225, 226, 233, 241, 242, 256, 257, 272, 274, 281, 288, 289, 292, 306, 313, 324, 328
Offset: 1

Views

Author

M. F. Hasler, Jan 24 2009

Keywords

Comments

Contains A155561 as a subsequence (obtained by restricting a,b,c,d to be nonzero). Also contains A000290 (squares) and A001105 (twice the squares) as subsequence.
From Warut Roonguthai, Oct 13 2009: (Start)
N is also of the form x^2 - 2y^2.
N = (p^2-q^2-2*r*s)^2+(r^2-s^2-2*p*q)^2
= (p^2+q^2-r^2-s^2)^2+2*(p*r-p*s-q*r-q*s)^2
= (p^2+q^2+r^2+s^2)^2-2*(p*r+p*s+q*r-q*s)^2
for some nonnegative integers p, q, r, s. (End)
Numbers k such that in the prime factorization of k, all odd primes that occur with an odd exponent are congruent to 1 (mod 8). - Robert Israel, Jun 24 2024

Programs

  • PARI
    isA155562(n,/* use optional 2nd arg to get other analogous sequences */c=[2,1]) = { for(i=1,#c, for(b=0,sqrtint(n\c[i]), issquare(n-c[i]*b^2) & next(2)); return);1}
    for( n=1,500, isA155562(n) & print1(n","))
    
  • Python
    from itertools import count, islice
    from sympy import factorint
    def A155562_gen(): # generator of terms
        return filter(lambda n:all((p & 3 != 3 and p & 7 < 5) or e & 1 == 0 for p, e in factorint(n).items()),count(0))
    A155562_list = list(islice(A155562_gen(),30)) # Chai Wah Wu, Jun 27 2022

A155564 Intersection of A002479 and A003136: N = a^2 + 2b^2 = c^2 + 3d^2 for some integers a,b,c,d.

Original entry on oeis.org

0, 1, 3, 4, 9, 12, 16, 19, 25, 27, 36, 43, 48, 49, 57, 64, 67, 73, 75, 76, 81, 97, 100, 108, 121, 129, 139, 144, 147, 163, 169, 171, 172, 192, 193, 196, 201, 211, 219, 225, 228, 241, 243, 256, 268, 283, 289, 291, 292, 300, 304, 307, 313, 324, 331, 337, 361, 363
Offset: 1

Views

Author

M. F. Hasler, Jan 25 2009

Keywords

Comments

Contains A155574 as a subsequence (obtained by restricting a,b,c,d to be nonzero). Also contains A000290 (squares) as subsequence.

Crossrefs

Programs

  • PARI
    isA155564(n,/* use optional 2nd arg to get other analogous sequences */c=[3,2]) = { for(i=1,#c, for(b=0,sqrtint(n\c[i]), issquare(n-c[i]*b^2) & next(2)); return);1}
    for( n=1,500, isA155564(n) & print1(n","))

A155567 Intersection of A002479 and A020669 : N = a^2 + 2b^2 = c^2 + 5d^2 for some integers a,b,c,d.

Original entry on oeis.org

0, 1, 4, 6, 9, 16, 24, 25, 36, 41, 49, 54, 64, 81, 86, 89, 96, 100, 121, 129, 134, 144, 150, 164, 166, 169, 196, 201, 214, 216, 225, 241, 246, 249, 256, 281, 289, 294, 321, 324, 326, 344, 356, 361, 369, 384, 400, 401, 409, 441, 449, 454, 484, 486, 489, 516, 521
Offset: 1

Views

Author

M. F. Hasler, Jan 25 2009

Keywords

Comments

Contains A155577 as a subsequence (obtained by restricting a,b,c,d to be nonzero). Also contains A000290 (squares) as subsequence.

Crossrefs

Programs

  • PARI
    isA155567(n,/* use optional 2nd arg to get other analogous sequences */c=[5,2]) = { for(i=1,#c, for(b=0,sqrtint(n\c[i]), issquare(n-c[i]*b^2) & next(2)); return);1}
    for( n=1,600, isA155567(n) & print1(n","))

A155569 Intersection of A002479 inter A002481: N = a^2 + 2b^2 = c^2 + 6d^2 for some integers a,b,c,d.

Original entry on oeis.org

0, 1, 4, 6, 9, 16, 22, 24, 25, 33, 36, 49, 54, 64, 73, 81, 88, 96, 97, 100, 118, 121, 132, 144, 150, 166, 169, 177, 193, 196, 198, 214, 216, 225, 241, 249, 256, 262, 289, 292, 294, 297, 313, 321, 324, 337, 352, 358, 361, 384, 388, 393, 400, 409, 433, 438, 441
Offset: 1

Views

Author

M. F. Hasler, Jan 25 2009

Keywords

Comments

Contains A155709 as a subsequence (obtained by restricting a,b,c,d to be nonzero). Also contains A000290 (squares) as subsequence.

Crossrefs

Programs

  • PARI
    isA155569(n,/* use optional 2nd arg to get other analogous sequences */c=[6,2]) = { for(i=1,#c, for(b=0,sqrtint(n\c[i]), issquare(n-c[i]*b^2) & next(2)); return);1}
    for( n=0,500, isA155569(n) & print1(n","))

A002325 Glaisher's J numbers.

Original entry on oeis.org

1, 1, 2, 1, 0, 2, 0, 1, 3, 0, 2, 2, 0, 0, 0, 1, 2, 3, 2, 0, 0, 2, 0, 2, 1, 0, 4, 0, 0, 0, 0, 1, 4, 2, 0, 3, 0, 2, 0, 0, 2, 0, 2, 2, 0, 0, 0, 2, 1, 1, 4, 0, 0, 4, 0, 0, 4, 0, 2, 0, 0, 0, 0, 1, 0, 4, 2, 2, 0, 0, 0, 3, 2, 0, 2, 2, 0, 0, 0, 0, 5, 2, 2, 0, 0, 2, 0, 2, 2, 0, 0, 0, 0, 0, 0, 2, 2, 1, 6, 1, 0, 4, 0, 0, 0
Offset: 1

Views

Author

Keywords

Comments

Number of integer solutions to the equation x^2 + 2*y^2 = n when (-x, -y) and (x, y) are counted as the same solution.
For n nonzero, a(n) is nonzero if and only if n is in A002479. - Michael Somos, Dec 15 2011
Coefficients of Dedekind zeta function for the quadratic number field of discriminant -8. See A002324 for formula and Maple code. - N. J. A. Sloane, Mar 22 2022

Examples

			x + x^2 + 2*x^3 + x^4 + 2*x^6 + x^8 + 3*x^9 + 2*x^11 + 2*x^12 + x^16 + ...
		

References

  • B. C. Berndt, Ramanujan's Notebooks Part III, Springer-Verlag, see p. 114 Entry 8(iii).
  • L. E. Dickson, History of the Theory of Numbers. Carnegie Institute Public. 256, Washington, DC, Vol. 1, 1919; Vol. 2, 1920; Vol. 3, 1923, see vol. 3, p. 19.
  • N. J. Fine, Basic Hypergeometric Series and Applications, Amer. Math. Soc., 1988; p. 78, Eq. (32.24).
  • J. W. L. Glaisher, Table of the excess of the number of (8k+1)- and (8k+3)-divisors of a number over the number of (8k+5)- and (8k+7)-divisors, Messenger Math., 31 (1901), 82-91.
  • D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, pp. 7-10.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Dedekind zeta functions for imaginary quadratic number fields of discriminants -3, -4, -7, -8, -11, -15, -19, -20 are A002324, A002654, A035182, A002325, A035179, A035175, A035171, A035170, respectively.
Dedekind zeta functions for real quadratic number fields of discriminants 5, 8, 12, 13, 17, 21, 24, 28, 29, 33, 37, 40 are A035187, A035185, A035194, A035195, A035199, A035203, A035188, A035210, A035211, A035215, A035219, A035192, respectively.

Programs

  • Maple
    S:= series( (JacobiTheta3(0,q)*JacobiTheta3(0,q^2)-1)/2, q, 1001):
    seq(coeff(S,q,j), j=1..1000); # Robert Israel, Dec 01 2015
  • Mathematica
    a[n_] := Total[ KroneckerSymbol[-8, #] & /@ Divisors[n]]; Table[a[n], {n, 1, 105}] (* Jean-François Alcover, Nov 25 2011, after Michael Somos *)
    QP = QPochhammer; s = ((QP[q^2]^3*QP[q^4]^3)/(QP[q]^2*QP[q^8]^2)-1)/(2q) + O[q]^105; CoefficientList[s, q] (* Jean-François Alcover, Dec 01 2015, adapted from PARI *)
  • PARI
    a(n) = if( n<1, 0, issquare(n)-issquare(2*n) + 2*sum(i=1,sqrtint(n\2), issquare(n-2*i^2)))
    
  • PARI
    {a(n) = if( n<1, 0, qfrep([ 1, 0; 0, 2],n)[n])} \\ Michael Somos, Jun 05 2005
    
  • PARI
    {a(n) = if( n<1, 0, direuler(p=2, n, 1 / (1 - X) / (1 - kronecker( -2, p) * X))[n])} \\ Michael Somos, Jun 05 2005
    
  • PARI
    {a(n) = if( n<1, 0, sumdiv(n, d, kronecker( -2, d)))} \\ Michael Somos, Aug 23 2005
    
  • PARI
    {a(n) = local(A, p, e); if( n<1, 0, A = factor(n); prod( k=1, matsize(A)[1], if( p=A[k, 1], e=A[k, 2]; if( p==2, 1, if( p%8<4, e+1, !(e%2))))))} \\ Michael Somos, Oct 23 2006
    
  • PARI
    {a(n) = local(A); if( n<1, 0, A = x * O(x^n); polcoeff( eta(x + A)^-2 * eta(x^2 + A)^3 * eta(x^4 + A)^3 * eta(x^8 + A)^-2, n) / 2)}
    
  • PARI
    a(n) = my(f=factor(n>>valuation(n,2)), e); prod(i=1, #f~, e=f[i, 2]; if( f[i, 1]%8<4, e+1, 1 - e%2)) \\ Charles R Greathouse IV, Sep 09 2014

Formula

Coefficients in expansion of Dirichlet series Product_p (1-(Kronecker(m, p)+1)*p^(-s) + Kronecker(m, p)*p^(-2s))^(-1) for m = -2.
Moebius transform is period 8 sequence [ 1, 0, 1, 0, -1, 0, -1, 0, ...]. - Michael Somos, Aug 23 2005
G.f.: (theta_3(q) * theta_3(q^2) - 1) / 2 = Sum_{k>0} Kronecker( -2, n) * x^k / (1 - x^k) = Sum_{k>0} (x^k + x^(3*k)) / (1 + x^(4*k)).
Multiplicative with a(2^e) = 1, a(p^e) = e+1 if p == 1, 3 (mod 8), a(p^e) = (1+(-1)^e)/2 if p == 5, 7 (mod 8). - Michael Somos, Oct 23 2006
A033715(n) = 2 * a(n) unless n=0.
a(n) = A188169(n) + A188170(n) - A188171(n) - A188172(n) [Hirschhorn]. - R. J. Mathar, Mar 23 2011
G.f.: A(x) = 2*(1+x^2)/(G(0)-2*x*(1+x^2)); G(k) = 1+x+x^(2*k)*(1+x^3+x^(2*k+1)+x^(2*k+4)+x^(4*k+3)+x^(4*k+4)) - x*(1+x^(2*k))*(1+x^(2*k+4))*(1+x^(4*k+4))^2/G(k+1); (continued fraction). - Sergei N. Gladkovskii, Jan 03 2012
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Pi/(2*sqrt(2)) = 1.110720... (A093954). - Amiram Eldar, Oct 11 2022

A033715 Number of integer solutions (x, y) to the equation x^2 + 2y^2 = n.

Original entry on oeis.org

1, 2, 2, 4, 2, 0, 4, 0, 2, 6, 0, 4, 4, 0, 0, 0, 2, 4, 6, 4, 0, 0, 4, 0, 4, 2, 0, 8, 0, 0, 0, 0, 2, 8, 4, 0, 6, 0, 4, 0, 0, 4, 0, 4, 4, 0, 0, 0, 4, 2, 2, 8, 0, 0, 8, 0, 0, 8, 0, 4, 0, 0, 0, 0, 2, 0, 8, 4, 4, 0, 0, 0, 6, 4, 0, 4, 4, 0, 0, 0, 0, 10, 4, 4, 0, 0, 4, 0, 4, 4, 0, 0, 0, 0, 0, 0, 4, 4, 2, 12, 2, 0, 8, 0
Offset: 0

Views

Author

Keywords

Comments

Theta series of lattice C2 with Gram matrix [ 1, 0; 0, 2]. a(n) is nonzero if and only if n is in A002479. - Michael Somos, Dec 15 2011
Number 17 of the 74 eta-quotients listed in Table I of Martin (1996).
Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
Denoted by |a_4(n)| in Kassel and Reutenauer 2015. - Michael Somos, Jun 16 2015

Examples

			G.f. = 1 + 2*q + 2*q^2 + 4*q^3 + 2*q^4 + 4*q^6 + 2*q^8 + 6*q^9 + 4*q^11 + 4*q^12 + ...
		

References

  • Bruce C. Berndt, Ramanujan's Notebooks Part III, Springer-Verlag, 1991, see p. 114 Entry 8(iii).
  • J. H. Conway and N. J. A. Sloane, Sphere Packings, Lattices and Groups, Springer-Verlag, 1999, p. 102, eq. 9.
  • L. E. Dickson, History of the Theory of Numbers. Carnegie Institute Public. 256, Washington, DC, Vol. 1, 1919; Vol. 2, 1920; Vol. 3, 1923, see vol. 3, p. 19.
  • Nathan J. Fine, Basic Hypergeometric Series and Applications, Amer. Math. Soc., 1988; p. 78, Eq. (32.24).
  • J. W. L. Glaisher, Table of the excess of the number of (8k+1)- and (8k+3)-divisors of a number over the number of (8k+5)- and (8k+7)-divisors, Messenger Math., 31 (1901), 82-91.
  • J. V. Uspensky and M. A. Heaslet, Elementary Number Theory, McGraw-Hill, NY, 1939, p. 346.

Crossrefs

Number of integer solutions to f(x,y) = n where f(x,y) is the principal binary quadratic form with discriminant d: A004016 (d=-3), A004018 (d=-4), A002652 (d=-7), this sequence (d=-8), A028609 (d=-11), A028641 (d=-19), A138811 (d=-43).

Programs

  • Magma
    A := Basis( ModularForms( Gamma1(8), 1), 105); A[1] + 2*A[2] + 2*A[3]; /* Michael Somos, Aug 29 2014 */
  • Maple
    d:=proc(r,m,n) local i,t1; t1:=0; for i from 1 to n do if n mod i = 0 and i-r mod m = 0 then t1:=t1+1; fi; od: t1; end; [seq(2*(d(1,8,n)+d(3,8,n)-d(5,8,n)-d(7,8,n)),n=1..120)];
  • Mathematica
    a[ n_] := SeriesCoefficient[ EllipticTheta[ 3, 0, q] EllipticTheta[ 3, 0, q^2], {q, 0, n}]; (* Michael Somos, Sep 09 2012 *)
    a[ n_] := If[ n < 1, Boole[ n == 0], 2 DivisorSum[ n, KroneckerSymbol[ -2, #] &]]; (* Michael Somos, Aug 29 2014 *)
    a[ n_] := SeriesCoefficient[ (QPochhammer[ q^2] QPochhammer[ q^4])^3 / (QPochhammer[ q] QPochhammer[ q^8])^2, {q, 0, n}]; (* Michael Somos, Aug 29 2014 *)
  • PARI
    {a(n) = if( n<1, n==0, 2 * (issquare(n) - issquare(2*n) + 2 * sum( i=1, sqrtint(n\2), issquare(n - 2*i^2))))};
    
  • PARI
    {a(n) = if( n<1, n==0, 2 * sumdiv( n, d, kronecker( -2, d)))}; /* Michael Somos, Aug 23 2005 */
    
  • PARI
    {a(n) = if( n<1, n==0, 2 * qfrep([ 1, 0; 0, 2], n)[n])}; /* Michael Somos, Aug 23 2005 */
    
  • PARI
    {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( eta(x + A)^-2 * eta(x^2 + A)^3 * eta(x^4 + A)^3 * eta(x^8 + A)^-2, n))};
    
  • Sage
    Q = DiagonalQuadraticForm(ZZ, [1,2]); Q.representation_number_list(104); # Peter Luschny, Jun 20 2014
    

Formula

Fine gives an explicit formula for a(n) in terms of the divisors of n.
Euler transform of period 8 sequence [ 2, -1, 2, -4, 2, -1, 2, -2, ...].
Expansion of (eta(q^2) * eta(q^4))^3 / (eta(q) * eta(q^8))^2 in powers of q.
Coefficients in expansion of Sum_{i,j=-inf..inf} q^(i^2 + 2*j^2).
G.f. = s(2)^3*s(4)^3/(s(1)^2*s(8)^2), where s(k) := subs(q=q^k, eta(q)), where eta(q) is Dedekind's function, cf. A010815. [Fine]
G.f.: 1 + 2 * Sum_{k>0} Kronecker(-2, n) * x^k / (1 - x^k) = 1 + 2 * Sum_{k>0} (x^k + x^(3*k)) / (1 + x^(4*k)).
G.f.: theta_3(q) * theta_3(q^2) = Product_{k>0} (1 + x^(2*k)) * ((1 + x^k) * (1 - x^(2*k)) / (1 + x^(4*k)))^2.
From Michael Somos, Oct 23 2006: (Start)
Moebius transform is period 8 sequence [ 2, 0, 2, 0, -2, 0, -2, 0, ...].
G.f. A(x) satisfies 0 = f(A(x), A(x^2), A(x^3), A(x^6)) where f(u1, u2, u3, u6) = (u1 - 3*u3) * (u1 - u2 - u3 + u6) - (u2 - 3*u6) * (u1 - 2*u2 - u3 + 2*u6). (End)
a(n) = 2 * A002325(n) unless n = 0.
G.f. is a period 1 Fourier series which satisfies f(-1 / (8 t)) = 8^(1/2) (t/i) f(t) where q = exp(2 Pi i t). - Michael Somos, Sep 09 2012
From Michael Somos, Aug 29 2014: (Start)
Expansion of phi(q) * phi(q^2) in powers of q where phi() is a Ramanujan theta function.
a(2*n) = a(n). a(2*n + 1) = 2 * A113411(n). (End)
From Michael Somos, May 17 2015: (Start)
a(n) = A028572(4*n) = A133692(2*n) = A139093(8*n) = A226225(8*n) = A226240(4*n) = A242609(4*n) = A245572(4*n) / 3 = (-1)^floor((n + 1)/2) * A082564(n).
a(8*n + 5) = a(8*n + 7) = 0. a(8*n + 1) = 2 * A112603(n). a(8*n + 3) = 4 * A033761(n). (End)
a(0) = 1, a(n) = 2 * b(n) for n > 0, where b() is multiplicative with b(2^e) = 1, b(p^e) = e + 1 if p == 1, 3 (mod 8), b(p^e) = (1 + (-1)^e)/2 if p == 5, 7 (mod 8). - Jianing Song, Sep 04 2018 [Corrected by Jeremy Lovejoy, Nov 12 2024]
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=0..m} a(k) = Pi/sqrt(2) = 2.221441... (A247719). - Amiram Eldar, Dec 16 2023

A154777 Numbers of the form x^2 + 2*y^2 with positive integers x and y.

Original entry on oeis.org

3, 6, 9, 11, 12, 17, 18, 19, 22, 24, 27, 33, 34, 36, 38, 41, 43, 44, 48, 51, 54, 57, 59, 66, 67, 68, 72, 73, 75, 76, 81, 82, 83, 86, 88, 89, 96, 97, 99, 102, 107, 108, 113, 114, 118, 121, 123, 129, 131, 132, 134, 136, 137, 139, 144, 146, 147, 150, 152, 153, 162, 163
Offset: 1

Views

Author

M. F. Hasler, Jan 24 2009

Keywords

Comments

Subsequence of A002479 (which allows for x=0 and/or y=0). See there for further references. See A155560 cf for intersection of sequences of type (x^2 + k*y^2).
Also, subsequence of A000408 (with 2*y^2 = y^2 + z^2).
If m and n are terms also n*m is (in particular any power of term is also a term). - Zak Seidov, Nov 30 2011
If m is a term, 2*m is also. - Zak Seidov, Nov 30 2011
Select terms that are multiples of 25: 75, 150, 225, 275, 300, 425, 450, 475, 550, 600, 675, 825, 850, 900, 950, 1025, 1075, 1100, ... Divide them by 25: 3, 6, 9, 11, 12, 17, 18, 19, 22, 24, 27, 33, 34, 36, 38, 41, 43, 44, 48, 51, 54, 57, 59, 66, 67, 68, 72, ... and we get the original sequence. - Zak Seidov, Dec 01 2011
This sequence is closed under multiplication because A002479 is. - Jerzy R Borysowicz, Jun 13 2020

Examples

			a(1) = 3 = 1^2 + 2*1^2 is the least number that can be written as A + 2B where A, B are positive squares.
a(2) = 6 = 2^2 + 2*1^2 is the second smallest number that can be written in this way.
		

Crossrefs

Subsequence of A002479 and hence of A000408.
Cf. A155560, A338432 (triangle version of array), A339047 (multiplicities).

Programs

  • Mathematica
    f[upto_]:=Module[{max=Ceiling[Sqrt[upto-1]]},Select[Union[ First[#]^2+ 2Last[#]^2&/@Tuples[Range[13],{2}]],#<=upto&]]; f[200] (* Harvey P. Dale, Jun 17 2011 *)
  • PARI
    isA154777(n,/* use optional 2nd arg to get other analogous sequences */c=2) = { for( b=1,sqrtint((n-1)\c), issquare(n-c*b^2) & return(1))}
    for( n=1,200, isA154777(n) & print1(n","))

A303338 Number of ways to write n as x^2 + 2*y^2 + 3*2^z + 4^w with x,y,z,w nonnegative integers.

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 3, 3, 2, 4, 3, 2, 6, 2, 4, 8, 2, 4, 7, 3, 4, 8, 5, 5, 10, 6, 4, 10, 8, 5, 12, 7, 3, 12, 4, 5, 12, 5, 5, 14, 7, 4, 12, 7, 6, 12, 6, 6, 10, 7, 7, 12, 7, 6, 14, 6, 8, 16, 4, 8, 18, 5, 6, 16, 5, 9, 13, 7, 7, 14
Offset: 1

Views

Author

Zhi-Wei Sun, Apr 22 2018

Keywords

Comments

Conjecture: a(n) > 0 for all n > 3.
This is stronger than the author's previous conjecture in A302983. It has been verified that a(n) > 0 for all n = 4..10^9.
Jiao-Min Lin (a student at Nanjing University) has found a counterexample to the conjecture: a(12558941213) = 0. - Zhi-Wei Sun, Jul 30 2022

Examples

			a(4) = 1 with 4 = 0^2 + 2*0^2 + 3*2^0 + 4^0.
a(5) = 1 with 5 = 1^2 + 2*0^2 + 3*2^0 + 4^0.
a(6) = 1 with 6 = 0^2 + 2*1^2 + 3*2^0 + 4^0.
a(9) = 2 with 9 = 0^2 + 2*1^2 + 3*2^0 + 4^1 = 0^2 + 2*1^2 + 3*2^1 + 4^0.
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=f[n]=FactorInteger[n];
    g[n_]:=g[n]=Sum[Boole[MemberQ[{5,7},Mod[Part[Part[f[n],i],1],8]]&&Mod[Part[Part[f[n],i],2],2]==1],{i,1,Length[f[n]]}]==0;
    QQ[n_]:=QQ[n]=(n==0)||(n>0&&g[n]);
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
    tab={};Do[r=0;Do[If[QQ[n-3*2^k-4^j],Do[If[SQ[n-3*2^k-4^j-2x^2],r=r+1],{x,0,Sqrt[(n-3*2^k-4^j)/2]}]],{k,0,Log[2,n/3]},{j,0,If[3*2^k==n,-1,Log[4,n-3*2^k]]}];tab=Append[tab,r],{n,1,70}];Print[tab]

A302984 Number of ways to write n as x^2 + 2*y^2 + 2^z + 5*2^w with x,y,z,w nonnegative integers.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 2, 2, 3, 3, 3, 4, 5, 5, 8, 5, 5, 7, 4, 6, 7, 9, 9, 10, 10, 7, 9, 8, 10, 15, 10, 9, 10, 8, 6, 10, 10, 11, 14, 14, 8, 12, 13, 13, 20, 15, 12, 16, 10, 15, 12, 10, 15, 17, 16, 12, 16, 14, 14, 21
Offset: 1

Views

Author

Zhi-Wei Sun, Apr 16 2018

Keywords

Comments

Conjecture: a(n) > 0 for all n > 5.
Clearly, a(2*n) > 0 if a(n) > 0. We have verified a(n) > 0 for all n = 6...10^9.
See also A302982 and A302983 for similar conjectures.

Examples

			a(6) = 1 with 6 = 0^2 + 2*0^2 + 2^0 + 5*2^0.
a(7) = 2 with 7 = 1^2 + 2*0^2 + 2^0 + 5*2^0 = 0^2 + 2*0^2 + 2^1 + 5*2^0.
a(8) = 2 with 8 = 0^2 + 2*1^2 + 2^0 + 5*2^0 = 1^2 + 2*0^2 + 2^1 + 5*2^0.
		

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
    f[n_]:=f[n]=FactorInteger[n];
    g[n_]:=g[n]=Sum[Boole[MemberQ[{5,7},Mod[Part[Part[f[n],i],1],8]]&&Mod[Part[Part[f[n],i],2],2]==1],{i,1,Length[f[n]]}]==0;
    QQ[n_]:=QQ[n]=(n==0)||(n>0&&g[n]);
    tab={};Do[r=0;Do[If[QQ[n-5*2^k-2^j],Do[If[SQ[n-5*2^k-2^j-2x^2],r=r+1],{x,0,Sqrt[(n-5*2^k-2^j)/2]}]],{k,0,Log[2,n/5]},{j,0,Log[2,Max[1,n-5*2^k]]}];tab=Append[tab,r],{n,1,60}];Print[tab]

A033203 Primes p congruent to {1, 2, 3} (mod 8); or primes p of form x^2 + 2*y^2; or primes p such that x^2 = -2 has a solution mod p.

Original entry on oeis.org

2, 3, 11, 17, 19, 41, 43, 59, 67, 73, 83, 89, 97, 107, 113, 131, 137, 139, 163, 179, 193, 211, 227, 233, 241, 251, 257, 281, 283, 307, 313, 331, 337, 347, 353, 379, 401, 409, 419, 433, 443, 449, 457, 467, 491, 499, 521, 523, 547, 563, 569, 571, 577, 587, 593, 601, 617, 619, 641, 643, 659, 673, 683
Offset: 1

Views

Author

Keywords

Comments

Sequence naturally partitions into two sequences: all primes p with ord_p(-2) odd (A163183, the primes dividing 2^j +1 for some odd j) and certain primes p with ord_p(-2) even (A163185). - Christopher J. Smyth, Jul 23 2009
Terms m in A047476 with A010051(m) = 1. - Reinhard Zumkeller, Dec 29 2012

References

  • David A. Cox, "Primes of the Form x^2 + n y^2", Wiley, 1989.

Crossrefs

Cf. A039706, A003628 (complement with respect to A000040).
Primes in A002479.
Cf. A051100 (see Mathar's comment).
Apart from leading term the same as A033200.

Programs

  • Haskell
    a033203 n = a033203_list !! (n-1)
    a033203_list = filter ((== 1) . a010051) a047476_list
    -- Reinhard Zumkeller, Dec 29 2012, Jan 22 2012
    
  • Magma
    [p: p in PrimesUpTo(600) | p mod 8 in [1..3]]; // Vincenzo Librandi, Aug 11 2012
    
  • Magma
    [p: p in PrimesUpTo(800) | NormEquation(2,p) eq true]; // Bruno Berselli, Jul 03 2016
    
  • Mathematica
    QuadPrimes2[1, 0, 2, 10000] (* see A106856 *)
    Select[Prime[Range[200]],MemberQ[{1,2,3},Mod[#,8]]&] (* Harvey P. Dale, Mar 16 2013 *)
  • PARI
    is(n)=isprime(n) && issquare(Mod(-2,n)) \\ Charles R Greathouse IV, Nov 29 2016

Formula

a(n) = A002332(n) + 2*A002333(n)^2. - Zak Seidov, May 29 2014
Showing 1-10 of 48 results. Next