login
Number of odd nonprimes < (2n+1)^2.
3

%I #12 Sep 06 2024 12:31:04

%S 0,1,4,10,19,31,46,65,84,109,136,166,199,236,275,319,364,413,466,521,

%T 578,642,707,776,844,923,996,1079,1168,1254,1342,1436,1535,1636,1740,

%U 1846,1960,2074,2186,2310,2434,2559,2690,2825,2961,3103,3248,3392,3542

%N Number of odd nonprimes < (2n+1)^2.

%D C. R. Christofferson, Unpublished notes, 15219 Wickmere, Houston, TX 77062, (281) 486-4139.

%H Amiram Eldar, <a href="/A037040/b037040.txt">Table of n, a(n) for n = 0..10000</a>

%F a(n) = A038377(n) - 1.

%e The odd nonprimes < 25 are 1, 9, 15 and 21, so a(2) = 4.

%t a[n_] := 2*n^2 + 2*n + 1 - PrimePi[(2*n + 1)^2]; a[0] = 0; Array[a, 61, 0] (* _Amiram Eldar_, Sep 06 2024 *)

%o (PARI) a(n) = if(n == 0, 0, 2*n^2 + 2*n + 1 - primepi((2*n + 1)^2)); \\ _Amiram Eldar_, Sep 06 2024

%Y Cf. A038377.

%K nonn

%O 0,3

%A C. R. Christofferson (magpie56(AT)aol.com)