OFFSET
1,2
COMMENTS
a(n) is even for all n > 2. 1 and 3 are members of this sequence because (n^n-2^2)/(n-2) becomes (2^2-n^n) and (n^n-2^2), respectively, which are both integers.
Given the term (n^n-k^k)/(n-k) (here, k=2), whenever k = 2^m for some m, there are significantly fewer data values within a given range of numbers. See A242871 for k=3.
These are also numbers n such that (2^n-n^2)/(n-2) is an integer.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
(4^4-2^2)/(4-2) = 252/2 = 126 is an integer. Thus, 4 is a member of this sequence.
MAPLE
filter:= proc(n) (n&^n - 4) mod (n-2) = 0 end proc;
select(filter, [1, $3..1000]); # Robert Israel, May 25 2014
MATHEMATICA
Join[{1}, Select[Range[3, 2000], IntegerQ[(#^#-4)/(#-2)]&]] (* Harvey P. Dale, Apr 24 2016 *)
PROG
(PARI) for(n=1, 2500, if(n!=2, s=(n^n-2^2)/(n-2); if(floor(s)==s, print(n))))
CROSSREFS
KEYWORD
nonn
AUTHOR
Derek Orr, May 24 2014
STATUS
approved