OFFSET
1,3
COMMENTS
It is conjectured that for all n > 2, a(n) = 0 implies that 7n+6 = a(n+1) is prime, cf. A186259. (This is the sequence {u(n)} mentioned there.)
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
a(2) = a(1) - gcd(a(1),7+6) = 1 - 1 = 0.
a(3) = |a(2) - gcd(a(2),7*2+6)| = gcd(0,17) = 17 is prime.
a(33) = 158, thus a(6) = 158 - gcd(158,7*33+6) = 158 - 79 = 79.
MATHEMATICA
nxt[{n_, a_}]:={n+1, Abs[a-GCD[a, 7n+6]]}; NestList[nxt, {1, 1}, 80][[All, 2]] (* Harvey P. Dale, Apr 26 2017 *)
PROG
(PARI) print1(a=1); for(n=1, 99, print1(", ", a=abs(a-gcd(a, 7*n+6))))
CROSSREFS
KEYWORD
nonn
AUTHOR
M. F. Hasler, Aug 14 2015
STATUS
approved