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.

A025427 Number of partitions of n into 3 nonzero squares.

This page as a plain text file.
%I A025427 #52 Jun 14 2025 21:41:16
%S A025427 0,0,0,1,0,0,1,0,0,1,0,1,1,0,1,0,0,1,1,1,0,1,1,0,1,0,1,2,0,1,1,0,0,2,
%T A025427 1,1,1,0,2,0,0,2,1,1,1,1,1,0,1,1,1,2,0,1,3,0,1,2,0,2,0,1,2,0,0,1,3,1,
%U A025427 1,2,1,0,1,1,2,2,1,2,1,0,0,3,1,2,1,0,3,0,1,3,2,1,0,1,2,0,1,1,2,3,0,3,2,0,1,2,1,2
%N A025427 Number of partitions of n into 3 nonzero squares.
%C A025427 The non-vanishing values a(n) give the multiplicities for the numbers n appearing in A000408. See also A024795 where these numbers n are listed a(n) times. For the primitive case see A223730 and A223731. - _Wolfdieter Lang_, Apr 03 2013
%H A025427 R. J. Mathar and R. Zumkeller, <a href="/A025427/b025427.txt">Table of n, a(n) for n = 0..10000</a>, first 5592 terms from R. J. Mathar
%H A025427 <a href="/index/Su#ssq">Index to sequences related to sums of squares and cubes</a>.
%F A025427 a(A004214(n)) = 0; a(A000408(n)) > 0; a(A025414(n)) = n and a(m) != n for m < A025414(n). - _Reinhard Zumkeller_, Feb 26 2015
%F A025427 a(4n) = a(n). This is because if a number divisible by 4 is the sum of three squares, each of those squares must be even. - _Robert Israel_, Mar 09 2016
%F A025427 a(n) = Sum_{k=1..floor(n/3)} Sum_{i=k..floor((n-k)/2)} A010052(i) * A010052(k) * A010052(n-i-k). - _Wesley Ivan Hurt_, Apr 19 2019
%F A025427 a(n) = [x^n y^3] Product_{k>=1} 1/(1 - y*x^(k^2)). - _Ilya Gutkovskiy_, Apr 19 2019
%e A025427 a(27) = 2 because  1^2 + 1^2 + 5^2 = 27  = 3^2 + 3^2 + 3^2. The second representation is not primitive (gcd(3,3,3) = 3 not 1).
%p A025427 A025427 := proc(n)
%p A025427     local a,x,y,zsq ;
%p A025427     a := 0 ;
%p A025427     for x from 1 do
%p A025427         if 3*x^2 > n then
%p A025427             return a;
%p A025427         end if;
%p A025427         for y from x do
%p A025427             if x^2+2*y^2 > n then
%p A025427                 break;
%p A025427             end if;
%p A025427             zsq := n-x^2-y^2 ;
%p A025427             if issqr(zsq) then
%p A025427                 a := a+1 ;
%p A025427             end if;
%p A025427         end do:
%p A025427     end do:
%p A025427 end proc: # _R. J. Mathar_, Sep 15 2015
%p A025427 # second Maple program:
%p A025427 b:= proc(n, i, t) option remember; `if`(n=0, `if`(t=0, 1, 0),
%p A025427       `if`(i<1 or t<1, 0, b(n, i-1, t)+
%p A025427       `if`(i^2>n, 0, b(n-i^2, i, t-1))))
%p A025427     end:
%p A025427 a:= n-> b(n, isqrt(n), 3):
%p A025427 seq(a(n), n=0..107);  # _Alois P. Heinz_, Jun 14 2025
%t A025427 Count[PowersRepresentations[#, 3, 2], pr_ /; (Times @@ pr) > 0]& /@ Range[0, 120] (* _Jean-François Alcover_, Jan 30 2018 *)
%o A025427 (Haskell)
%o A025427 a025427 n = sum $ map f zs where
%o A025427    f x = sum $ map (a010052 . (n - x -)) $
%o A025427                    takeWhile (<= div (n - x) 2) $ dropWhile (< x) zs
%o A025427    zs = takeWhile (< n) $ tail a000290_list
%o A025427 -- _Reinhard Zumkeller_, Feb 26 2015
%o A025427 (PARI) a(n)=if(n<3, return(0)); sum(i=sqrtint((n-1)\3)+1,sqrtint(n-2), my(t=n-i^2); sum(j=sqrtint((t-1)\2)+1,min(sqrtint(t-1),i), issquare(t-j^2))) \\ _Charles R Greathouse IV_, Aug 05 2024
%Y A025427 Cf. A000408, A024795, A223730 (multiplicities for the primitive case). - _Wolfdieter Lang_, Apr 03 2013
%Y A025427 Column k=3 of A243148.
%Y A025427 Cf. A000290, A010052, A004214, A025321, A025414, A025426.
%K A025427 nonn,easy
%O A025427 0,28
%A A025427 _David W. Wilson_