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.

A357354 Number of partitions of n into distinct positive squares such that the number of parts is a square.

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Sep 25 2022

Keywords

Examples

			a(30) = 1 because we have [16,9,4,1].
a(78) = 3: [36,25,16,1], [49,16,9,4], [64,9,4,1].
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0,
         `if`(issqr(t), 1, 0), `if`(n>i*(i+1)*(2*i+1)/6, 0,
         `if`(i^2>n, 0, b(n-i^2, i-1, t+1))+b(n, i-1, t)))
        end:
    a:= n-> b(n, isqrt(n), 0):
    seq(a(n), n=0..100);  # Alois P. Heinz, Sep 25 2022
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[n == 0,
       If[IntegerQ @ Sqrt[t], 1, 0], If[n > i*(i+1)*(2*i+1)/6, 0,
       If[i^2 > n, 0, b[n-i^2, i-1, t+1]] + b[n, i-1, t]]];
    a[n_] := b[n, Floor @ Sqrt[n], 0];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Apr 24 2025, after Alois P. Heinz *)