

A053670


Least number coprime to n and n+1.


14



3, 5, 5, 3, 7, 5, 3, 5, 7, 3, 5, 5, 3, 11, 7, 3, 5, 5, 3, 11, 5, 3, 5, 7, 3, 5, 5, 3, 7, 7, 3, 5, 5, 3, 11, 5, 3, 5, 7, 3, 5, 5, 3, 7, 7, 3, 5, 5, 3, 7, 5, 3, 5, 7, 3, 5, 5, 3, 7, 7, 3, 5, 5, 3, 7, 5, 3, 5, 11, 3, 5, 5, 3, 7, 7, 3, 5, 5, 3, 7, 5, 3, 5, 11, 3, 5, 5, 3, 7, 11, 3, 5, 5, 3, 7, 5, 3, 5, 7, 3, 5
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,1


COMMENTS



LINKS



MATHEMATICA

a[n_] := For[k = 3, True, k++, If[CoprimeQ[k, n, n+1], Return[k]]]; Table[a[n], {n, 1, 101}] (* JeanFrançois Alcover, Sep 20 2012 *)


PROG

(Haskell)
a053670 n = head [x  x < [3, 5 ..],
n `gcd` x == 1, (n + 1) `gcd` x == 1]
(Python)
from math import gcd
def a(n):
k, m = 3, n*(n+1)
while gcd(k, m) != 1: k += 2
return k


CROSSREFS



KEYWORD

nonn,nice,easy


AUTHOR



EXTENSIONS

More terms from Andrew Gacek (andrew(AT)dgi.net), Feb 21 2000 and James A. Sellers, Feb 22 2000


STATUS

approved



