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

A023811 Largest metadrome (number with digits in strict ascending order) in base n.

Original entry on oeis.org

0, 1, 5, 27, 194, 1865, 22875, 342391, 6053444, 123456789, 2853116705, 73686780563, 2103299351334, 65751519677857, 2234152501943159, 81985529216486895, 3231407272993502984, 136146740744970718253, 6106233505124424657789, 290464265927977839335179
Offset: 1

Views

Author

Keywords

Comments

Also smallest zeroless pandigital number in base n. - Franklin T. Adams-Watters, Nov 15 2006
The smallest permutational number in A134640 in the n-positional system. - Artur Jasinski, Nov 07 2007

Examples

			a(5) = 1234[5] (in base 5) = 1*5^3 + 2*5^2 + 3*5 + 4 = 125 + 50 + 15 + 4 = 194.
a(10) = 123456789 (in base 10).
		

Crossrefs

Programs

  • Haskell
    a023811 n = foldl (\val dig -> val * n + dig) 0 [0 .. n - 1]
    -- Reinhard Zumkeller, Aug 29 2014
    
  • Magma
    [0] cat [(n^n-n^2+n-1)/(n-1)^2: n in [2..20]]; // Vincenzo Librandi, May 22 2012
    
  • Maple
    0, seq((n^n-n^2+n-1)/(n-1)^2, n=2..100); # Robert Israel, Dec 13 2015
  • Mathematica
    Table[Total[(#1 n^#2) & @@@ Transpose@ {Range[n - 1], Reverse@ (Range[n - 1] - 1)}], {n, 20}] (* Michael De Vlieger, Jul 24 2015 *)
    Table[Sum[(b - k)*b^(k - 1), {k, b - 1}], {b, 30}] (* Clark Kimberling, Aug 22 2015 *)
    Table[FromDigits[Range[0, n - 1], n], {n, 20}] (* L. Edson Jeffery, Dec 13 2015 *)
  • PARI
    {for(i=1,18,cuo=0; for(j=1,i-1,cuo=cuo+j*i^(i-j-1)); print1(cuo,", "))} \\\ Douglas Latimer, May 16 2012
    
  • PARI
    A023811(n)=if(n>1,(n^n-n^2)\(n-1)^2+1)  \\ M. F. Hasler, Jan 22 2013
    
  • Python
    def a(n): return (n**n - n**2 + n - 1)//((n - 1)**2) if n > 1 else 0
    print([a(n) for n in range(1, 21)]) # Michael S. Branicky, Apr 24 2023

Formula

a(n) = Sum_{j=1...n-1} j*n^(n-1-j).
lim_{n->infinity} a(n)/a(n-1) - a(n-1)/a(n-2) = exp(1). - Conjectured by Gerald McGarvey, Sep 26 2004. Follows from the formula below and lim_{n->infinity} (1+1/n)^n = e. - Franklin T. Adams-Watters, Jan 25 2010
a(n) = (n^n-n^2+n-1)/(n-1)^2 = A058128(n)-1 = n*A060073(n)-1 (for n>=2). - Henry Bottomley, Feb 21 2001

Extensions

Edited by M. F. Hasler, Jan 22 2013

A060073 a(n) = (n^(n-1)-1)/(n-1)^2.

Original entry on oeis.org

1, 2, 7, 39, 311, 3268, 42799, 672605, 12345679, 259374246, 6140565047, 161792257795, 4696537119847, 148943500129544, 5124095576030431, 190082780764323705, 7563707819165039903, 321380710796022350410, 14523213296398891966759, 695546073617378871592991
Offset: 2

Views

Author

Henry Bottomley, Feb 21 2001

Keywords

Comments

Written in base n, a(n) has n-2 digits and looks like 12345... except that the final digit is n-1 rather than n-2.
Note that 2^m-1 divides a(m+1) = ((m+1)^m-1)/m^2 if and only if m = 2^k-1 with gcd(k,m) = 1. Mersenne numbers M = 2^p-1 such that a(M+1)/(2^M-1) is prime are Mersenne primes 2^3-1 = 7 and 2^7-1 = 127. - Thomas Ordowski, Sep 19 2021

Examples

			a(10) = 999999999/81 = 111111111/9 = 12345679.
		

Crossrefs

Cf. A000142, A037205, A058128, A059522, A060072, A127837 (numbers p such that a(p+1) is prime).

Programs

  • Mathematica
    Table[(n^(n - 1) - 1)/(n - 1)^2, {n, 2, 20}] (* Michael De Vlieger, Oct 28 2021 *)
  • PARI
    a(n) = { (n^(n - 1) - 1)/(n - 1)^2 } \\ Harry J. Smith, Jul 01 2009

Formula

a(n) = A037205(n-1)/(n-1)^2 = A060072(n)/(n-1) = A058128(n)/n = A059522(n)/A000142(n).

A051846 Digits 1..n in strict descending order n..1 interpreted in base n+1.

Original entry on oeis.org

1, 7, 57, 586, 7465, 114381, 2054353, 42374116, 987654321, 25678050355, 736867805641, 23136292864686, 789018236134297, 29043982525261081, 1147797409030816545, 48471109094902544776, 2178347851919531492065, 103805969587115219182431
Offset: 1

Views

Author

Antti Karttunen, Dec 13 1999

Keywords

Comments

All odd-indexed (2n+1) terms are divisible by (2n+1). See A051847.
All even-indexed (2n) terms are divisible by n. - Alexander R. Povolotsky, Oct 20 2022

Examples

			a(1) = 1,
a(2) = 2*3 + 1 = 7,
a(3) = 3*(4^2) + 2*4 + 1 = 57,
a(4) = 4*(5^3) + 3*(5^2) + 2*5 + 1 = 586.
		

Crossrefs

The right edge of A051845.

Programs

  • Maple
    a(n) := proc(n) local i; add(i*((n+1)^(i-1)),i=1..n); end;
  • Mathematica
    Array[Sum[i*(# + 1)^(i - 1), {i, #}] &, 18] (* Michael De Vlieger, Apr 04 2024 *)
  • Maxima
    makelist(((n+1)^(n+1)*(n-1) + 1)/n^2,n,1,20); /* Martin Ettl, Jan 25 2013 */
    
  • PARI
    a(n)=((n+1)^(n+1)*(n-1)+1)/n^2
    
  • Python
    def a(n): return sum((i+1)*(n+1)**i for i in range(n))
    print([a(n) for n in range(1, 20)]) # Michael S. Branicky, Apr 10 2022

Formula

a(n) = Sum_{i=1..n} i*(n+1)^(i-1).
a(n) = ((n+1)^(n+1)*(n-1) + 1)/n^2 = A062806(n+1)/(n+1) - (n+1)^(n+1). - Benoit Cloitre, Sep 28 2002
a(n) = A028310(n-1) * A023811(n+1) + A199969(n+1). - M. F. Hasler, Jan 22 2013
a(n) = (n-1) * A058128(n+1) + 1. - Seiichi Manyama, Apr 10 2022

Extensions

Minor edits in formulas by M. F. Hasler, Oct 11 2019

A058127 Triangle read by rows: T(j,k) is the number of acyclic functions from {1,...,j} to {1,...,k}. For n >= 1, a(n) = (k-j)*k^(j-1), where k is such that C(k,2) < n <= C(k+1,2) and j = (n-1) mod C(k,2). Alternatively, table T(k,j) read by antidiagonals with k >= 1, 0 <= j <= k: T(k,j) = number of acyclic-function digraphs on k vertices with j vertices of outdegree 1 and (k-j) vertices of outdegree 0; T(k,j) = (k-j)*k^(j-1).

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 1, 3, 8, 16, 1, 4, 15, 50, 125, 1, 5, 24, 108, 432, 1296, 1, 6, 35, 196, 1029, 4802, 16807, 1, 7, 48, 320, 2048, 12288, 65536, 262144, 1, 8, 63, 486, 3645, 26244, 177147, 1062882, 4782969, 1, 9, 80, 700, 6000, 50000, 400000, 3000000, 20000000, 100000000
Offset: 1

Views

Author

Dennis P. Walsh, Nov 14 2000

Keywords

Comments

An acyclic function f from domain D={1,...,j} to codomain C={1,...,k} is a function such that, for every subset A of D, f(A) does not equal A. Equivalently, an acyclic function f "eventually sends" under successive composition all elements of D to {j+1,...,k}. An acyclic-function digraph G is a labeled directed graph that satisfies (i) all vertices have outdegree 0 or 1; (ii) if vertex x has outdegree 0 and vertex y has outdegree 1, then x > y; (iii) G has no cycles and no loops. There is a one-to-one correspondence between acyclic functions from D to C and acyclic-function digraphs with j vertices of outdegree 1 and j-k vertices of outdegree 0.
n-th row of the triangle is the n-th iterate of "perform binomial transform operation" (bto) on current row to get next row, extracting the leftmost n terms for n-th row (i.e., all terms left of the zero). First row is (bto): [1, -1, 0, 0, 0, ...]. 5th row is 1, 4, 15, 50, 125, since (bto) performed 5 times iteratively on [1, -1, 0, 0, 0, ...] = 1, 4, 15, 50, 125, 0, -31, ... - Gary W. Adamson, Apr 30 2005
T(k,j) can be shown to be equal to the number of spanning trees of the complete graph on k vertices that contain a specific subtree with k-j-1 edges. - John L. Chiarelli, Oct 04 2016
T(k-1, j-1) is also the number of parking functions with j cars and k spots (see Theorem 2.2 in Kenyon and Yin). - Stefano Spezia, Apr 09 2021

Examples

			a(6) = T(3,2) = 3 because there are 3 acyclic functions from {1,2} to {1,2,3}: {(1,2),(2,3)}, {(1,3),(2,3)} and {(1,3),(2,1)}.
Triangle begins:
  1;
  1, 1;
  1, 2,  3;
  1, 3,  8,  16;
  1, 4, 15,  50,  125;
  1, 5, 24, 108,  432,  1296;
  1, 6, 35, 196, 1029,  4802, 16807;
  1, 7, 48, 320, 2048, 12288, 65536, 262144;
  ...
		

Crossrefs

The sum of antidiagonals is A058128. The sequence b(n) = T(n, n-1) for n >= 1 is A000272, labeled trees on n nodes.
The sequence c(n) = T(n, n-2) for n >= 2 is A007334(n). The sequence d(n) = T(n, n-3) for n >= 3 is A089463(n-3,0). - Peter Luschny, Apr 22 2009

Programs

  • Magma
    /* As triangle */ [[(n-k)*n^(k-1): k in [0..n-1]]: n in [1.. 10]]; // Vincenzo Librandi, Aug 11 2017
    
  • Maple
    T := proc(n,k) (n-k)*n^(k-1) end; seq(print(seq(T(n,k),k=0..n-1)),n=1..9); # Peter Luschny, Jan 14 2009
  • Mathematica
    t[n_, k_] := (n-k)*n^(k-1); Table[t[n, k], {n, 1, 10}, {k, 0, n-1}] // Flatten (* Jean-François Alcover, Dec 03 2013 *)
  • PARI
    {T(n, k) = if( k<0 || k>n, 0, n==0, 1, (n-k) * n^(k-1))}; /* Michael Somos, Sep 20 2017 */

Formula

For fixed m = k-j, a(n) = T(k, j) = T(m+j, j) = m*(m+j)^(j-1). Exponential generating function g for T(m+j, j) = m*(m+j)^(j-1) is given by g(t) = exp(-m*W(-t)), where W denotes the principal branch of Lambert's W function. Lambert's W function satisfies W(t)*exp(W(t)) = t for t >= -exp(-1).
T(n, k) = Sum_{i=0..k} T(n-1, i) * binomial(k, i) if k < n. - Michael Somos, Sep 20 2017

Extensions

a(32) corrected by T. D. Noe, Jan 25 2008

A232006 Triangular array read by rows: T(n,k) is the number of simple labeled graphs on vertex set {1,2,...,n} with exactly k components (all of which are trees) such that the labels {1,2,...,k} are all in distinct components (trees), n >= 0, 0 <= k <= n.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 3, 2, 1, 0, 16, 8, 3, 1, 0, 125, 50, 15, 4, 1, 0, 1296, 432, 108, 24, 5, 1, 0, 16807, 4802, 1029, 196, 35, 6, 1, 0, 262144, 65536, 12288, 2048, 320, 48, 7, 1, 0, 4782969, 1062882, 177147, 26244, 3645, 486, 63, 8, 1, 0, 100000000, 20000000, 3000000, 400000, 50000, 6000, 700, 80, 9, 1
Offset: 0

Views

Author

Geoffrey Critzer, Nov 16 2013

Keywords

Comments

Row sums = (n^n-n)/(n-1)^2 = A058128(n).
Column k without leading zeros is the k-th exponential (also called binomial) convolution of the sequence {A000272(n+1)} = {A232006(n+1, 1)}, for n >= 0, with e.g.f. LamberW(-x)/(-x), where LambertW is the principal branch of the Lambert W-function. This is also the row polynomial P(n, x) of the unsigned triangle A137452, evaluated at x = k. - Wolfdieter Lang, Apr 24 2023

Examples

			The triangle begins:
n\k  0         1        2       3      4     5    6   7  8 9 10 ...
0:   1
1:   0         1
2:   0         1        1
3:   0         3        2       1
4:   0        16        8       3      1
5:   0       125       50      15      4     1
6:   0      1296      432     108     24     5    1
7:   0     16807     4802    1029    196    35    6   1
8:   0    262144    65536   12288   2048   320   48   7  1
9:   0   4782969  1062882  177147  26244  3645  486  63  8 1
10:  0 100000000 20000000 3000000 400000 50000 6000 700 80 9  1
... Reformatted by _Wolfdieter Lang_, Apr 24 2023
		

References

  • R. P. Stanley, Enumerative Combinatorics, Cambridge, Vol. 2, 1999; see Proposition 5.3.2.

Crossrefs

Columns give A000007, A000272, A007334, A362354, A362355, A362356, ...

Programs

  • Mathematica
    Prepend[Table[Table[k n^(n-k-1),{k,0,n}],{n,1,8}],{1}]//Grid
  • PARI
    {T(n, k) = if( k<0 || k>n, 0, n^(n-k-1))}; /* Michael Somos, May 15 2017 */

Formula

T(n, k) = k*n^(n-k-1).
T(n, k) = Sum_{i=0..n-k} T(n-1, k-1+i)*C(n-k,i), T(0, 0) = 1, T(n, 0) = 0 when n >= 1.
From Wolfdieter Lang, Apr 24 2023: (Start)
E.g.f. for {T(n+k, k)}_{n>=0} is (LambertW(-x)/(-x))^k, for k >= 0.
T(n, k) = Sum_{m=0..n-k} |A137452(n-k, m)|*k^m, for n >= 0 and k = 0..n. That is, T(n, n) = 1, for n >= 0, and T(n, k) = Sum_{m=1..n-k} binomial(n-k-1, m-1)*(n-k)^(n-k-m)*k^m, for k = 0..n-1 and n >= k+1. (End)

A127837 Numbers k such that ((k+1)^k-1)/k^2 is a prime.

Original entry on oeis.org

2, 3, 5, 17, 4357
Offset: 1

Views

Author

Keywords

Comments

All terms are primes. Corresponding primes of the form ((k+1)^k-1)/k^2 are listed in A128466 = 2, 7, 311, 7563707819165039903, ... .
It seems that if p is in the sequence then the first three numbers k such that k^2 divides (p+1)^k-1 are: 1, p & ((p+1)^p-1)/p. 2 is in the sequence and the first three terms of A127103 are : 1, 2 & ((2+1)^2-1)/2; 3 is in the sequence and the first three terms of A127104 are : 1, 3 & ((3+1)^3-1)/3; 5 is in the sequence and the first three terms of A127106 are : 1, 5 & ((5+1)^5-1)/5.
No other terms below 20000. - Max Alekseyev, Apr 25 2007

Examples

			4357 is in the sequence because (4358^4357-1)/4357^2 is prime.
		

Crossrefs

A128466 Primes of the form ((k+1)^k - 1)/k^2 = A060073(k+1).

Original entry on oeis.org

2, 7, 311, 7563707819165039903
Offset: 1

Views

Author

Alexander Adamchuk, Mar 09 2007

Keywords

Comments

Corresponding numbers k are listed in A127837.
Terms are the primes in A060073.
Next term has 15850 = 1 + floor((4357*log(4358) - 2*log(4357))/log(10)) digits and is too large to include. - M. F. Hasler, May 22 2007

Crossrefs

Programs

  • Mathematica
    Select[Table[((n+1)^n-1)/n^2,{n,500}],PrimeQ]  (* Harvey P. Dale, Apr 30 2011 *)
  • PARI
    A128466(n)=A060073(A127837(n)+1) /* see there. --- or: */ forprime(p=1,10^5,if(ispseudoprime(n=((p+1)^p-1)/p^2),print1(n,", "))); \\ M. F. Hasler, May 22 2007

Formula

a(n) = ((A127837(n) + 1)^A127837(n) - 1) / A127837(n)^2.

A059522 a(1) = 1, then a(n) = n*(n^(n-1)-1)*(n-2)!/(n-1).

Original entry on oeis.org

1, 2, 12, 168, 4680, 223920, 16470720, 1725655680, 244074902400, 44799999955200, 10353389902732800, 2941340482417075200, 1007483754568427136000, 409436080665631065446400, 194769597399609368328192000, 107210375103315036907081728000, 67610055415398119744255815680000
Offset: 1

Views

Author

N. J. A. Sloane, Feb 16 2001

Keywords

Crossrefs

Cf. A058128.

Programs

  • Magma
    [1] cat [n*(n^(n-1)-1)*Factorial(n-2)/(n-1): n in [2..17]]; // Vincenzo Librandi, Feb 18 2020
  • Mathematica
    Join[{1},Table[n(n^(n-1)-1) (n-2)!/(n-1),{n,2,20}]] (* Harvey P. Dale, Feb 17 2020 *)
  • PARI
    { for (n = 1, 200, if (n==1, a=1, a=n*(n^(n - 1) - 1)*(n - 2)!/(n - 1)); write("b059522.txt", n, " ", a); ) } \\ Harry J. Smith, Jun 27 2009
    

Formula

a(n) = (n-1)!*A058128(n), n>1.

A347274 a(n) = Sum_{j=1..n} j*n^(n+1-j).

Original entry on oeis.org

1, 8, 54, 448, 4875, 67176, 1120924, 21913088, 490329045, 12345679000, 345227121426, 10610896401216, 355457590375615, 12887297856860168, 502684312937211000, 20988295479420645376, 933876701895122362665, 44111544001370512714296, 2204350295349917301462190
Offset: 1

Views

Author

Ryan Stubbs, Aug 25 2021

Keywords

Examples

			a(1) = 1;
a(2) = 2^2 + 2*2^1 = 8;
a(3) = 3^3 + 2*3^2 + 3*3^1 = 54;
a(4) = 4^4 + 2*4^3 + 3*4^2 + 4*4^1 = 448;
a(5) = 5^5 + 2*5^4 + 3*5^3 + 4*5^2 + 5*5^1 = 4875.
		

Crossrefs

Programs

  • Maple
    a:= n-> `if`(n=1, 1, (n^n-n)*(n/(n-1))^2):
    seq(a(n), n=1..20);  # Alois P. Heinz, Sep 02 2021
  • Python
    def A347274(n): return 1 if n == 1 else n**2*(n**n-n)//(n - 1)**2 # Chai Wah Wu, Sep 12 2021

Formula

a(n) = (n^n - n)*(n/(n-1))^2 for n > 1, a(1) = 1.
a(n) = n * A062805(n) = n^2 * A058128(n) = n^3 * A060073(n).
Showing 1-9 of 9 results.