login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A025426
Number of partitions of n into 2 nonzero squares.
46
0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 2, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 2, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0
OFFSET
0,51
COMMENTS
For records see A007511, A048610, A016032. - R. J. Mathar, Feb 26 2008
FORMULA
Let m = A004018(n)/4. If m is even then a(n) = m/2, otherwise a(n) = (m - (-1)^A007814(n))/2. - Max Alekseyev, Mar 09 2009, Mar 14 2009
a(A018825(n)) = 0; a(A000404(n)) > 0; a(A025284(n)) = 1; a(A007692(n)) > 1. - Reinhard Zumkeller, Aug 16 2011
a(A000578(n)) = A084888(n). - Reinhard Zumkeller, Jul 18 2012
a(n) = Sum_{i=1..floor(n/2)} A010052(i) * A010052(n-i). - Wesley Ivan Hurt, Apr 19 2019
a(n) = [x^n y^2] Product_{k>=1} 1/(1 - y*x^(k^2)). - Ilya Gutkovskiy, Apr 19 2019
Conjecture: Sum_{k=1..n} a(k) ~ n*Pi/8. - Vaclav Kotesovec, Dec 28 2023
MAPLE
A025426 := proc(n)
local a, x;
a := 0 ;
for x from 1 do
if 2*x^2 > n then
return a;
end if;
if issqr(n-x^2) then
a := a+1 ;
end if;
end do:
end proc: # R. J. Mathar, Sep 15 2015
MATHEMATICA
m[n_] := m[n] = SquaresR[2, n]/4; a[0] = 0; a[n_] := If[ EvenQ[ m[n] ], m[n]/2, (m[n] - (-1)^IntegerExponent[n, 2])/2]; Table[ a[n], {n, 0, 107}] (* Jean-François Alcover, Jan 31 2012, after Max Alekseyev *)
nmax = 107; sq = Range[Sqrt[nmax]]^2;
Table[Length[Select[IntegerPartitions[n, All, sq], Length[#] == 2 &]], {n, 0, nmax}] (* Robert Price, Aug 17 2020 *)
PROG
(Haskell)
a025426 n = sum $ map (a010052 . (n -)) $
takeWhile (<= n `div` 2) $ tail a000290_list
a025426_list = map a025426 [0..]
-- Reinhard Zumkeller, Aug 16 2011
(PARI) a(n)={my(v=valuation(n, 2), f=factor(n>>v), t=1); for(i=1, #f[, 1], if(f[i, 1]%4==1, t*=f[i, 2]+1, if(f[i, 2]%2, return(0)))); if(t%2, t-(-1)^v, t)/2; } \\ Charles R Greathouse IV, Jan 31 2012
(Python)
from math import prod
from sympy import factorint
def A025426(n): return ((m:=prod(1 if p==2 else (e+1 if p&3==1 else (e+1)&1) for p, e in factorint(n).items()))+((((~n & n-1).bit_length()&1)<<1)-1 if m&1 else 0))>>1 # Chai Wah Wu, Jul 07 2022
CROSSREFS
Cf. A000161 (2 nonnegative squares), A063725 (order matters), A025427 (3 nonzero squares).
Cf. A172151, A004526. - Reinhard Zumkeller, Jan 26 2010
Column k=2 of A243148.
Sequence in context: A285313 A231366 A158924 * A269244 A204246 A053200
KEYWORD
nonn,easy
STATUS
approved