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.

A281947 Smallest prime p such that p^i - 1 is a totient (A002202) for all i = 1 to n, or 0 if no such p exists.

This page as a plain text file.
%I A281947 #17 Feb 09 2017 12:00:43
%S A281947 2,3,7,7,37,37,113,113,241,241,241,241,241,241,241,241,241,241,2113,
%T A281947 2113,2113,2113,2113,2113,3121,3121,3121,3121
%N A281947 Smallest prime p such that p^i - 1 is a totient (A002202) for all i = 1 to n, or 0 if no such p exists.
%C A281947 p - 1 = phi(p) is a totient for all primes p.
%C A281947 If A281909(n) is prime, then a(n) = A281909(n).
%e A281947 a(3) = 7 because 7^2 - 1 = 48, 7^3 - 1 = 342 are both totient numbers (A002202) and 7 is the least prime number with this property.
%o A281947 (PARI) isok(p, n)=for (i=1, n, if (! istotient(p^i-1), return(0));); 1;
%o A281947 a(n) = {my(p=2); while (! isok(p, n), p = nextprime(p+1)); p;} \\ _Michel Marcus_, Feb 04 2017
%Y A281947 Cf. A000010, A002202, A181062, A281909.
%K A281947 nonn,more
%O A281947 1,1
%A A281947 _Altug Alkan_, Feb 03 2017
%E A281947 a(19) from _Michel Marcus_, Feb 04 2017
%E A281947 a(20)-a(28) from _Ray Chandler_, Feb 08 2017