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.

A038507 a(n) = n! + 1.

This page as a plain text file.
%I A038507 N0107 #101 Apr 21 2025 17:04:04
%S A038507 2,2,3,7,25,121,721,5041,40321,362881,3628801,39916801,479001601,
%T A038507 6227020801,87178291201,1307674368001,20922789888001,355687428096001,
%U A038507 6402373705728001,121645100408832001,2432902008176640001,51090942171709440001,1124000727777607680001,25852016738884976640001
%N A038507 a(n) = n! + 1.
%C A038507 "For n = 4, 5 and 7, n!+1 is a square. Sierpiński asked if there are any other values of n with this property." p. 82 of Ogilvy and Anderson (see A146968).
%C A038507 Number of {12,12*,1*2,21*,2*1}-avoiding signed permutations in the hyperoctahedral group.
%C A038507 After Wilson's Theorem: if (n+1) is prime then (n+1) is the smallest prime factor of a(n). - _Karl-Heinz Hofmann_, Aug 21 2024
%D A038507 C. Stanley Ogilvy and John T. Anderson, Excursions in Number Theory, Oxford University Press, 1966, p. 82.
%D A038507 Wacław Sierpiński, On some unsolved problems of arithmetics, Scripta Mathematica, vol. 25 (1960), p. 125.
%D A038507 N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
%H A038507 Vincenzo Librandi, <a href="/A038507/b038507.txt">Table of n, a(n) for n = 0..300</a>
%H A038507 INRIA Algorithms Project, <a href="http://ecs.inria.fr/services/structure?nbr=763">Encyclopedia of Combinatorial Structures 763</a> and <a href="http://ecs.inria.fr/services/structure?nbr=834">Encyclopedia of Combinatorial Structures 834</a>
%H A038507 T. Mansour and J. West, <a href="https://arxiv.org/abs/math/0207204">Avoiding 2-letter signed patterns</a>, arXiv:math/0207204 [math.CO], 2002.
%H A038507 Romeo Mestrovic, <a href="http://arxiv.org/abs/1202.3670">Euclid's theorem on the infinitude of primes: a historical survey of its proofs (300 BC--2012) and another new proof</a>, arXiv preprint arXiv:1202.3670 [math.HO], 2012-2023. - From _N. J. A. Sloane_, Jun 13 2012
%H A038507 Gerard P. Michon, <a href="http://www.numericana.com/wilson.htm">Wilson's Theorem</a>
%H A038507 Hisanori Mishima, <a href="http://www.asahi-net.or.jp/~KC2H-MSM/mathland/matha1/matha102.htm">Factorizations of many number sequences</a>
%H A038507 Hisanori Mishima, <a href="http://www.asahi-net.or.jp/~KC2H-MSM/mathland/matha1/matha104.htm">Factorizations of many number sequences</a>
%H A038507 Andrew Walker, <a href="http://www.uow.edu.au/~ajw01/ecm/curves.html">Factors of n! +- 1</a>
%H A038507 Arthur T. White, <a href="http://dx.doi.org/10.1017/S0305004100061053">Ringing the changes</a>, Math. Proc. Cambridge Philos. Soc. 94 (1983), no. 2, 203-215.
%H A038507 Robert G. Wilson v, <a href="/A038507/a038507.txt">Explicit factorizations</a>
%H A038507 Jun Yan, <a href="https://arxiv.org/abs/2404.07958">Results on pattern avoidance in parking functions</a>, arXiv:2404.07958 [math.CO], 2024. See p. 4.
%H A038507 <a href="/index/Fa#factorial">Index entries for sequences related to factorial numbers</a>
%F A038507 a(n) = n * (a(n-1) - 1) + 1. - _Reinhard Zumkeller_, Mar 20 2013
%F A038507 0 = a(n)*(a(n+1) - 5*a(n+2) + 5*a(n+3) - a(n+4)) + a(n+1)*(a(n+1) + a(n+2) - 6*a(n+3) + 2*a(n+4)) + a(n+2)*(3*a(n+2) - a(n+3) - a(n+4)) + a(n+3)*(a(n+3)) if n>=0. - _Michael Somos_, Apr 23 2014
%F A038507 From _Ilya Gutkovskiy_, Jan 20 2017: (Start)
%F A038507 E.g.f: exp(x) + 1/(1 - x).
%F A038507 Sum_{n>=0} 1/a(n) = A217702. (End)
%e A038507 G.f. = 2 + 2*x + 3*x^2 + 7*x^3 + 25*x^4 + 121*x^5 + 721*x^6 + 5041*x^7 + ...
%t A038507 Range[0,20]!+1 (* _Harvey P. Dale_, May 06 2012 *)
%o A038507 (Magma) [Factorial(n) +1: n in [0..25]]; // _Vincenzo Librandi_, Jul 20 2011
%o A038507 (Maxima) A038507(n):= n!+1$
%o A038507 makelist(A038507(n),n,0,30); /* _Martin Ettl_, Nov 03 2012 */
%o A038507 (PARI) a(n)=n!+1 \\ _Charles R Greathouse IV_, Nov 20 2012
%o A038507 (Haskell)
%o A038507 a038507 = (+ 1) . a000142
%o A038507 a038507_list = 2 : f 1 2 where
%o A038507    f x y = z : f (x + 1) z where z = x * (y - 1) + 1
%o A038507 -- _Reinhard Zumkeller_, Mar 20 2013
%o A038507 (Python)
%o A038507 from math import factorial
%o A038507 def A038507(n): return factorial(n) + 1 # _Karl-Heinz Hofmann_, Aug 21 2024
%o A038507 (Sage) [factorial(n) + 1 for n in range(0,24)] # _Stefano Spezia_, Apr 21 2025
%Y A038507 Cf. A000142, A002583, A002981, A033312, A051301, A056111, A146968, A217702.
%K A038507 nonn,easy,nice
%O A038507 0,1
%A A038507 _N. J. A. Sloane_
%E A038507 Additional comments from _Jason Earls_, Apr 01 2001
%E A038507 Numericana.com URL fixed by _Gerard P. Michon_, Mar 30 2010
%E A038507 Entry revised by _N. J. A. Sloane_, Jun 10 2012