Can you answer my son’s fourth-grade homework question: Which numbers are prime, have digits adding to ten and have a three in the tens place?

My son Horatio (nine years old, fourth grade) came home with some fun math homework exercises today. One of his problems was the following little question:

I am thinking of a number…

  • It is prime.
  • The digits add up to $10.$
  • It has a $3$ in the tens place.

What is my number?

Let us assume that the problem refers to digits in decimal notation. Horatio came up with $37,$ of course, and asked me whether there might be larger solutions with more digits. We observed together that $433$ is another solution, and also $631$ and $1531.$ But also notice that $10333$ solves the problem, based on the list of the first $10000$ primes, and also $100333$, and presumably many others.

My question is: How many solutions does the problem have? In particular, are there infinitely many solutions?

How could one prove or refute such a thing? I could imagine that there are very large prime numbers of the decimal form $10000000000000\cdots00000333$, but don’t know how to prove or refute this.

Can you provide a satisfactory answer this fourth-grade homework question?


As requested I’m posting this an answer. I wrote a short sage script to check the primality of numbers of the form $10^n+333$ where $n$ is in the range $[4,2000]$. I found that the following values of $n$ give rise to prime numbers:


Edit 3: I stopped my laptop’s search between 2000 and 3000, since it hadn’t found anything in 20 minutes. I wrote a quick program to check numbers of the form $10^n+3*10^i+33$. Here are a couple

  • 100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000033
  • 100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300033
  • 100000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000033
  • 100000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000033
  • 100000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000033
  • 10000000000000000000000000000000003000000033
  • 10000000000000000000000000000030000000000033
  • 10000000000000000000000030000000000000000033
  • 10000000003000000000000000000000000000000033

There seemed to be plenty of numbers of this form and presumably I could find more if I checked some of the other possible forms as outlined by dr jimbob.

Note: I revised the post a bit after jimbob pointed out I was actually looking for primes that didn’t quite fit the requirements.

Edit 4: As requested here are the sage scripts I used.
To check if $10^n+333$ was prime:

for n in range(0,500):
    print n

And to check for numbers of the form $10^n+3*10^i+33$:

for n in range(0,500):
  for i in range(2,n):
      print l

Source : Link , Question Author : JDH , Answer Author : JSchlather

Leave a Comment