login
A174214
a(n) = a(n-1)+1, if the previous term a(n-1) and n-1-(-1)^n are coprime, else a(n)=2*n-4.
5
14, 16, 17, 18, 19, 20, 26, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 52, 53, 54, 55, 60, 62, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134
OFFSET
9,1
LINKS
V. Shevelev, Theorems on twin primes-dual case, arXiv:0912.4006 [math.GM], 2009-2014.
MAPLE
A174214 := proc(n) option remember ; if n = 9 then 14 ; elif gcd(procname(n-1), n-1-(-1)^n) = 1 then procname(n-1)+1 ; else 2*n-4 ; end if; end proc:
seq(A174214(n), n=9..100) ; # R. J. Mathar, Mar 16 2010
MATHEMATICA
a[n_] := a[n] = Which[n==9, 14, CoprimeQ[a[n-1], n-1-(-1)^n], a[n-1]+1, True, 2n-4]; Table[a[n], {n, 9, 100}] (* Jean-François Alcover, Feb 02 2016 *)
CROSSREFS
Sequence in context: A351866 A043663 A043703 * A072709 A241178 A158282
KEYWORD
nonn,easy
AUTHOR
Vladimir Shevelev, Mar 12 2010
EXTENSIONS
a(15) corrected and sequence extended by R. J. Mathar, Mar 16 2010
a(15) corrected and a(35)-a(74) added by John W. Layman, Mar 16 2010
STATUS
approved