OFFSET
1,1
COMMENTS
Even though there are no limits to the number of such n, they are not easily found. How frequent are they for (1000)^k and k=1,2,3...? Are the even and odd ones about the equal in number? Do primes occur?
First prime in this sequence is 3364607. - Alois P. Heinz, Oct 08 2011
LINKS
Alois P. Heinz and Donovan Johnson, Table of n, a(n) for n = 1..1000 (first 100 terms from Alois P. Heinz)
EXAMPLE
For n=74004 with sopfr(74004-1) = 43+1721 = 1764 and sopfr(17004+1) = 5+19+19+41 = 84 divide 1764 into 74004+84 to get quotient 42 and divide 84 into 74004+1764 to get quotient 902.
MAPLE
sopfr:= n-> add(i[1]*i[2], i=ifactors(n)[2]):
a:= proc(n) option remember; local k;
for k from 1+ `if`(n=1, 2, a(n-1))
while irem(k+sopfr(k+1), sopfr(k-1))<>0
or irem(k+sopfr(k-1), sopfr(k+1))<>0
do od; k
end:
seq(a(n), n=1..10); # Alois P. Heinz, Oct 08 2011
MATHEMATICA
sopfr[n_] := Total[Times @@@ FactorInteger[n]]; a[n_] := a[n] = Module[{k}, For[k = 1 + If[n == 1, 2, a[n-1]], Mod[k + sopfr[k+1], sopfr[k-1]] != 0 || Mod[k + sopfr[k-1], sopfr[k+1]] != 0, k++]; k]; Table[a[n], {n, 1, 10}] (* Jean-François Alcover, May 29 2015, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn,hard
AUTHOR
J. M. Bergot, Oct 08 2011
STATUS
approved