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.

A053662 Numbers k such that 2k+1 divides k!+1.

Original entry on oeis.org

3, 5, 9, 21, 23, 33, 39, 51, 63, 65, 81, 89, 95, 99, 113, 131, 173, 183, 191, 209, 215, 221, 239, 245, 251, 261, 281, 285, 299, 303, 309, 315, 341, 345, 363, 369, 371, 393, 411, 419, 431, 443, 473, 495, 509, 525, 543, 545, 561, 575, 593, 645, 659, 683, 711
Offset: 1

Views

Author

Chris K. Caldwell, Feb 16 2000

Keywords

Comments

k+1 divides k!+1 gives primes-1 by Wilson's Theorem. For the present sequence, there are 309 terms below 5000, compared with 669 primes (309/669 = 0.461...). There are 553 terms below 10000, compared with 1229 primes (553/1229 = 0.449...). - Ed Pegg Jr, Dec 05 2001

Crossrefs

Programs

  • GAP
    Filtered([1..1000], n-> (Factorial(n)+1) mod (2*n+1)=0) # G. C. Greubel, May 18 2019
  • Magma
    [n: n in [1..1000] | (Factorial(n)+1) mod (2*n+1) eq 0 ]; // G. C. Greubel, May 18 2019
    
  • Maple
    A053662:=n->`if`(n!+1 mod (2*n+1) = 0, n, NULL): seq(A053662(n), n=1..1000); # Wesley Ivan Hurt, Dec 01 2015
  • Mathematica
    Drop[Union[Table[If[IntegerQ[(n!+1)/(2n+1)], n], {n, 1, 1000}]], -1] (* Ed Pegg Jr, Dec 05 2001 *)
    Select[Range[1000], Mod[#! +1, 2*# +1] == 0 &] (* G. C. Greubel, May 18 2019 *)
  • PARI
    for(n=1,10^3, if((n!+1)%(2*n+1)==0, print1(n,", ")) ) \\ G. C. Greubel, May 18 2019
    
  • Sage
    [n for n in (1..1000) if Mod(factorial(n)+1, 2*n+1)==0 ] # G. C. Greubel, May 18 2019
    

Formula

a(n) >> n log n. - Charles R Greathouse IV, Apr 16 2024