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

A173500 Number of sequences of length n with terms from {0,1,...,n-1} such that the sum of terms is 0 modulo n and the i-th term is not i or 2i modulo n.

Original entry on oeis.org

0, 0, 0, 6, 64, 854, 13392, 244944, 5124266, 120795956, 3169804000, 91666666668, 2897010809280, 99350833566282, 3674884626652666, 145845089585448960, 6182031393612132352, 278750799336055446646, 13322922112485213149376
Offset: 1

Views

Author

Max Alekseyev, Feb 20 2010

Keywords

Examples

			For n=4 the a(4)=6 sequences are 0103, 0112, 0301, 3113, 3302 and 3311. - _Robert Israel_, Aug 30 2020
		

Crossrefs

Cf. A173499.

Programs

  • Maple
    f:= proc(n)
    local g;
      g:= proc(i,s) option remember;
        if i = 0 then if s=0 then return 1 else return 0 fi fi;
        add(procname(i-1,s-k mod n),k= {$0..n-1} minus {2*i mod n,i})
      end proc;
      g(n,0)
    end proc:
    map(f, [$1..30]); # Robert Israel, Aug 30 2020
  • Mathematica
    f[n_] := Module[{g}, g[i_, s_] := g[i, s] = With[{}, If[i == 0, If[s == 0, Return@1, Return@0]]; Sum[g[i-1, Mod[s-k, n]], {k, Range[0, n-1] ~Complement~ {Mod[2i, n], i}}]]; g[n, 0]];
    Table[f[n], {n, 1, 30}] (* Jean-François Alcover, May 11 2023, after Robert Israel *)

Formula

For prime p, a(p) = (p-1)*((p-2)^(p-1)-1)/p.

A185634 Number of n-length cycles from any point in a complete graph on n nodes.

Original entry on oeis.org

1, 2, 21, 204, 2605, 39990, 720601, 14913080, 348678441, 9090909090, 261535698061, 8230246567620, 281241170407093, 10371206370520814, 410525522232055665, 17361641481138401520, 781282469559318055057, 37275544492386193492506, 1879498672877297909667781
Offset: 2

Views

Author

Sébastien Dumortier, Dec 18 2012

Keywords

Comments

If M is the n X n matrix filled with ones, a(n) is the upper left element of (M-Id)^n.

Examples

			In a complete graph in 5 nodes, there are 204 different cycles with a length of 5, from a point to itself.
		

Crossrefs

Cf. A173499.

Formula

a(n) = floor((n-1)^n/n) + ((-1)^n+1)/2.
a(n) = floor((n-1)^n/n)+1 for n odd, a(n) = floor((n-1)^n/n) for n even.

A215159 a(n) = floor(n^n / (n+1)).

Original entry on oeis.org

1, 0, 1, 6, 51, 520, 6665, 102942, 1864135, 38742048, 909090909, 23775972550, 685853880635, 21633936185160, 740800455037201, 27368368148803710, 1085102592571150095, 45957792327018709120, 2070863582910344082917, 98920982783015679456198
Offset: 0

Views

Author

Alex Ratushnyak, Aug 04 2012

Keywords

Comments

b(n) = n^n mod (n+1) begins: 0, 1, 1, 3, 1, 5, 1, 7, 1, 9, 1, 11, 1, 13, 1, 15...

Crossrefs

Cf. A060072 is essentially floor((n+1)^n / n).
Cf. A173499 is equal to floor((n-1)^n / n).
Cf. A023037 is essentially floor((n+1)^(n+1) / n).

Programs

  • Magma
    [Floor(n^n/(n+1)): n in [0..30]]; // G. C. Greubel, Aug 16 2022
    
  • Mathematica
    Table[If[n==0, 1, Floor[n^n/(n+1)]], {n,0,30}] (* G. C. Greubel, Aug 16 2022 *)
  • Python
    for n in range(55):
        print(n**n // (n+1), end=",")
    
  • SageMath
    [(n^n//(n+1)) for n in (0..30)] # G. C. Greubel, Aug 16 2022
Showing 1-3 of 3 results.