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.

A317685 Number of partitions of n into a prime and two positive squares.

Original entry on oeis.org

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

Views

Author

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

Keywords

Comments

As in A025426, the two squares do not need to be distinct.

Examples

			a(7) = 2 counts 7 = 5 + 1^2 + 1^2 = 2 + 1^2 + 2^2.
		

Crossrefs

Programs

  • Maple
    A317685 := proc(n)
        a := 0 ;
        p := 2;
        while p <= n do
            a := a+A025426(n-p);
            p := nextprime(p) ;
        end do:
        a ;
    end proc:
  • Mathematica
    p2sQ[{a_,b_,c_}]:=PrimeQ[a]&&AllTrue[{Sqrt[b],Sqrt[c]},IntegerQ]||PrimeQ[b] && AllTrue[{Sqrt[c],Sqrt[a]},IntegerQ]||PrimeQ[c]&&AllTrue[{Sqrt[b],Sqrt[a]},IntegerQ]; Table[Count[IntegerPartitions[n,{3}],?(p2sQ[#]&)],{n,0,80}] (* _Harvey P. Dale, Mar 10 2023 *)

Formula

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