A232353 Number of ways to write n = k + m with k > 0 and m > 0 such that p = prime(k) + phi(m) and p*(p+1) - prime(p) are both prime, where phi(.) is Euler's totient function.
0, 1, 1, 0, 1, 1, 0, 1, 1, 2, 1, 2, 2, 1, 1, 2, 4, 3, 2, 6, 3, 4, 4, 5, 5, 3, 4, 2, 6, 5, 4, 6, 5, 4, 6, 7, 1, 6, 4, 8, 6, 6, 7, 4, 5, 10, 5, 3, 4, 6, 7, 6, 6, 9, 6, 3, 7, 7, 10, 5, 9, 7, 7, 6, 5, 8, 9, 4, 6, 9, 8, 5, 8, 5, 8, 8, 5, 6, 7, 9, 10, 8, 8, 8, 11, 10, 11, 7, 8, 13, 9, 6, 12, 10, 5, 9, 7, 8, 14, 8
Offset: 1
Keywords
Examples
a(14) = 1 since 14 = 4 + 10 with prime(4) + phi(10) = 11 and 11*12 - prime(11) = 101 both prime. a(15) = 1 since 15 = 6 + 9 with prime(6) + phi(9) = 19 and 19*20 - prime(19) = 313 both prime. a(37) = 1 since 37 = 23 + 14 with prime(23) + phi(14) = 89 and 89*90 - prime(89) = 7549 both prime.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..5000
Programs
-
Mathematica
PQ[n_]:=PrimeQ[n]&&PrimeQ[n(n+1)-Prime[n]] f[n_,k_]:=Prime[k]+EulerPhi[n-k] a[n_]:=Sum[If[PQ[f[n,k]],1,0],{k,1,n-1}] Table[a[n],{n,1,100}]
Comments