OFFSET
1,3
COMMENTS
The absolute value is relevant only when a(n) = 0 in which case a(n+1) = gcd(a(n),10n+9) = 10n+9.
It is conjectured that for all n, a(n) = 0 implies that a(n+1) = 10n+9 is prime, cf. A186263.
EXAMPLE
a(2) = a(1) - gcd(a(1),10+9) = 1 - 1 = 0.
a(3) = |a(2) - gcd(a(2),10*2+9)| = gcd(0,29) = 29 is prime.
a(4) = 28 and 10*4+9 = 49, thus a(5) = 28 - gcd(28,49) = 28 - 7 = 21. Note that for n = 4+32, 10n+9 = 329 is divisible by 7, but for n = 5+21 = 26, 10n+9 = 269 = a(27) is prime. Also, for n = 27+269 = 296, 10n+9 = 2969 = a(297) is prime again.
PROG
(PARI) print1(a=1); for(n=1, 99, print1(", ", a=abs(a-gcd(a, 10*n+9))))
CROSSREFS
KEYWORD
nonn
AUTHOR
M. F. Hasler, Aug 14 2015
STATUS
approved