A262887 Number of ordered ways to write n as x^3 + y^2 + pi(z^2) (x >= 0, y >= 0 and z > 0) with z-1 or z+1 prime, where pi(m) denotes the number of primes not exceeding m.
2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 5, 3, 3, 3, 4, 2, 3, 5, 4, 3, 2, 4, 1, 2, 5, 6, 6, 3, 5, 3, 2, 4, 5, 8, 4, 5, 4, 4, 2, 2, 7, 5, 5, 4, 4, 3, 3, 5, 4, 5, 4, 4, 7, 5, 5, 1, 4, 3, 3, 8, 4, 5, 3, 4, 4, 7, 8, 5, 9, 7, 3, 1, 5, 8, 5, 4, 6, 5, 6, 4, 9, 8, 4, 2, 5, 6, 4, 4, 7, 8, 3, 9, 5, 5, 2, 6, 5, 4, 6
Offset: 1
Keywords
Examples
a(22) = 2 since 22 = 0^3 + 4^2 + pi(4^2) = 0^3 + 2^2 + pi(8^2) with 4+1 = 5 and 8-1 = 7 both prime. a(24) = 1 since 24 = 2^3 + 4^2 + pi(1^2) with 1+1 = 2 prime. a(40) = 2 since 40 = 0^3 + 6^2 + pi(3^2) = 3^3 + 3^2 + pi(3^2) with 3-1 = 2 prime. a(57) = 1 since 57 = 2^3 + 7^2 + pi(1^2) with 1+1 = 2 prime. a(73) = 1 since 73 = 4^3 + 3^2 + pi(1^2) with 1+1 = 2 prime.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
SQ[n_]:=IntegerQ[Sqrt[n]] f[n_]:=PrimePi[n^2] Do[r=0;Do[If[f[k]>n,Goto[aa]];If[PrimeQ[k-1]==False&&PrimeQ[k+1]==False,Goto[bb]];Do[If[SQ[n-f[k]-x^3],r=r+1],{x,0,(n-f[k])^(1/3)}];Label[bb];Continue,{k,1,n}];Label[aa];Print[n," ",r];Continue, {n,1,100}]
Comments