OFFSET
1,1
COMMENTS
Also, composite integers k such that A000108(k) == 2 (mod k).
It seems that the sequence contains all squares of primes and some cubes of odd primes. But it includes other terms as well, including 418 = 2*11*19 and 27173 = 29*937. [edited by Jon E. Schoenfield, Jul 31 2018]
By Wolstenholme's theorem, this sequence does contain all squares of primes and cubes of primes > 3^3, since for primes p > 3 we have binomial(2p^3, p^3) == binomial(2p^2, p^2) == binomial(2p, p) == binomial(2, 1) == 2 (mod p^3). See the link below. - Jianing Song, Aug 01 2018
Note that binomial(2*(n+1), n+1) = binomial(2*n, n) * (4 - 2/(n+1)), which could be used to find terms. - David A. Corneth, Aug 05 2018
Up to a(800) = 30946969, 2001341 = 787 * 2543 is the only further term which, like 418 and 27173, is neither a square nor a cube. - Giovanni Resta, Aug 08 2018
LINKS
Giovanni Resta, Table of n, a(n) for n = 1..1320 (terms < 10^8, first 193 terms from David A. Corneth)
Wikipedia, Wolstenholme's theorem
MAPLE
select(n-> not isprime(n) and modp(binomial(2*n, n), n)=2, [$1..10000]); # Muniru A Asiru, Aug 01 2018
MATHEMATICA
nn=20000; With[{comps=Complement[Range[nn], Prime[Range[PrimePi[nn]]]]}, Select[ comps, Mod[Binomial[2#, #], #]==2&]] (* Harvey P. Dale, May 24 2012 *)
Select[Range@ 20000, CompositeQ@# && Mod[Binomial[2 #, #], #] == 2 &] (* Robert G. Wilson v, Aug 01 2018 *)
PROG
(PARI) forcomposite(c=1, 2e4, if(Mod(binomial(2*c, c), c)==2, print1(c, ", "))) \\ Felix Fröhlich, Jul 30 2018
(PARI) upto(n) = {my(binomp = 2, res = List()); for(t = 2, n, binomp *= (4 - 2/t);
if(!isprime(t) && binomp % t == 2, listput(res, t))); res} \\ David A. Corneth, Aug 05 2018
(GAP) Filtered([1..1000], n->not IsPrime(n) and Binomial(2*n, n) mod n =2); # Muniru A Asiru, Aug 01 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Benoit Cloitre, May 10 2003
EXTENSIONS
More terms from John W. Layman, Jun 09 2004
STATUS
approved