Define which returns the sum of digits of a number.
Find the smallest pair of consecutive primes and which such that . Enter your answer as .
Details and Assumptions :
Consecutive prime numbers refers to a sequence of two prime numbers which don't have any prime number between them. For example: 2 and 3 are consecutive primes, 37 and 41 are consecutive primes.
As an explicit example: because . So 37 and 41 are not such numbers.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Primes takes n and returns array with prime values less than n, so for this case I used primes(1000) and set it as p which I then added consecutive primes when I found them with summm(number) which was function for sum of digits of number. Lol explanation almost longer than code.