Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Number of cuban primes < 10^(n/2).
0

%I #14 Jan 14 2020 22:16:07

%S 0,0,1,2,4,6,11,17,28,42,64,105,173,267,438,726,1200,2015,3325,5524,

%T 9289,15659,26494,44946,76483,129930,221530,377856,645685,1105802,

%U 1895983,3254036,5593440,9625882,16578830,28590987,49347768,85253634

%N Number of cuban primes < 10^(n/2).

%C A cuban prime has the form (x+1)^3 - x^3, which equals 3x*(x+1) + 1 (A002407).

%F a(2*n) = A113478(n). - _Andrew Howroyd_, Jan 14 2020

%e As the smallest cuban primes equal to the difference of two consecutive cubes p = (x+1)^3 - x^3, is 7 for x = 1, and as floor (10^(1/2)) = 3, a(0) = a(1) = 0 and a(2) = 1.

%t cnt = 0; nxt = 1; t = {0}; Do[p = 3*k*(k + 1) + 1; If[p > nxt, AppendTo[t, cnt]; nxt = nxt*Sqrt[10]]; If[PrimeQ[p], cnt++], {k, 100000}]; t (* _T. D. Noe_, Jan 29 2013 *)

%o (PARI)

%o b(n)={my(s=0,k=0,t=1); while(t<=n, s+=isprime(t); k++; t += 6*k); s}

%o a(n)={b(sqrtint(10^n))} \\ _Andrew Howroyd_, Jan 14 2020

%Y Cf. A002407, A113478, A221794.

%K nonn

%O 0,4

%A _Vladimir Pletser_, Jan 26 2013

%E a(31)-a(37) from _Andrew Howroyd_, Jan 14 2020