A254576 Primes p such that phi(p-2) divides p-1 where phi is Euler's totient function (A000010).
3, 5, 17, 257, 65537, 83623937
Offset: 1
Programs
-
Magma
[n: n in [3..10000000] | IsPrime(n) and (n-1) mod EulerPhi(n-2) eq 0];
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.
[n: n in [3..10000000] | IsPrime(n) and (n-1) mod EulerPhi(n-2) eq 0];
Aliquot parts of 77 are 1, 7, 11 and 78/(1+7+11) = 76/19 = 4.
with(numtheory): P:=proc(n) if not isprime(n) and frac((n-1)/(sigma(n)-n))=0 then n; fi; end: seq(P(i),i=2..6241);
q[k_] := !PrimeQ[k] && Divisible[k-1, DivisorSigma[1, k]-k]; Select[Range[2, 6500], q] (* Amiram Eldar, Jul 26 2025 *)
isok(n) = (n!=1) && !isprime(n) && !frac((n-1)/(sigma(n)-n)); \\ Michel Marcus, Feb 28 2019
phi(15)=8 and 15^15 == -1 (mod 8), so 15 is in the sequence.
v={};Do[If[PowerMod[n,n,EulerPhi[n]]==EulerPhi[n]-1,AppendTo[v,n]; Print[v]],{n,200000000}]
Select[Range[50000000],Divisible[#+2,EulerPhi[#]]&]
Select[Range[10000000], !PrimeQ[#/6] && IntegerQ[(# + 3)/(EulerPhi[#] + 3)] &]
for(n=1,10^8, if( (n+3)%(eulerphi(n)+3)==0 && (n%6 || !isprime(n\6)), print(n)));
2 is a term since {phi(d) : d|2} = {1} = {d; d|2, d<2}. 15 is a term since {phi(d) : d|15} = {1, 2, 4, 8} = {d : d|16, d<16}.
[n: n in [1..100000] | Set([EulerPhi(d): d in Divisors(n)]) eq Set([d: d in Divisors(n+1) | d lt n+1 ])]
isok(n) = {sphi = []; fordiv(n, d, sphi = Set(concat(sphi, eulerphi(d)))); sphi == setminus(Set(divisors(n+1)), Set(n+1));} \\ Michel Marcus, Nov 23 2014
17 is in this sequence because 17 = tau(17)*phi(15) + 1 = 2*8 + 1.
[n: n in [3..1000000] | n eq NumberOfDivisors(n) * EulerPhi(n-2) + 1];
Select[Range@ 100000, # == DivisorSigma[0, #] EulerPhi[# - 2] + 1 &] (* Michael De Vlieger, Oct 27 2015 *)
for(n=3, 1e8, if(numdiv(n)*eulerphi(n-2) == n-1, print1(n ", "))) \\ Altug Alkan, Oct 28 2015
lista(na, nb) = {my(f1 = factor(na-2), f2 = factor(na-1), f3); for(n=na, nb, f3 = factor(n); if (numdiv(f3)*eulerphi(f1) == n-1, print1(n ", ")); f1 = f2; f2 = f3;);}; \\ Michel Marcus, Feb 21 2020
Aliquot parts of 21 are 1, 3, 7 and 22/(1+3+7) = 22/11 = 2.
with(numtheory): P:=proc(n) if not isprime(n) and frac((n+1)/(sigma(n)-n))=0 then n; fi; end: seq(P(i),i=2..100000);
Select[Range[10^6],CompositeQ[#]&&Mod[#+1,Total[Most[Divisors[#]]]]==0&] (* Harvey P. Dale, Jul 28 2024 *)
isok(n) = (n!=1) && !isprime(n) && !frac((n+1)/(sigma(n)-n)); \\ Michel Marcus, Feb 28 2019
Comments