cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A242870 Numbers n such that (n^n-2^2)/(n-2) is an integer.

Original entry on oeis.org

1, 3, 4, 6, 8, 14, 20, 22, 38, 44, 56, 62, 86, 102, 110, 128, 158, 164, 182, 222, 254, 296, 302, 326, 344, 380, 422, 470, 488, 502, 542, 590, 622, 662, 686, 758, 782, 822, 884, 902, 974, 1028, 1094, 1102, 1136, 1262, 1316, 1334, 1406, 1460, 1502, 1622, 1766, 1808
Offset: 1

Views

Author

Derek Orr, May 24 2014

Keywords

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.

Examples

			(4^4-2^2)/(4-2) = 252/2 = 126 is an integer. Thus, 4 is a member of this sequence.
		

Crossrefs

Cf. A242871.

Programs

  • 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 *)
  • PARI
    for(n=1,2500,if(n!=2,s=(n^n-2^2)/(n-2);if(floor(s)==s,print(n))))