A304291 Composite numbers k such that for all primes p dividing k, p-1 divides k-1 and p+1 divides k+1.
8, 27, 32, 125, 128, 243, 343, 512, 1331, 2048, 2187, 2197, 3125, 4913, 6859, 8192, 12167, 16807, 19683, 24389, 29791, 32768, 50653, 68921, 74431, 78125, 79507, 103823, 131072, 148877, 161051, 177147, 205379, 226981, 300763, 357911, 371293, 389017, 493039, 524288
Offset: 1
Keywords
Examples
Prime factors of 74431 are 7 and 31 and (74431-1)/(7-1) = 12405, (74431-1)/(31-1) = 2481, (74431+1)/(7+1) = 9304, (74431+1)/(31+1) = 2326.
Links
- Giovanni Resta, Table of n, a(n) for n = 1..1000 (first 192 terms from Robert Israel)
Programs
-
Magma
sol:=[]; m:=1; p:=[]; for u in [1..600000] do if not IsPrime(u) then p:=PrimeDivisors(u); s:=0; for i in [1..#p] do if IsIntegral((u-1)/(p[i]-1)) and IsIntegral((u+1)/(p[i]+1)) then s:=s+1; end if; if s eq #p then sol[m]:=u; m:=m+1; end if; end for; end if; end for; sol; // Marius A. Burtea, May 16 2019
-
Maple
with(numtheory): P:=proc(q) local a,b,k,n,ok; for n from 2 to q do if not isprime(n) then a:=factorset(n); ok:=1; for k from 1 to nops(a) do if frac((n-1)/(a[k]-1))>0 or frac((n+1)/(a[k]+1))>0 then ok:=0; break; fi; od; if ok=1 then print(n); fi; fi; od; end: P(10^6);
-
Mathematica
Select[Range[4, 2^19], Function[k, And[CompositeQ@ k, AllTrue[FactorInteger[k][[All, 1]], And[Mod[k - 1, # - 1] == 0, Mod[k + 1, # + 1] == 0] &]]]] (* Michael De Vlieger, May 22 2018 *)
-
PARI
lista(nn) = {forcomposite(c=1, nn, my(f = factor(c)); ok = 1; for (k=1, #f~, my(p = f[k,1]); if (((c-1) % (p-1)) || ((c+1) % (p+1)), ok = 0; break);); if (ok, print1(c, ", ")););} \\ Michel Marcus, May 19 2018
Comments