OFFSET
1,1
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..100
EXAMPLE
Prime factors of 35 are 5, 7 and 35^2-1 = 1224, 1124/4 = 306, 1124/6 = 204, 1124/8 = 153.
Prime factors of 1189 are 29, 41 and 1189^2-1 = 1413720, 1413720/28 = 50490, 1413720/30 = 47124, 1413720/40 = 35343, 1413720/42 = 33660.
MAPLE
with(numtheory): P:=proc(q) local a, k, ok, n; for n from 2 to q do
if not isprime(n) and issqrfree(n) then a:=factorset(n); ok:=1;
for k from 1 to nops(a) do if frac((n^2-1)/(a[k]+1))>0 or frac((n^2-1)/(a[k]-1))>0 then ok:=0; break; fi; od; if ok=1 then print(n); fi; fi; od; end: P(10^9);
MATHEMATICA
csfQ[n_]:=CompositeQ[n]&&SquareFreeQ[n]&&Union[Mod[n^2-1, Flatten[{#+1, #-1}&/@ FactorInteger[n][[All, 1]]]]]=={0}; Select[Range[35*10^6], csfQ] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Apr 07 2020 *)
PROG
(PARI) isok(n) = {if (issquarefree(n) && !isprime(n) && (n>1), my(f = factor(n)[, 1], x = n^2-1); for (k=1, #f, if ((x % (f[k]-1)) || (x % (f[k]+1)), return (0)); ); return (1); ); return (0); } \\ Michel Marcus, Mar 12 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Paolo P. Lava, Mar 05 2019
EXTENSIONS
More terms from Giovanni Resta, Mar 06 2019
STATUS
approved