Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Help pls. Find the first 10 consecutive numbers after the decimal point in e and pi which sum is the prime number

4 visualizaciones (últimos 30 días)
Find the first 10 consecutive numbers after the decimal point in e and pi which sum is the prime number
isprime() checks if number is prime
  3 comentarios
Daniel
Daniel el 13 de Oct. de 2022
Editada: Daniel el 13 de Oct. de 2022
@Matt J idk how to count the sum of digits after decimal
David Hill
David Hill el 13 de Oct. de 2022
Here is some help. Floating point is only good to about 15 digits. Use symbolic if you need pi to more digits.
a=movsum(num2str(floor((pi-3)*10^14))-'0',10,'Endpoints','discard')
a = 1×5
41 48 53 59 63
isprime(a)
ans = 1×5 logical array
1 0 1 1 0

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by