OFFSET
1,2
COMMENTS
Numbers n such that a(n) = n are 2, 3, 5, 6, 7, 10, 11, 13, 14, 15, 17, 19, 21, 22, 23, 26, 29, 30, 31, 33, 34, 35, 37, 38, 39, 41, 42, 43, 46, 47, 51, 53, 55, 57, 58, 59, 61, 62, 65, 66, 67, 69, 70, ... (A144338). - Altug Alkan, Sep 30 2016
For n > 1, a(n) = A007947(n) * k for some k. Mostly, k = 1. - David A. Corneth, Sep 30 2016
LINKS
Altug Alkan, Table of n, a(n) for n = 1..10000
MATHEMATICA
a[1] = 0; a[n_] := For[m = 2, True, m++, If[PowerMod[m, m, n] == 0, Return[m]]]; Array[a, 100] (* Jean-François Alcover, Sep 30 2016 *)
PROG
(PARI) a(n)={my(f=factor(n)[, 1], p=prod(i=1, #f, f[i]), i=1); if(n==1, return(0)); while(1, if(Mod(p*i, n)^(p*i)==0, return(p*i) , i++))} \\ David A. Corneth, Sep 30 2016
(PARI) a(n)=if(n<=1, return(0)); for(m=2, n, if(Mod(m, n)^m==0, return(m))); \\ Joerg Arndt, Oct 01 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
D. Muller (Research37(AT)aol.com)
STATUS
approved