|
|
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
|
|
|
FORMULA
|
|
|
EXAMPLE
|
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
|
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:
|
|
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
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|