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 12 results. Next

A025428 Number of partitions of n into 4 nonzero squares.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Records occur at n= 4, 28, 52, 82, 90, 130, 162, 198, 202, 210,.... - R. J. Mathar, Sep 15 2015

Crossrefs

Cf. A000414, A000534, A025357-A025375, A216374, A025416 (greedy inverse).
Column k=4 of A243148.

Programs

  • Maple
    A025428 := proc(n)
        local a,i,j,k,lsq ;
        a := 0 ;
        for i from 1 do
            if 4*i^2 > n then
                return a;
            end if;
            for j from i do
                if i^2+3*j^2 > n then
                    break;
                end if;
                for k from j do
                    if i^2+j^2+2*k^2 > n then
                        break;
                    end if;
                    lsq := n-i^2-j^2-k^2 ;
                    if lsq >= k^2 and issqr(lsq) then
                        a := a+1 ;
                    end if;
                end do:
            end do:
        end do:
    end proc:
    seq(A025428(n),n=1..40) ; # R. J. Mathar, Jun 15 2018
    # second Maple program:
    b:= proc(n, i, t) option remember; `if`(n=0, `if`(t=0, 1, 0),
         `if`(i<1 or t<1, 0, b(n, i-1, t)+`if`(i^2>n, 0, b(n-i^2, i, t-1))))
        end:
    a:= n-> b(n, isqrt(n), 4):
    seq(a(n), n=0..100);  # Alois P. Heinz, Apr 14 2019
  • Mathematica
    nn = 100; lim = Sqrt[nn]; t = Table[0, {nn}]; Do[n = a^2 + b^2 + c^2 + d^2; If[n <= nn, t[[n]]++], {a, lim}, {b, a, lim}, {c, b, lim}, {d, c, lim}]; t (* T. D. Noe, Sep 28 2012 *)
    f[n_] := Length@ IntegerPartitions[n, {4}, Range[ Floor[ Sqrt[n - 1]]]^2]; Array[f, 105] (* Robert G. Wilson v, Sep 28 2012 *)
  • PARI
    A025428(n)=sum(a=1,n,sum(b=1,a,sum(c=1,b,sum(d=1,c,a^2+b^2+c^2+d^2==n))))
    
  • PARI
    A025428(n)=sum(a=1,sqrtint(max(n-3,0)), sum(b=1,min(sqrtint(n-a^2-2),a), sum(c=1,min(sqrtint(n-a^2-b^2-1),b),issquare(n-a^2-b^2-c^2,&d) & d <= c )))
    
  • PARI
    A025428(n)=sum(a=sqrtint(max(n,4)\4),sqrtint(max(n-3,0)), sum(b=sqrtint((n-a^2)\3-1)+1,min(sqrtint(n-a^2-2),a), sum(c=sqrtint((t=n-a^2-b^2)\2-1)+1, min(sqrtint(t-1),b), issquare(t-c^2) ))) \\ - M. F. Hasler, Sep 17 2012
    for(n=1,100,print1(A025428(n),","))
    
  • PARI
    T(n)={a=matrix(n,4,i,j,0);for(d=1,sqrtint(n),forstep(i=n,d*d+1,-1,for(j=2,4,a[i,j]+=sum(k=1,j,if(k0,a[i-k*d*d,j-k],if(k==j&&i-k*d*d==0,1)))));a[d*d,1]=1);for(i=1,n,print(i" "a[i,4]))} /* Robert Gerbicz, Sep 28 2012 */

Formula

For n>0, a(n) = ( A063730(n) + 6*A213024(n) + 3*A063725(n/2) + 8*A092573(n) + 6*A010052(n/4) ) / 24. - Max Alekseyev, Sep 30 2012
a(n) = ( A000118(n) - 4*A005875(n) - 6*A004018(n) - 12*A000122(n) - 15*A000007(n) + 12*A014455(n) - 24*A033715(n) - 12*A000122(n/2) + 12*A004018(n/2) + 32*A033716(n) - 32*A000122(n/3) + 48*A000122(n/4) ) / 384. - Max Alekseyev, Sep 30 2012
a(n) = [x^n y^4] Product_{k>=1} 1/(1 - y*x^(k^2)). - Ilya Gutkovskiy, Apr 19 2019
a(n) = Sum_{k=1..floor(n/4)} Sum_{j=k..floor((n-k)/3)} Sum_{i=j..floor((n-j-k)/2)} A010052(i) * A010052(j) * A010052(k) * A010052(n-i-j-k). - Wesley Ivan Hurt, Apr 19 2019

