login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

1 together with even numbers n >= 2 such that 1^n + 2^n + 3^n + ... + n^n == n/2 (mod n).
4

%I #49 Sep 06 2013 12:22:05

%S 1,2,4,8,10,14,16,22,26,28,32,34,38,44,46,50,52,56,58,62,64,68,70,74,

%T 76,82,86,88,92,94,98,104,106,112,116,118,122,124,128,130,134,136,142,

%U 146,148,152,154,158,164,166,170,172,176,178,182,184,188,190,194,196

%N 1 together with even numbers n >= 2 such that 1^n + 2^n + 3^n + ... + n^n == n/2 (mod n).

%C 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

%H Charles R Greathouse IV, <a href="/A226872/b226872.txt">Table of n, a(n) for n = 1..10000</a>

%t Join[{1}, Select[Range[200], Mod[Sum[PowerMod[k, #, #], {k, #}], #] == #/2 &]] (* _T. D. Noe_, Sep 04 2013 *)

%o (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

%Y Cf. A014117, A031971, A228869, A228870.

%K nonn

%O 1,2

%A _José María Grau Ribas_, Jun 20 2013