number of partitions of n into a non-zero square and a prime or 1

Santi Spadaro spados at
Wed Sep 5 18:58:02 CEST 2001

Someone can say something not trivial about the following?

Sequence:  0,1,1,1,1,2,1,1,1,1,2,2,0,2,1,1,2,2,1,2,2,1,2,1,0,2,3,2,1,2,
Name:      Number of ways n can be expressed as the sum of a nonzero 
square and 1 or a
Formula:   Note that a(k^2)=0 or 1 since each prime can be written 
only in one way as a
               difference of squares: (n+b)^2-n^2=p where p is a prime, only if
               b^2+2nb=b(b+2n) is prime, only if b=1. In that case 
p=2n+1; since every
               prime is an odd number we get an 1 in the distribution 
of a(k^2) for each
               odd number which is prime.
Mma:       a[n_]:=Length[Select[n-Range[1,Floor[Sqrt[n]]]^2,#==1||PrimeQ[
               # ]&]]
Keywords:  nonn
Offset:    1
Author(s): Santi Spadaro (spados at, Jul 20 2001
Extension: Corrected and extended by Dean Hickerson, Jul 26, 2001

Note that if we substitute "non-zero square" with "non-zero 
triangular number", it is easy to show that a[T(n)]=0 or 1 following 
the same pattern

Santi Spadaro

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the SeqFan mailing list