OFFSET
1,1
LINKS
Jinyuan Wang, Table of n, a(n) for n = 1..100
EXAMPLE
For n=1, prime factors of 385 are 5, 7 and 11. (385 - 1)/(5 + 1) = 384/6 = 64, (385 - 1)/(7 + 1) = 384/8 = 48 and (385 - 1)/(11 + 1) = 384/12 = 32.
For n=2, prime factors of 91 are 7 and 13. (91 - 1)/(7 + 2) = 90/9 = 10 and (91 - 1)/(13 + 2) = 90/15 = 6.
MAPLE
with(numtheory); P:=proc(q) local d, k, n, ok, p;
for k from 1 to q do for n from 2 to q do
if not isprime(n) and issqrfree(n) then p:=ifactors(n)[2]; ok:=1;
for d from 1 to nops(p) do
if not type((n-1)/(p[d][1]+k), integer) then ok:=0; break; fi; od;
if ok=1 then print(n); break; fi; fi; od; od; end: P(10^9);
MATHEMATICA
t = Select[Range[10^6], SquareFreeQ@ # && CompositeQ@ # &]; Table[ SelectFirst[t, Function[k, AllTrue[First /@ FactorInteger@ k, Divisible[k - 1, # + n] &]]], {n, 17}] (* Michael De Vlieger, Jun 24 2016, Version 10 *)
PROG
(PARI) isok(k, n)=if (! issquarefree(k), return (0)); vp = factor(k) [, 1]; if (#vp == 1, return (0)); for (i=1, #vp, if ((k-1) % (n+vp[i]), return (0)); ); 1;
a(n) = my(k=2); while (! isok(k, n), k++); k; \\ Michel Marcus, Jun 28 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Paolo P. Lava, Jun 23 2016
EXTENSIONS
a(18), a(24), a(30) added by Giovanni Resta, Jun 23 2016
More terms from Michel Marcus, Jun 28 2016
STATUS
approved