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-2 of 2 results.

A118537 Number of functions f: {1, 2, ..., n} --> {1, 2, ..., n} such that f(1) != f(2), f(2) != f(3), ..., f(n-1) != f(n), f(n) != f(1).

Original entry on oeis.org

2, 6, 84, 1020, 15630, 279930, 5764808, 134217720, 3486784410, 99999999990, 3138428376732, 106993205379060, 3937376385699302, 155568095557812210, 6568408355712890640, 295147905179352825840, 14063084452067724991026
Offset: 2

Views

Author

Warut Roonguthai, May 06 2006

Keywords

Comments

a(n) is also the number of circuits of length n in the complete graph on n vertices. - Thibaut Lienart (syncthib(AT)gmail.com), Jan 29 2010
Circuits are allowed to be self-intersecting and are directional with a designated start node. The number of (self-avoiding) directed cycles is given by A124355. - Andrew Howroyd, Sep 05 2018
a(n) is also the number of graph colorings of the cycle graph C_n with n colors. - Orson R. L. Peters, Jul 27 2020

Crossrefs

Programs

  • Magma
    [(n-1)^n + (-1)^n*(n-1) : n in [2..20]]; // Wesley Ivan Hurt, Jul 27 2020
  • Mathematica
    a[n_]:=(n-1)^n + (-1)^n*(n-1); Array[a, 50, {2, 51}] (* Stefano Spezia, Sep 07 2018 *)
  • PARI
    a(n) = (n-1)^n + (-1)^n*(n-1); \\ Andrew Howroyd, Sep 05 2018
    

Formula

a(n) = (n-1)^n + (-1)^n*(n-1).

A382362 Number of oriented Eulerian circuits from a fixed start vertex in the complete digraph K_n, counting distinct first arcs.

Original entry on oeis.org

1, 6, 768, 3888000, 1238347284480, 36133511823360000000, 132525036775962102988800000000, 80290170669240213088301154828288000000000, 10219925826442937385376011199621103616000000000000000000, 338787616987540767092926393308400759448386388551011812769792000000000000
Offset: 2

Views

Author

Florian Ragwitz, Mar 23 2025

Keywords

Examples

			For n=3, the complete digraph K_3 with vertex set {1,2,3} has 6 distinct Eulerian circuits (counting rotations / distinct first arcs) starting and ending at vertex 1: (1,2,3,1,3,2,1), (1,3,2,1,2,3,1), (1,2,1,3,2,3,1), (1,3,2,3,1,2,1), (1,2,3,2,1,3,1), and (1,3,1,2,3,2,1).
The first two are equal to their reversals. The others form pairs that are equal in reversed form. Since this sequence distinguishes arc order and direction, a(3)=6 rather than 4.
In contrast, A232545 counts only 3 tours for n=3 because it does not distinguish Eulerian circuits that differ solely by rotating the cycle to a different first arc out of vertex 1.
		

Crossrefs

Programs

  • Haskell
    a n = (n-1) * n^(n-2) * (product [1..(n-2)])^n
  • PARI
    a(n) = (n-1) * n^(n-2) * factorial(n-2)^n;
    

Formula

a(n) = (n-1) * n^(n-2) * ((n-2)!)^n.
a(n) = A023443(n) * A232545(n) = A023443(n) * A000272(n) * A000142(n-2)^n.
Showing 1-2 of 2 results.