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.
%I A001838 M2397 N0951 #52 Sep 24 2023 00:04:49 %S A001838 3,5,6,11,12,14,17,18,20,29,41,44,59,62,71,92,101,107,116,137,149,164, %T A001838 179,191,197,212,227,239,254,269,281,311,332,347,356,419,431,452,461, %U A001838 521,524,569,599,617,641,659,692,716,764,809,821,827,857,881,932,956 %N A001838 Numbers k such that phi(k+2) = phi(k) + 2. %C A001838 If p and p+2 are primes then p is a solution. If p and 2p+1 are both odd primes then 4p is a solution. Several numbers of the form 2^j-2 are solutions (see cross-referenced sequences). Although 18 is a solution, it is not of any of these forms. %C A001838 Twice Mersenne primes (cf. A000668) are also solutions. - _Vladeta Jovovic_, Feb 14 2002 %D A001838 M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 840. %D A001838 D. M. Burton, Elementary Number Theory, section 7-2. %D A001838 N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence as N0951, although there are errors, probably caused by errors in the original source). %D A001838 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). %H A001838 T. D. Noe, <a href="/A001838/b001838.txt">Table of n, a(n) for n = 1..10000</a> %H A001838 M. Abramowitz and I. A. Stegun, eds., <a href="http://www.convertit.com/Go/ConvertIt/Reference/AMS55.ASP">Handbook of Mathematical Functions</a>, National Bureau of Standards, Applied Math. Series 55, Tenth Printing, 1972 [alternative scanned copy]. %H A001838 S. W. Graham, J. J. Holt, and C. Pomerance, <a href="https://math.dartmouth.edu/~carlp/phi.pdf">On the solutions to phi(n) = phi(n+k)</a>, Number Theory in Progress, K. Gyory, H. Iwaniec, and J. Urbanowicz, eds., vol. 2, de Gruyter, Berlin and New York, 1999, pp. 867-882. %H A001838 L. Moser, <a href="http://www.jstor.org/stable/2305815">Some equations involving Euler's totient function</a>, Amer. Math. Monthly, 56 (1949), 22-23. %e A001838 phi(18+2) = 8 = phi(18) + 2, so 18 is in the sequence. %t A001838 Select[Range@1000, EulerPhi@(# + 2)== EulerPhi[#] + 2 &] (* _Vincenzo Librandi_, Sep 11 2015 *) %t A001838 Position[Partition[EulerPhi[Range[1000]],3,1],_?(#[[1]]+2 == #[[3]]&), 1, Heads->False]//Flatten (* _Harvey P. Dale_, Oct 04 2017 *) %o A001838 (Haskell) %o A001838 import Data.List (elemIndices) %o A001838 a001838 n = a001838_list !! (n-1) %o A001838 a001838_list = map (+ 1) $ elemIndices 2 $ %o A001838 zipWith (-) (drop 2 a000010_list) a000010_list %o A001838 -- _Reinhard Zumkeller_, Feb 21 2012 %o A001838 (PARI) isok(n) = eulerphi(n+2) == eulerphi(n) + 2; \\ _Michel Marcus_, Sep 11 2015 %o A001838 (Magma) [n: n in [1..1000] | EulerPhi(n+2) eq EulerPhi(n)+2]; // _Vincenzo Librandi_, Sep 11 2015 %Y A001838 Cf. A050472, A050473, etc. Essentially the same as A056853. %K A001838 nonn,nice %O A001838 1,1 %A A001838 _N. J. A. Sloane_ %E A001838 More terms from _Jud McCranie_, Dec 24 1999