Extensions

Values of a(0..10^4) double-checked by M. F. Hasler, Sep 17 2012

A092572 Numbers of the form x^2 + 3y^2 where x and y are positive integers.

Original entry on oeis.org

4, 7, 12, 13, 16, 19, 21, 28, 31, 36, 37, 39, 43, 48, 49, 52, 57, 61, 63, 64, 67, 73, 76, 79, 84, 91, 93, 97, 100, 103, 108, 109, 111, 112, 117, 124, 127, 129, 133, 139, 144, 147, 148, 151, 156, 157, 163, 169, 171, 172, 175, 181, 183, 189, 192, 193, 196, 199
Offset: 1

Views

Author

Eric W. Weisstein, Feb 28 2004

Keywords

Comments

Superset of primes of the form 6n+1 (A002476).
It seems that all integer solutions of ((a+b)^3 - (a-b)^3) / (2*b) = c^3 have c = x^2 + 3*y^2. - Juergen Buchmueller (pullmoll(AT)t-online.de), Apr 04 2008
To prove the case of cubes in Fermat's last theorem, Euler considered numbers of the form a^2 + 3b^2. In the equation x^3 + y^3 = z^3, Euler specified that x = a - b and y = a + b. - Alonso del Arte, Jul 19 2012
All terms == 0,1,3,4, or 7 (mod 9). - Robert Israel, Apr 03 2017

Examples

			7 is of the specified form, since 2^2 + 3 * 1^2 = 7.
So is 12, since 3^2 + 3 * 1^2 = 12, and 13, with 1^2 + 3 * 2^2 = 13.
		

References

  • Paulo Ribenboim, 13 Lectures on Fermat's Last Theorem. New York: Springer-Verlag (1979): 4.

Crossrefs

Cf. A002476, A092573, A092575, A158937 (similar definition but with duplicates left in).

Programs

  • Maple
    N:= 1000: # to get all terms <= N
    S:= {seq(seq(x^2 + 3*y^2, x = 1 .. floor(sqrt(N - 3*y^2))),
      y=1..floor(sqrt(N/3-1)))}:
    sort(convert(S,list)); # Robert Israel, Apr 03 2017
  • Mathematica
    Union[Flatten[Table[a^2 + 3b^2, {a, 20}, {b, Ceiling[Sqrt[(400 - a^2)/3]]}]]] (* Alonso del Arte, Jul 19 2012 *)

A216282 Number of nonnegative solutions to the equation x^2 + 2*y^2 = n.

Original entry on oeis.org

1, 1, 1, 1, 0, 1, 0, 1, 2, 0, 1, 1, 0, 0, 0, 1, 1, 2, 1, 0, 0, 1, 0, 1, 1, 0, 2, 0, 0, 0, 0, 1, 2, 1, 0, 2, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 2, 0, 0, 2, 0, 0, 2, 0, 1, 0, 0, 0, 0, 1, 0, 2, 1, 1, 0, 0, 0, 2, 1, 0, 1, 1, 0, 0, 0, 0, 3, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 3, 1, 0, 2, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 1, 2, 0, 0, 0, 1, 0, 0
Offset: 1

Views

Author

V. Raman, Sep 03 2012

Keywords

Comments

Records occur at 1, 9, 81, 297, 891, 1683, 5049, 15147, 31977, ... - Antti Karttunen, Aug 23 2017

Examples

			For n = 9, there are two solutions: 9 = 9^2 + 2*(0^2) = 1^2 + 2*(2^2), thus a(9) = 2.
For n = 81, there are three solutions: 81 = 9^2 + 2*(0^2) = 3^2 + 2*(6^2) = 7^2 + 2*(4^2), thus a(81) = 3.
For n = 65536, there is one solution: 65536 = 256^2 + 2*(0^2) = 65536 + 0, thus a(65536) = 1.
For n = 65537, there is one solution: 65537 = 255^2 + 2*(16^2) = 65205 + 512, thus a(65537) = 1.
		

Crossrefs

Cf. A002479 (positions of nonzeros), A097700 (of zeros).

