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”).
%I #31 Sep 08 2022 08:46:21
%S 0,0,0,0,0,0,1,0,0,0,0,0,1,1,0,0,0,0,1,0,0,2,0,0,0,1,0,1,0,0,1,0,2,0,
%T 1,0,1,1,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,1,0,0,0,0,1,7,0,0,1,0,1,0,
%U 0,1,0,0,1,1,0,4,7,0,1,0,0,2,0,0,0,1,3,2,0,0,1,0,2,0,4
%N a(n) = (gcd(phi(n), 4*n^2 - 1) - 1)/2, where phi is A000010, Euler's totient function.
%C 2*a(n) + 1 = gcd(phi(2*n), (2*n - 1)*(2*n + 1)).
%C a(A000040(n)) = A099618(n).
%C Records occur at n = 1, 7, 22, 62, 172, 213, 372, 427, 473, ...
%F a(A000040(n)) = A099618(n).
%F a(A002476(n)) = 1.
%F a(A045309(n)) = 0.
%e a(7) = 1 because (gcd(phi(7), 4*7^2 - 1) - 1)/2 = (gcd(6, 195) - 1)/2 = (3 - 1)/2 = 1.
%t Table[(GCD[EulerPhi[n], 4n^2 - 1] - 1)/2, {n, 100}] (* _Alonso del Arte_, May 30 2019 *)
%o (Magma) [(Gcd(EulerPhi(n),4*n^2-1)-1)/2: n in [1..95]];
%o (Python)
%o from fractions import gcd
%o def A000010(n):
%o if n == 1:
%o return 1
%o d, m = 1, 0
%o while d < n:
%o if gcd(d,n) == 1:
%o m = m+1
%o d = d+1
%o return m
%o n = 0
%o while n < 30:
%o n = n+1
%o print(n,(gcd(A000010(n),4*n**2-1)-1)//2) # _A.H.M. Smeets_, Aug 18 2019
%Y Cf. A000010, A000040, A002476, A045309, A099618.
%K nonn
%O 1,22
%A _Juri-Stepan Gerasimov_, May 29 2019