login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) = pi(n) * pi(n+1), where pi(n) is the number of primes <= n.
1

%I #25 Apr 28 2023 14:14:11

%S 0,2,4,6,9,12,16,16,16,20,25,30,36,36,36,42,49,56,64,64,64,72,81,81,

%T 81,81,81,90,100,110,121,121,121,121,121,132,144,144,144,156,169,182,

%U 196,196,196,210,225,225,225,225,225,240,256,256,256,256,256,272

%N a(n) = pi(n) * pi(n+1), where pi(n) is the number of primes <= n.

%C For n>1, a(n) is a perfect square (A000290) if and only if pi(n) = pi(n+1) [i.e., when n+1 is composite], and is a pronic number (A002378) when pi(n) < pi(n+1) [when n+1 is prime].

%H Antti Karttunen, <a href="/A256956/b256956.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = A000720(n) * A000720(n+1).

%e a(5) = 9; pi(5) * pi(6) = 3 * 3 = 9.

%e a(6) = 12; pi(6) * pi(7) = 3 * 4 = 12.

%p with(numtheory): A256956:=n->pi(n)*pi(n+1): seq(A256956(n), n=1..100);

%t Table[PrimePi[n]*PrimePi[n + 1], {n, 100}]

%o (PARI) vector(100,n,primepi(n)*primepi(n+1)) \\ _Derek Orr_, Apr 13 2015

%o (Magma) [ #PrimesUpTo(n) * #PrimesUpTo(n+1): n in [1..80] ]; // _Vincenzo Librandi_, Apr 14 2015

%o (Scheme) (define (A256956 n) (* (A000720 n) (A000720 (+ 1 n)))) ;; _Antti Karttunen_, Apr 18 2015

%Y Cf. A000290, A000720, A002378.

%K nonn,easy

%O 1,2

%A _Wesley Ivan Hurt_, Apr 13 2015

%E Comment clarified by _Antti Karttunen_, Apr 18 2015