Programs

  • Mathematica
    r[n_] := Reduce[x >= 0 && y >= 0 && x^2 + 2 y^2 == n, Integers];
    a[n_] := Which[rn = r[n]; rn === False, 0, Head[rn] === And, 1, Head[rn] === Or, Length[rn], True, -1];
    Table[a[n], {n, 1, 120}] (* Jean-François Alcover, Jun 24 2017 *)
  • Scheme
    (define (A216282 n) (cond ((< n 2) 1) (else (let loop ((k (- (A000196 n) (modulo (- n (A000196 n)) 2))) (s 0)) (if (< k 0) s (let ((x (/ (- n (* k k)) 2))) (loop (- k 2) (+ s (A010052 x))))))))) ;; Antti Karttunen, Aug 23 2017

Extensions

Examples from Antti Karttunen, Aug 23 2017

A374158 a(n) is the smallest nonnegative integer k where exactly n pairs of positive integers (x, y) exist such that x^2 + 3*y^2 = k.

Original entry on oeis.org

0, 4, 91, 28, 196, 31213, 364, 9604, 53599, 2548, 470596
Offset: 0

Views

Author

Seiichi Manyama, Jun 29 2024

Keywords

Comments

a(n) is the smallest nonnegative k such that A092573(k) = n.
a(11) <= 3672178237.
a(12) = 6916.
a(13) = 33124.
a(14) = 29059303.
a(15) = 124852.
a(16) = 1983163.
a(18) = 48412.
a(20) = 18384457.
a(21) = 6117748.
a(22) = 1623076.
a(24) = 214396.
a(27) = 629356.
a(28) = 900838393.
a(31) = 79530724.
a(32) = 85276009.
a(37) = 274299844.
a(42) = 116237212.
a(60) = 73537828.
a(67) = 585930436.
From Chai Wah Wu, Jun 29-30 2024: (Start)
a(30) = 2372188.
a(36) = 1500772.
a(40) = 11957764.
a(45) = 30838444.
a(48) = 7932652.
a(54) = 19510036.
a(72) = 55528564.
(End)

Examples

			   n | a(n)
-----+---------------------------
   1 |      4 = 2^2.
   2 |     91 = 7 * 13.
   3 |     28 = 2^2 * 7.
   4 |    196 = 2^2 * 7^2.
   5 |  31213 = 7^4 * 13.
   6 |    364 = 2^2 * 7 * 13.
   7 |   9604 = 2^2 * 7^4.
   8 |  53599 = 7 * 13 * 19 * 31.
   9 |   2548 = 2^2 * 7^2 * 13.
  10 | 470596 = 2^2 * 7^6.
		

Crossrefs

Programs

  • Python
    from itertools import count
    from sympy.abc import x,y
    from sympy.solvers.diophantine.diophantine import diop_quadratic
    def A374158(n): return next(m for m in count(0) if sum(1 for d in diop_quadratic(x**2+3*y**2-m) if d[0]>0 and d[1]>0)==n) # Chai Wah Wu, Jun 29 2024

A092575 Number of representations of n of the form x^2 + 3y^2 with (x,y)=1.

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Eric W. Weisstein, Feb 28 2004

Keywords

Crossrefs

Programs

  • Maple
    N:= 200: # to get a(1)..a(N)
    V:= Vector(N):
    for y from 1 to floor(sqrt(N/3-1)) do
      for x from 1 to floor(sqrt(N-3*y^2)) do
        if igcd(x,y) = 1 then V[x^2 + 3*y^2]:= V[x^2+3*y^2]+1
        fi
    od od:
    convert(V,list); # Robert Israel, Apr 03 2017
  • Mathematica
    r[n_] := Reduce[ x > 0 && y > 0 && GCD[x, y] == 1 && n == x^2 + 3 y^2, {x, y}, Integers]; a[n_] := Which[ r[n] === False, 0, r[n][[0]] === And, 1, True, Length[r[n]]]; Table[a[n], {n, 1, 102}] (* Jean-François Alcover, Oct 31 2012 *)

A216283 Number of nonnegative solutions to the equation x^2+5*y^2 = n.

Original entry on oeis.org

1, 0, 0, 1, 1, 1, 0, 0, 2, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 2, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 2, 1, 0, 0, 2, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 0, 0, 2, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1
Offset: 1

