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.

A025442 Number of partitions of n into 3 distinct nonzero squares.

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Column k=3 of A341040.

Programs

  • Maple
    b:= proc(n,i,t) option remember; `if`(n=0, `if`(t=0,1,0),
          `if`(i<1 or t<1, 0, `if`(i=1, 0, b(n,i-1,t))+
          `if`(i^2>n, 0, b(n-i^2,i-1,t-1))))
        end:
    a:= n-> b(n, isqrt(n), 3):
    seq(a(n), n=0..120);  # Alois P. Heinz, Feb 07 2013
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[n==0, If[t==0, 1, 0], If[i<1 || t<1, 0, If[i==1, 0, b[n, i-1, t]] + If[i^2 > n, 0, b[n-i^2, i-1, t-1]]]]; a[n_] := b[n, Sqrt[n] // Floor, 3]; Table[a[n], {n, 0, 120}] (* Jean-François Alcover, Oct 10 2015, after Alois P. Heinz *)
  • PARI
    A025442(n)={sum(x=1,sqrtint(n\3),sum(y=x+1,sqrtint((n-1-x^2)\2),issquare(n-x^2-y^2)))} \\ - M. F. Hasler, Feb 03 2013

Formula

a(n)>0 <=> n is in A004432. - M. F. Hasler, Feb 03 2013
a(n) = [x^n y^3] Product_{k>=1} (1 + y*x^(k^2)). - Ilya Gutkovskiy, Apr 22 2019