cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A276052 Least k > 1 such that phi(k*n-1) = phi(k*n+1), or -1 if no such k exists.

This page as a plain text file.
%I A276052 #17 Oct 06 2020 02:35:12
%S A276052 5,4,3,2,15,106,21,127,3,39282,3,53,135,65014,5,9489,171,361,27,19641,
%T A276052 7,13133,141,6326,3,6978,19,32507,375,13094,165,93186,19,1359,9,12588,
%U A276052 15,171,45,35253,3,35794,9,16796,7,1689,69,3163,3,13653,57,3489,12,249,45,58497,9
%N A276052 Least k > 1 such that phi(k*n-1) = phi(k*n+1), or -1 if no such k exists.
%C A276052 Least k > 1 such that k*n is in A066812. - _Robert Israel_, Aug 30 2016
%e A276052 a(5) = 15 because phi(15*5-1) = phi(15*5+1).
%p A276052 f:= proc(n) local k;
%p A276052    for k from 2 do if numtheory:-phi(k*n-1) = numtheory:-phi(k*n+1) then
%p A276052       return k
%p A276052    fi od end proc:
%p A276052 map(f, [$1..60]); # _Robert Israel_, Aug 30 2016
%t A276052 kmax = 10^9;
%t A276052 a[n_] := Module[{k}, For[k = 2, k <= kmax, k++, If[EulerPhi[k n - 1] == EulerPhi[k n + 1] , Print[n, " ", k]; Return[k]]]; -1];
%t A276052 Array[a, 60] (* _Jean-François Alcover_, Oct 06 2020 *)
%o A276052 (PARI) a(n) = {my(k = 2); while (eulerphi(k*n+1) != eulerphi(k*n-1), k++); k; }
%Y A276052 Cf. A000010, A066812, A275412.
%K A276052 nonn
%O A276052 1,1
%A A276052 _Altug Alkan_, Aug 17 2016
%E A276052 Name corrected by _Robert Israel_, Aug 30 2016