Views

Author

V. Raman, Sep 03 2012

Keywords

Comments

Records occur at 1, 9, 81, 189, 441, 1449, 3969, 12789, 13041, 30429, ... - Antti Karttunen, Aug 23 2017

Examples

			For n = 9, there are two solutions: 9 = 3^2 + 5*(0^2) = 2^2 + 5*(1^2), thus a(9) = 2.
For n = 81, there are three solutions: 81  = 9^2 + 5*(0^2) = 6^2 + 5*(3^2) = 1^2 + 5*(4^2), thus a(81) = 3.
		

Crossrefs

Cf. A033718 (all solutions x^2+5*y^2 = n).
Cf. A020669 (positions of nonzeros).

Programs

  • PARI
    N=666;  x='x+O('x^N);
    T(x)=sum(n=0,ceil(sqrt(N)),x^(n*n));
    Vec(T(x)*T(x^5))
    /* Joerg Arndt, Sep 21 2012 */
    
  • Scheme
    (define (A216283 n) (cond ((< n 2) 1) (else (let loop ((k (A000196 n)) (s 0)) (if (< k 0) s (let ((x (- n (* k k)))) (loop (- k 1) (+ s (if (zero? (modulo x 5)) (A010052 (/ x 5)) 0))))))))) ;; Antti Karttunen, Aug 23 2017

Formula

G.f. T(x) * T(x^5) where T(x) = sum(n>=0, x^(n^2) ). - Joerg Arndt, Sep 21 2012

Extensions

Examples from Antti Karttunen, Aug 23 2017

A092574 Positive integers that can be represented in the form x^2 + 3y^2 with (x,y) = 1 and x and y positive.

Original entry on oeis.org

4, 7, 12, 13, 19, 21, 28, 31, 37, 39, 43, 49, 52, 57, 61, 67, 73, 76, 79, 84, 91, 93, 97, 103, 109, 111, 124, 127, 129, 133, 139, 147, 148, 151, 156, 157, 163, 169, 172, 181, 183, 193, 196, 199, 201, 211, 217, 219, 223, 228, 229, 237, 241, 244, 247, 259, 268
Offset: 1

Views

Author

Eric W. Weisstein, Feb 28 2004

Keywords

Comments

Superset of primes of the form 6n+1 (A002476).
For all proper solutions with nonnegative x and y see A244819. - Wolfdieter Lang, Mar 02 2021

Crossrefs

A216278 Number of solutions to the equation x^2+2y^2 = n with x and y > 0.

Original entry on oeis.org

0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 2, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 2, 0, 0, 2, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 2, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 2, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 3, 0, 0, 2, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 1, 2, 0, 0, 0, 1, 0, 0
Offset: 1

Views

Author

V. Raman, Sep 03 2012

Keywords

Crossrefs

Programs

  • Mathematica
    r[n_] := Reduce[x > 0 && y > 0 && x^2 + 2 y^2 == n, Integers];
    a[n_] := Which[rn = r[n]; rn === False, 0, Head[rn] === And, 1, Head[rn] === Or, Length[rn], True, -1];
    Table[a[n], {n, 1, 120}] (* Jean-François Alcover, Jun 24 2017 *)

A216279 Number of solutions to the equation x^2+5y^2 = n with x and y > 0.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1
Offset: 1

Views

Author

V. Raman, Sep 03 2012

Keywords

Crossrefs

Programs

  • PARI
    a(n)=sum(k=1,sqrtint((n-1)\5), issquare(n-5*k^2)) \\ Charles R Greathouse IV, Jun 06 2016
    
  • PARI
    list(lim)=my(v=vector(lim\1),t); for(y=1,sqrtint((#v-1)\5), t=5*y^2; for(x=1,sqrtint(#v-t), v[x^2+t]++)); v \\ Charles R Greathouse IV, Jun 06 2016

A374017 Number of solutions to x^2 + 11*y^2 = n in positive integers x and y.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 2
Offset: 0

Views

Author

Seiichi Manyama, Jun 29 2024

Keywords

Crossrefs

Programs

  • PARI
    a(n) = if(n==0, 0, sum(k=1, sqrtint((n-1)\11), issquare(n-11*k^2)));
Showing 1-10 of 12 results. Next