A236567 a(n) = |{0 < k < n - 2: k + phi(n-k)/2 is a square}|, where phi(.) is Euler's totient function.
0, 0, 0, 0, 0, 1, 2, 1, 1, 2, 1, 3, 1, 2, 4, 1, 1, 2, 4, 3, 2, 3, 1, 3, 2, 3, 3, 4, 3, 1, 8, 3, 3, 2, 4, 4, 2, 2, 5, 6, 4, 6, 3, 2, 5, 4, 4, 5, 4, 1, 8, 6, 3, 3, 5, 6, 3, 4, 5, 9, 5, 2, 3, 6, 6, 5, 4, 4, 6, 8, 6, 8, 4, 3, 5, 8, 4, 1, 6, 6, 6, 3, 9, 8, 5, 4, 6, 7, 7, 6, 7, 5, 6, 8, 3, 10, 5, 5, 5, 4
Offset: 1
Keywords
Examples
a(8) = 1 since 1 + phi(7)/2 = 1 + 3 = 2^2. a(11) = 1 since 8 + phi(3)/2 = 8 + 1 = 3^2. a(78) = 1 since 40 + phi(38)/2 = 40 + 9 = 7^2.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
SQ[n_]:=IntegerQ[Sqrt[n]] p[n_,k_]:=SQ[k+EulerPhi[n-k]/2] a[n_]:=Sum[If[p[n,k],1,0],{k,1,n-3}] Table[a[n],{n,1,100}]
Comments