login
A071888
a(1)=2 and for n>1 a(n) = least squarefree m > n with gcd(m,n)>1.
6
2, 6, 6, 6, 10, 10, 14, 10, 15, 14, 22, 14, 26, 21, 21, 22, 34, 21, 38, 22, 30, 26, 46, 26, 30, 30, 30, 30, 58, 33, 62, 34, 39, 38, 42, 38, 74, 42, 42, 42, 82, 46, 86, 46, 51, 58, 94, 51, 70, 55, 57, 58, 106, 57, 65, 58, 66, 62, 118, 62, 122, 66, 66, 66
OFFSET
1,1
COMMENTS
A071889(n)=gcd(a(n),n); A071890(n)=a(n)-n;
For n>2: n is prime iff a(n)=n*2.
LINKS
MATHEMATICA
a[1] = 2; a[n_] := a[n] = (m = n+1; While[ !(SquareFreeQ[m] && GCD[m, n] > 1), m++]; m); Table[a[n], {n, 1, 64}] (* Jean-François Alcover, Feb 15 2012 *)
PROG
(Haskell)
a071888 1 = 2
a071888 n = head [m | m <- dropWhile (<= n) a005117_list, gcd m n > 1]
-- Reinhard Zumkeller, Jun 10 2012
(PARI) a(n)=if(n<2, return(2)); my(m=n+1); while(gcd(m++, n)==1 || !issquarefree(m), ); m \\ Charles R Greathouse IV, May 29 2014
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
Reinhard Zumkeller, Jun 10 2002
STATUS
approved