OFFSET
1,2
COMMENTS
Complement of A229307.
The asymptotic density is in [0.583154, 0.58455].
The numbers k = 1, 2, 6, 42, 1806, 47058, 2214502422, 8490421583559688410706771261086 = A230311 are the only values of k such that the set {n: A031971(k*n) == n (mod k*n)} is nonempty. Its smallest element is n = 1, 1, 1, 1, 1, 5, 5, 39607528021345872635 = A231409. [Comment corrected and expanded by Jonathan Sondow, Dec 10 2013]
Up to (but excluding) the term 68 the exponents of even prime powers with squarefree neighbors. - Juri-Stepan Gerasimov, Apr 30 2016.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
Jose María Grau, A. M. Oller-Marcen, and J. Sondow, On the congruence 1^n + 2^n +... + n^n = d (mod n), where d divides n
MAPLE
a:= proc(n) option remember; local m;
for m from 1+`if`(n=1, 0, a(n-1)) do
if (t-> m=(add(k&^t mod t, k=1..t) mod t))(2*m)
then return m fi
od
end:
seq(a(n), n=1..200); # Alois P. Heinz, May 01 2016
MATHEMATICA
g[n_] := Mod[Sum[PowerMod[i, n, n], {i, n}], n]; Select[Range[100], g[2*#] == # &]
PROG
(PARI) b(n)=sum(k=1, n, Mod(k, n)^n);
for(n=1, 200, if(b(2*n)==n, print1(n, ", ")));
\\ Joerg Arndt, May 01 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
José María Grau Ribas, Sep 21 2013
STATUS
approved