$args numberposts variable

Yes, there is no way to get screen size with PHP, because it runs on server, while the screen is something related to client (browser).

However, in OP you say:

for a desktop visitor I show 10 posts and for a mobile visitor I show 3 posts

and even if you can’t get the screen size, you can understand if the request comes from a mobile device, thanks to wp_is_mobile():

$number = 10;
if (wp_is_mobile()) {
  $number = 3;
}
$args = array( 'numberposts' => $number, 'post_type' => 'newposttype');
$recent_posts = wp_get_recent_posts( $args );

There are PHP libraries like Mobile Detect that gives you more control, e.g. you can differentiate tablets form phones.

So if post number choice may depend on device being mobile / non-mobile, than it can be easily done as explained above, if the choice must depend on real screen width than the only solution is AJAX.

Search this site (start here) to find guidance on how to get posts using AJAX.