login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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 (list; graph; refs; listen; history; text; internal format)
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
Sequence in context: A103643 A079892 A096014 * A117217 A260930 A161331
KEYWORD
nonn,nice
AUTHOR
Reinhard Zumkeller, Jun 10 2002
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 09:23 EDT 2024. Contains 371967 sequences. (Running on oeis4.)