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-7 of 7 results.

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

A025338 Numbers that are the sum of 3 nonzero squares in 10 or more ways.

Original entry on oeis.org

594, 734, 761, 794, 801, 846, 854, 866, 881, 909, 926, 941, 950, 965, 986, 1001, 1026, 1034, 1041, 1046, 1049, 1089, 1106, 1109, 1121, 1130, 1154, 1161, 1169, 1181, 1190, 1206, 1209, 1214, 1226, 1238, 1265, 1274, 1286, 1301, 1314, 1322, 1326, 1329, 1341
Offset: 1

Views

Author

Keywords

Crossrefs

A345155 Numbers that are the sum of four third powers in ten or more ways.

Original entry on oeis.org

21896, 36225, 46872, 48321, 48825, 51506, 52416, 53200, 55575, 58338, 58968, 59059, 60480, 62244, 66024, 67536, 67851, 70434, 70525, 71155, 72819, 73808, 76384, 76923, 77896, 78624, 78912, 81081, 81991, 85995, 87507, 88641, 90181, 90783, 91448, 91728, 92008
Offset: 1

Views

Author

David Consiglio, Jr., Jun 09 2021

Keywords

Examples

			21896 is a term because 21896 = 1^3 + 11^3 + 19^3 + 22^3  = 2^3 + 2^3 + 12^3 + 26^3  = 2^3 + 3^3 + 19^3 + 23^3  = 2^3 + 5^3 + 15^3 + 25^3  = 3^3 + 10^3 + 16^3 + 24^3  = 3^3 + 17^3 + 19^3 + 19^3  = 4^3 + 6^3 + 20^3 + 22^3  = 5^3 + 8^3 + 14^3 + 25^3  = 7^3 + 11^3 + 17^3 + 23^3  = 8^3 + 9^3 + 19^3 + 22^3.
		

Crossrefs

Programs

  • Python
    from itertools import combinations_with_replacement as cwr
    from collections import defaultdict
    keep = defaultdict(lambda: 0)
    power_terms = [x**3 for x in range(1, 1000)]
    for pos in cwr(power_terms, 4):
        tot = sum(pos)
        keep[tot] += 1
    rets = sorted([k for k, v in keep.items() if v >= 10])
    for x in range(len(rets)):
        print(rets[x])

A025374 Numbers that are the sum of 4 nonzero squares in 9 or more ways.

Original entry on oeis.org

162, 178, 198, 202, 207, 210, 220, 223, 225, 226, 231, 234, 242, 243, 246, 247, 250, 252, 253, 255, 258, 262, 265, 266, 267, 268, 270, 271, 273, 274, 278, 279, 282, 283, 285, 286, 287, 290, 291, 292, 294, 295, 297, 298, 300, 301, 303, 306, 307, 309, 310, 313, 314, 315
Offset: 1

Views

Author

Keywords

Crossrefs

Formula

{n: A025428(n) >= 9}. - R. J. Mathar, Jun 15 2018

A344803 Numbers that are the sum of five squares in ten or more ways.

Original entry on oeis.org

107, 109, 116, 125, 128, 131, 133, 134, 136, 139, 140, 142, 146, 147, 148, 149, 151, 152, 154, 155, 157, 158, 160, 163, 164, 166, 167, 168, 170, 171, 172, 173, 174, 175, 176, 178, 179, 181, 182, 183, 184, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196
Offset: 1

Views

Author

Sean A. Irvine, May 29 2021

Keywords

Crossrefs

A025394 Numbers that are the sum of 4 distinct nonzero squares in 10 or more ways.

Original entry on oeis.org

270, 294, 318, 330, 342, 350, 351, 354, 366, 375, 378, 382, 390, 398, 399, 402, 406, 410, 414, 422, 426, 429, 430, 434, 435, 438, 441, 442, 446, 450, 455, 459, 462, 465, 466, 470, 471, 474, 478, 483, 486, 490, 494, 495, 498, 501, 506, 507, 510, 513, 515, 518, 519, 522
Offset: 1

Views

Author

Keywords

Comments

The common sum of rows, columns and diagonals of magic squares whose entries are distinct squares must be terms of this sequence. - M. F. Hasler, Jul 22 2025

Crossrefs

Cf. A025443 (number of ways to write n as sum of 4 distinct nonzero squares).
Cf. A025385 (subsequence of terms with A025443(n) = 10 exactly),
Subsequence of A025375 (sums of 4 not necessarily distinct nonzero squares in at least 10 ways).

Formula

{n: A025443(n) >= 10}. - R. J. Mathar, Jun 15 2018

A024375 a(n) = s(1)*t(n) + s(2)*t(n-1) + ... + s(k)*t(n+1-k), where k = floor((n+1)/2), s = A023532, t = A023533.

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Programs

Showing 1-7 of 7 results.