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

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A124259 Smallest k such that n + n^2 + ... + n^k is not squarefree. 2
 4, 6, 2, 1, 4, 14, 2, 1, 1, 9, 2, 1, 4, 6, 2, 1, 2, 1, 2, 1, 4, 3, 2, 1, 1, 2, 1, 1, 4, 3, 2, 1, 4, 9, 2, 1, 4, 4, 2, 1, 4, 20, 2, 1, 1, 9, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 4, 5, 2, 1, 4, 2, 1, 1, 4, 25, 2, 1, 4, 4, 2, 1, 4, 2, 1, 1, 4, 7, 2, 1, 1, 4, 2, 1, 4, 6, 2, 1, 2, 1, 2, 1, 4, 9, 2, 1, 2, 1, 1, 1, 4, 20, 2, 1 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,1 LINKS Amiram Eldar, Table of n, a(n) for n = 1..1589 FORMULA A124260(n) = Sum_{k=1..a(n)} n^k. a(A013929(n)) = 1. EXAMPLE n=5: 5 = A005117(4), 5 + 5^2 = 30 = 2*3*5 = A005117(19), 5 + 5^2 + 5^3 = 155 = 5*31 = A005117(95), 5 + 5^2 + 5^3 + 5^4 = 780 = (2^2)*3*5*13 not squarefree, therefore a(5) = 4 and A124260(5) = 780. MAPLE A124259 := proc(n) local k ; if n =1 then return 4; end if; for k from 1 do if not numtheory[issqrfree](n*(n^k-1)/(n-1)) then return k; end if end do: end proc: seq(A124259(n), n=1..40) ; # R. J. Mathar, Jan 13 2021 MATHEMATICA a[n_] := Module[{k = 1, s = n}, While[SquareFreeQ[s], k++; s += n^k]; k]; Array[a, 100] (* Amiram Eldar, Dec 26 2020 *) PROG (PARI) a(n) = my(k=1); while (issquarefree(sum(i=1, k, n^i)), k++); k; \\ Michel Marcus, Dec 26 2020 CROSSREFS Cf. A005117, A013929, A124260. Sequence in context: A375366 A373635 A160327 * A214549 A154892 A286155 Adjacent sequences: A124256 A124257 A124258 * A124260 A124261 A124262 KEYWORD nonn AUTHOR Reinhard Zumkeller, Oct 23 2006 EXTENSIONS Data corrected by Amiram Eldar, Dec 26 2020 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.

Last modified September 8 15:42 EDT 2024. Contains 375753 sequences. (Running on oeis4.)