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.

A317682 Number of partitions of n into a prime and two distinct squares.

Original entry on oeis.org

0, 0, 0, 1, 1, 0, 2, 2, 2, 1, 1, 2, 4, 1, 2, 3, 3, 2, 4, 2, 4, 3, 4, 4, 4, 1, 2, 6, 6, 3, 5, 3, 6, 5, 3, 2, 7, 3, 5, 7, 4, 4, 8, 5, 6, 5, 5, 7, 9, 3, 4, 6, 7, 6, 9, 5, 8, 9, 6, 4, 9, 3, 6, 11, 6, 5, 10, 7, 10, 8, 8, 8, 12, 5, 5, 8, 10, 9, 11, 6, 7
Offset: 0

Views

Author

R. J. Mathar, Michel Marcus, Aug 04 2018

Keywords

Comments

As in A025435, zero is a valid square here.

Examples

			a(12)=4 counts 12 = 11 + 0^2 + 1^2 = 3 + 0^2 + 3^2 = 7 + 1^2 + 2^2 = 2 + 1^2 + 3^2.
		

Crossrefs

Programs

  • Maple
    A317682 := proc(n)
        a := 0 ;
        p := 2;
        while p < n do
            a := a+A025435(n-p);
            p := nextprime(p) ;
        end do:
        a ;
    end proc:
  • Mathematica
    A025435[n_] := Length[ PowersRepresentations[n, 2, 2]] - Boole[ IntegerQ[ Sqrt[2n]]];
    a[n_] := Module[{s = 0, p}, For[p = 2, p <= n-1, p = NextPrime[p], s += A025435[n-p]]; s];
    a /@ Range[0, 100] (* Jean-François Alcover, Apr 07 2020 *)
  • PARI
    A317682(n,s=0)={forprime(p=2,n-1,s+=A025435(n-p));s} \\ M. F. Hasler, Aug 05 2018

Formula

a(n) = Sum_{primes p} A025435(n-p).