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.

Showing 1-4 of 4 results.

A056772 Numbers k such that phi(k+4) = phi(k) + 4, where phi(k) = A000010(k) is Euler's totient function.

Original entry on oeis.org

3, 7, 12, 13, 18, 19, 24, 28, 36, 37, 40, 43, 66, 67, 79, 88, 97, 103, 109, 124, 127, 163, 184, 193, 223, 229, 232, 277, 307, 313, 328, 349, 379, 397, 424, 439, 457, 463, 487, 499, 508, 613, 643, 664, 673, 712, 739, 757, 769, 823, 853, 859, 877, 883, 904, 907
Offset: 1

Views

Author

Labos Elemer, Aug 17 2000

Keywords

Comments

In contrast with A015913, composite solutions are not rare. Prime solutions are common.
From Kevin J. Gomez, Mar 02 2016: (Start)
Composite solutions have two known forms:
n such that n = 4 * (2^p - 1) where 2^p - 1 is a Mersenne prime. (A001348)
n such that n = 8q where q is a Sophie Germain prime. (A005394)
There are composite solutions (such as 36) that do not fit either of these forms. (End)

Examples

			For k = 1048: phi(1048) = 520, phi(1048+4) = 524.
		

Crossrefs

Cf. A000010, A015913 (sigma(k+4) = sigma(k) + 4).
Cf. A001838 (k=2), this sequence (k=4), A262084 (k=6), A262085 (k=8), A262086 (k=10).

Programs

A090583 Gosper's approximation to n!, sqrt((2*n+1/3)*Pi)*n^n/e^n, rounded to nearest integer.

Original entry on oeis.org

1, 1, 2, 6, 24, 120, 720, 5039, 40316, 362851, 3628561, 39914615, 478979481, 6226774954, 87175314872, 1307635379670, 20922240412500, 355679137660826, 6402240370021199, 121642823201649058, 2432860847996122437, 51090157192742729183, 1123984974735953018069
Offset: 0

Views

Author

Hugo Pfoertner, Jan 10 2004

Keywords

Crossrefs

Programs

  • Magma
    C := ComplexField(); [Round(Sqrt((2*n + 1/3)*Pi(C))*n^n/Exp(n)): n in [0..30]]; // G. C. Greubel, Nov 28 2017
  • Maple
    Digits:= 2000;
    a:= n-> round(sqrt((2*n+1/3)*Pi)*n^n/exp(n)):
    seq(a(n), n=0..30);  # Alois P. Heinz, Feb 04 2013
  • Mathematica
    Join[{1}, Table[Round[Sqrt[(2*n + 1/3)*Pi]*n^n/Exp[n]], {n, 1, 50}]] (* G. C. Greubel, Nov 28 2017 *)
  • PARI
    a(n) = round(sqrt((2*n+1/3)*Pi)*n^n/exp(n)); \\ Bill McEachen, Aug 16 2014
    

A260657 Rounded error in Stirling's formula: a(n) = round(n! - exp(-n)*n^(n+1/2)*sqrt(2*Pi)).

Original entry on oeis.org

1, 0, 0, 0, 0, 2, 10, 60, 418, 3343, 30104, 301175, 3314114, 39781325, 517289459, 7243645801, 108675472777, 1739099429899, 29569079533691, 532313816538037, 10115161415506606, 202324846199795597, 4249233149373416698, 93491368355657653179, 2150474710445177712523
Offset: 0

Author

Vladimir Reshetnikov, Nov 13 2015

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> n!-round(sqrt(2*Pi*n)*(n/exp(1))^n):
    seq(a(n), n=0..25);  # Alois P. Heinz, Jan 24 2024
  • Mathematica
    Table[Round[n! - Exp[-n] n^(n+1/2) Sqrt[2 Pi]], {n, 0, 24}]
  • Sage
    def a(n): # Throws an error if result could not be computed exactly.
        rif = RealIntervalField(max(4,10*n))
        r = rif(factorial(n)-(n^(1/2+n)*sqrt(2*pi))/exp(n))
        return r.unique_round()
    for n in (0..100): print(n, a(n)) # b-file style; Peter Luschny, Nov 18 2015

Formula

a(n) ~ exp(-n)*n^(n-1/2)*sqrt(2*Pi)/12.
a(n) = A000142(n) - A005394(n). - Alois P. Heinz, Jan 24 2024

A127585 Exponential error term from Stirling's Approximation.

Original entry on oeis.org

1, 1, 18, 345, 10243, 437769, 25260317, 1873346813, 172254143084, 19114537903943, 2506628271002200, 382005168783773474, 66734799966312471195, 13212509243902296154744, 2936153006332857671962341, 726345521215072990990045577, 198595552305314906351047196508
Offset: 0

Author

Jonathan Vos Post, Apr 02 2007

Keywords

Examples

			a(1) = Floor[(sqrt(2*pi) * (1^1) * (1^(1/2))) - 1! ] = Floor(1.50662827) = 1.
a(2) = Floor[(sqrt(2*pi) * (2^2) * (2^(2/2))) - 2! ] = Floor(18.0530262) = 18.
		

Crossrefs

Formula

a(n) = floor(sqrt(2*Pi)*(n^n)*(n^(n/2))) - n!.

Extensions

More terms from Alois P. Heinz, Jan 24 2024
Showing 1-4 of 4 results.