OFFSET
1,2
COMMENTS
For n>1, a(n) is even. Alternatively, the even terms of this sequence can be characterized in any of the following ways: (i) even integers n such that n*B(n) == n/2 (mod n), where B(n) is the n-th Bernulli number; OR (ii) integers n such that gcd(n,A027642(n)) = 2; OR (iii) even integers n such that (p-1) does not divide n for every odd prime p dividing n (cf. A124240). - Max Alekseyev, Sep 05 2013
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
MATHEMATICA
Join[{1}, Select[Range[200], Mod[Sum[PowerMod[k, #, #], {k, #}], #] == #/2 &]] (* T. D. Noe, Sep 04 2013 *)
PROG
(PARI) is(n)=if(n%2, return(n==1)); my(f=factor(n)[, 1]); for(i=2, #f, if(n%(f[i]-1)==0, return(0))); 1 \\ Charles R Greathouse IV, Sep 04 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
José María Grau Ribas, Jun 20 2013
STATUS
approved