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

A287166 Smallest number with exactly n representations as a sum of 7 nonzero squares or 0 if no such number exists.

Original entry on oeis.org

7, 22, 31, 37, 45, 67, 55, 61, 69, 70, 79, 82, 94, 108, 85, 93, 103, 106, 111, 132, 109, 126, 139, 117, 147, 146, 130, 145, 144, 133, 153, 167, 141, 154, 160, 172, 159, 166, 187, 157, 177, 174, 175, 0, 178, 165
Offset: 1

Views

Author

Ilya Gutkovskiy, May 20 2017

Keywords

Examples

			a(1) = 7 because 7 is the smallest number with exactly 1 representation as a sum of 7 nonzero squares: 7 = 1^2 + 1^2 + 1^2 + 1^2 + 1^2 + 1^2 + 1^2;
a(2) = 22 because 22 is the smallest number with exactly 2 representations as a sum of 7 nonzero squares: 22 = 1^2 + 1^2 + 1^2 + 1^2 + 1^2 + 1^2 + 4^2 = 1^2 + 1^2 + 2^2 + 2^2 + 2^2 + 2^2 + 2^2, etc.
		

Crossrefs

Formula

A025431(a(n)) = n for a(n) > 0.

A214513 Least number having n orderless representations as p^2 + q^2 + r^2 + s^2, where p, q, r, and s are primes.

Original entry on oeis.org

16, 148, 196, 436, 388, 628, 868, 988, 1228, 1468, 1708, 2212, 2068, 2860, 2620, 2380, 3220, 3388, 3700, 4108, 3940, 4180, 5260, 4228, 5068, 4900, 5500, 6220, 6340, 7780, 5908, 5740, 6580, 7540, 8260, 7420, 8860, 9340, 11260, 10708, 9940, 9100, 10180, 12820
Offset: 1

Views

Author

T. D. Noe, Jul 29 2012

Keywords

Crossrefs

Programs

  • Mathematica
    nn = 10^5; ps = Prime[Range[PrimePi[Sqrt[nn]]]]; t = Flatten[Table[ps[[i]]^2 + ps[[j]]^2 + ps[[k]]^2 + ps[[l]]^2, {i, Length[ps]}, {j, i, Length[ps]}, {k, j, Length[ps]}, {l, k, Length[ps]}]]; t = Select[t, # <= nn &]; t2 = Sort[Tally[t]]; u = Union[Transpose[t2][[2]]]; d = Complement[Range[u[[-1]]], u]; If[d == {}, nLim = u[[-1]], nLim = d[[1]]-1]; t3 = Table[Select[t2, #[[2]] == n &, 1][[1]], {n, nLim}]; Transpose[t3][[1]]

A213721 Smallest prime that is the sum of four nonzero squares in exactly n ways.

Original entry on oeis.org

2, 7, 31, 67, 97, 103, 157, 199, 277, 223, 307, 383, 439, 367, 547, 463, 673, 613, 577, 751, 643, 733, 787, 727, 853, 983, 997, 967, 1171, 1223, 1063, 1087, 1123, 1613, 1237, 1279, 1471, 1453, 1669, 1423, 1483, 1597, 1627, 1543, 1567, 1747, 2039, 1753, 1867, 1951
Offset: 0

Views

Author

Arkadiusz Wesolowski, Nov 02 2012

Keywords

Examples

			a(2) = 31 because 31 = 2*1 + 4 + 25 = 4 + 3*9.
		

Crossrefs

Cf. A025416.

Programs

  • Mathematica
    lst = {}; Do[p = 2; While[True, If[PrimeQ[p] && Length@Select[PowersRepresentations[p, 4, 2], ! MemberQ[#, 0] &] == n, AppendTo[lst, p]; Break[]]; p++], {n, 0, 49}]; lst

A287165 Smallest number with exactly n representations as a sum of 6 nonzero squares or 0 if no such number exists.

Original entry on oeis.org

6, 21, 30, 36, 63, 54, 60, 87, 78, 81, 84, 111, 102, 117, 108, 116, 126, 129, 134, 137, 132, 150, 172, 165, 161, 156, 177, 164, 195, 191, 182, 213, 180, 188, 198, 0, 204, 206, 215, 222, 243, 212, 251, 262, 233, 230
Offset: 1

Views

Author

Ilya Gutkovskiy, May 20 2017

Keywords

Examples

			a(1) = 6 because 6 is the smallest number with exactly 1 representation as a sum of 6 nonzero squares: 6 = 1^2 + 1^2 + 1^2 + 1^2 + 1^2 + 1^2;
a(2) = 21 because 21 is the smallest number with exactly 2 representations as a sum of 6 nonzero squares: 21 = 1^2 + 1^2 + 1^2 + 1^2 + 1^2 + 4^2 = 1^2 + 2^2 + 2^2 + 2^2 + 2^2 + 2^2, etc.
		

Crossrefs

Formula

A025430(a(n)) = n for a(n) > 0.

A287167 Smallest number with exactly n representations as a sum of 8 nonzero squares or 0 if no such number exists.

Original entry on oeis.org

8, 23, 35, 32, 46, 58, 72, 56, 62, 70, 71, 79, 80, 83, 88, 89, 91, 86, 103, 94, 109, 104, 107, 112, 113, 110, 122, 119, 126, 121, 118, 144, 0, 128, 131, 136, 137, 153, 143, 139, 149, 134, 0, 0, 142, 152, 164, 154
Offset: 1

Views

Author

Ilya Gutkovskiy, May 20 2017

Keywords

Examples

			a(1) = 8 because 8 is the smallest number with exactly 1 representation as a sum of 8 nonzero squares: 8 = 1^2 + 1^2 + 1^2 + 1^2 + 1^2 + 1^2 + 1^2 + 1^2;
a(2) = 23 because 23 is the smallest number with exactly 2 representations as a sum of 8 nonzero squares: 23 = 1^2 + 1^2 + 1^2 + 1^2 + 1^2 + 1^2 + 1^2 + 4^2 = 1^2 + 1^2 + 1^2 + 2^2 + 2^2 + 2^2 + 2^2 + 2^2, etc.
		

Crossrefs

Formula

A025432(a(n)) = n for a(n) > 0.

A374486 Numbers k such that Taxicab(2,j,k) exists for large j.

Original entry on oeis.org

1, 2, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29, 30, 31, 33, 37, 39, 40, 42, 44, 48, 50, 51, 52, 53, 56, 59, 62, 66, 68, 70, 72, 74, 77, 79, 87, 91, 92, 96, 97, 103, 108, 112, 115, 117, 120, 121, 124, 130, 131, 138, 148, 149, 161, 164, 176, 184, 185, 194, 200
Offset: 1

Views

Author

Keywords

Comments

Here Taxicab(2,j,k) denotes the smallest number (if it exists) that is the sum of j perfect squares in exactly k ways. For sufficiently large N, Taxicab(2,j,k) either always exists for j > N or always does not exist for j > N.
Conjecture: Infinitely many positive integers are in this sequence, and infinitely many positive integers are not in this sequence.
Conjecture: This sequence grows exponentially. Computationally it appears to have asymptotic a(n) = 1.03691*exp(0.594473*n^(1/2)).

Examples

			For k = 3, Taxicab(2,j,3) does not exist for all j > 9, hence 3 is not a member of the sequence.
		

References

  • E. Grosswald. Representations of Integers as Sums of Squares. Springer New York, NY, 1985.

Crossrefs

Showing 1-7 of 7 results.