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.

Previous Showing 11-20 of 36 results. Next

A088790 Numbers k such that (k^k-1)/(k-1) is prime.

Original entry on oeis.org

2, 3, 19, 31, 7547
Offset: 1

Views

Author

T. D. Noe, Oct 16 2003

Keywords

Comments

Note that (k^k-1)/(k-1) is prime only if k is prime, in which case it equals cyclotomic(k,k), the k-th cyclotomic polynomial evaluated at x=k. This sequence is a subsequence of A070519. The number cyclotomic(7547,7547) is a probable prime found by H. Lifchitz. Are there only a finite number of these primes?
From T. D. Noe, Dec 16 2008: (Start)
The standard heuristic implies that there are an infinite number of these primes and that the next k should be between 10^10 and 10^11.
Let N = (7547^7547-1)/(7547-1) = A023037(7547). If N is prime, then the period of the Bell numbers modulo 7547 is N. See A054767. (End)

References

  • R. K. Guy, Unsolved Problems in Theory of Numbers, 1994, A3.

Crossrefs

Cf. A070519 (cyclotomic(n, n) is prime).
Cf. A056826 ((n^n+1)/(n+1) is prime).

Programs

  • Mathematica
    Do[p=Prime[n]; If[PrimeQ[(p^p-1)/(p-1)], Print[p]], {n, 100}]
  • PARI
    is(n)=ispseudoprime((n^n-1)/(n-1)) \\ Charles R Greathouse IV, Feb 17 2017

A031972 a(n) = Sum_{k=1..n} n^k.

Original entry on oeis.org

0, 1, 6, 39, 340, 3905, 55986, 960799, 19173960, 435848049, 11111111110, 313842837671, 9726655034460, 328114698808273, 11966776581370170, 469172025408063615, 19676527011956855056, 878942778254232811937, 41660902667961039785742, 2088331858752553232964199
Offset: 0

Views

Author

N. J. A. Sloane, Dec 11 1999

Keywords

Comments

Sum of lengths of longest ending contiguous subsequences with the same value over all s in {1,...,n}^n: a(n) = Sum_{k=1..n} k*A228273(n,k). a(2) = 6 = 2+1+1+2: [1,1], [1,2], [2,1], [2,2]. - Alois P. Heinz, Aug 19 2013
a(n) is the expected wait time to see the contiguous subword 11...1 (n copies of 1) over all infinite sequences on alphabet {1,2,...,n}. - Geoffrey Critzer, May 19 2014
a(n) is the number of sequences of k elements from {1,2,...,n}, where 1<=k<=n. For example, a(2) = 6, counting the sequences, [1], [2], [1,1], [1,2], [2,1], [2,2]. Equivalently, a(n) is the number of bar graphs having a height and width of at most n. - Emeric Deutsch, Jan 24 2017.
In base n, a(n) has n+1 digits: n 1's followed by a 0. - Mathew Englander, Oct 20 2020

Crossrefs

Main diagonal of A228275.

Programs

Formula

a(1)=1; for n!=1 a(n) = (n^(n+1)-1)/(n-1) - 1. - Benoit Cloitre, Aug 17 2002
a(n) = A031973(n)-1 for n>0. - Robert G. Wilson v, Apr 15 2015
a(n) = n*A023037(n) = n^n - 1 + A023037(n). - Mathew Englander, Oct 20 2020

Extensions

a(0)=0 prepended by Alois P. Heinz, Oct 22 2019

A226238 a(n) = (n^n - n)/(n - 1).

Original entry on oeis.org

2, 12, 84, 780, 9330, 137256, 2396744, 48427560, 1111111110, 28531167060, 810554586204, 25239592216020, 854769755812154, 31278135027204240, 1229782938247303440, 51702516367896047760, 2314494592664502210318, 109912203092239643840220
Offset: 2

Views

Author

Ralf Stephan, Aug 25 2013

Keywords

Comments

a(n) expressed in base n is written with (n-1) ones followed by a zero. - Michel Marcus, Aug 25 2013

Crossrefs

A diagonal of A228275.

Programs

  • Mathematica
    Array[(#^# - #)/(# - 1) &, 18, 2] (* Michael De Vlieger, May 24 2023 *)
  • PARI
    a(n)=(n^n-n)/(n-1)
    
  • Python
    def A226238(n): return (n**n-n)//(n-1) # Chai Wah Wu, Sep 28 2023

Formula

a(n) = Sum_{k=1..n-1} n^k.
a(n) = A023037(n) - 1, for n>1. - Michel Marcus, Aug 25 2013

A068475 a(n) = Sum_{m=0..n} m*n^(m-1).

Original entry on oeis.org

0, 1, 5, 34, 313, 3711, 54121, 937924, 18831569, 429794605, 10987654321, 310989720966, 9652968253897, 326011399456939, 11901025061692313, 466937872906120456, 19594541482740368161, 875711370981239308953, 41524755927216069067489, 2082225625247428808306410
Offset: 0

Views

Author

Francois Jooste (phukraut(AT)hotmail.com), Mar 10 2002

Keywords

Comments

The closed form comes from taking the derivative of the closed form of A031972, for which each term of this sequence is a derivative. - Jonas Whidden, Oct 18 2011

Examples

			a(2) = Sum_{m = 1..2} m*2^(m-1) = 1 + 2*2 = 5.
		

Crossrefs

Derivative sequence of A031972.

Programs

  • Haskell
    a068475 n = sum $ zipWith (*) [1..n] $ iterate (* n) 1
    -- Reinhard Zumkeller, Nov 22 2014
    
  • Magma
    [0] cat [(&+[m*n^(m-1): m in [0..n]]): n in [1..30]]; // G. C. Greubel, Oct 13 2018
  • Maple
    a := n->sum(m*n^(m-1),m=1..n);
  • Mathematica
    Join[{0}, Table[Sum[m*n^(m-1), {m,0,n}], {n,1,30}]] (* G. C. Greubel, Oct 13 2018 *)
  • PARI
    for(n=0,30, print1(if(n==0, 0, sum(m=0,n, m*n^(m-1))), ", ")) \\ G. C. Greubel, Oct 13 2018
    

Formula

a(1) = 1. For n > 1, a(n) = ((n-1)*(n+1)*n^n - n^(n+1) + 1)/(n-1)^2. - Jonas Whidden, Oct 18 2011
a(n) = A062806(n) / n for n>=1. - Reinhard Zumkeller, Nov 22 2014
a(n) = [x^(n-1)] 1/((1 - x)*(1 - n*x)^2). - Peter Bala, Feb 12 2024

A191690 a(n) = n^n-n^(n-1)-n^(n-2)-...-n^2-n-1.

Original entry on oeis.org

0, 1, 14, 171, 2344, 37325, 686286, 14380471, 338992928, 8888888889, 256780503550, 8105545862051, 277635514376232, 10257237069745861, 406615755353655134, 17216961135462248175, 775537745518440716416, 37031913482632035365105
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jun 11 2011

Keywords

Examples

			a(1)=0 (=1^1-1), a(2)=1 (=2^2-2-1), a(3)=14 (=3^3-3^2-3-1), a(4)=171 (=4^4-4^3-4^2-4-1).
		

Crossrefs

Programs

  • Maple
    A191690 := proc(n) n^n-add( n^j,j=0..n-1) ; end proc: # R. J. Mathar, Jun 23 2011
  • Mathematica
    Table[Total[-n^Range[0,n-1]]+n^n,{n,2,20}] (* Harvey P. Dale, Jul 06 2011 *)
    f[n_] := ((n - 2) n^n + n)/(n - 1) - 1; f[1] = 0; Array[f, 18] (* Robert G. Wilson v, Apr 16 2015 *)
  • PARI
    a(n) = n^n - sum(k=0, n-1, n^k); \\ Michel Marcus, Apr 16 2015
    
  • Sage
    [n^n - sum([n^k for k in range(n)]) for n in range(1,19)] # Danny Rorabaugh, Apr 20 2015

Formula

a(n) = A117667(n)-1. - Robert G. Wilson v, Apr 16 2015
a(n) = n^n - A023037(n). - Danny Rorabaugh, Apr 20 2015

A300332 Integers of the form Sum_{j in 0:p-1} x^j*y^(p-j-1) where x and y are positive integers with max(x, y) >= 2 and p is some prime.

Original entry on oeis.org

3, 4, 7, 12, 13, 19, 21, 27, 28, 31, 37, 39, 43, 48, 49, 52, 57, 61, 63, 67, 73, 75, 76, 79, 80, 84, 91, 93, 97, 103, 108, 109, 111, 112, 117, 121, 124, 127, 129, 133, 139, 147, 148, 151, 156, 157, 163, 169, 171, 172, 175, 181, 183, 189, 192, 193, 196, 199
Offset: 1

Views

Author

Peter Luschny, Mar 03 2018

Keywords

Comments

Equivalently these are the integers represented by a cyclotomic binary form Phi_p(x,y) where p is prime and x and y are positive integers with max(x,y) >= 2. A cyclotomic binary form (over Z) is a homogeneous polynomial in two variables of the form f(x, y) = y^phi(k)*Phi(k, x/y) where Phi(k, z) is a cyclotomic polynomial of index k and phi is Euler's totient function.
An efficient and safe calculation of this sequence requires a precise knowledge of the range of possible solutions of the associated Diophantine equations. The bounds used in the Julia program below were specified by Fouvry, Levesque and Waldschmidt.

Examples

			Let p denote an odd prime. Subsequences are numbers of the form
2^p - 1,         (A001348) (x = 1, y = 2) (Mersenne numbers),
p*2^(p - 1),     (A299795) (x = 2, y = 2),
(3^p - 1)/2,     (A003462) (x = 1, y = 3),
3^p - 2^p,       (A135171) (x = 2, y = 3),
p*3^(p - 1),     (A027471) (x = 3, y = 3),
(4^p - 1)/3,     (A002450) (x = 1, y = 4),
2^(p-1)*(2^p-1), (A006516) (x = 2, y = 4),
4^p - 3^p,       (A005061) (x = 3, y = 4),
p*4^(p - 1),     (A002697) (x = 4, y = 4),
(p^p-1)/(p-1),   (A023037),
p^p,             (A000312, A051674).
.
The generalized cuban primes A007645 are a subsequence, as are the quintan primes A002649, the septan primes and so on.
All primes in this sequence less than 1031 are generalized cuban primes. 1031 is an element because 1031 = f(5,2) where f(x,y) = x^4 + y*x^3 + y^2*x^2 + y^3*x + y^4, however 1031 is not a cuban prime because 1030 is not divisible by 6.
		

Crossrefs

Programs

  • Julia
    using Primes
    function isA300332(n)
        logn = log(n)^1.161
        K = Int(floor(5.383*logn))
        M = Int(floor(2*(n/3)^(1/2)))
        k = 2
        while k <= K
            if k == 7
                K = Int(floor(4.864*logn))
                M = Int(ceil(2*(n/11)^(1/4)))
            end
            for y in 2:M, x in 1:y
                r = x == y ? k*y^(k - 1) : div(x^k - y^k, x - y)
                n == r && return true
            end
            k = nextprime(k+1)
        end
        return false
    end
    A300332list(upto) = [n for n in 1:upto if isA300332(n)]
    println(A300332list(200))

A345030 a(n) = Sum_{k=1..n} n^(floor(n/k) - 1).

Original entry on oeis.org

1, 3, 11, 70, 633, 7821, 117709, 2097684, 43047545, 1000010125, 25937439391, 743008621422, 23298085496173, 793714780786669, 29192926036832363, 1152921504875352376, 48661191876077295937, 2185911559749718388655, 104127350297928227579629
Offset: 1

Views

Author

Seiichi Manyama, Jun 06 2021

Keywords

Crossrefs

Diagonal of A345032.

Programs

  • Mathematica
    a[n_] := Sum[n^(Floor[n/k] - 1), {k, 1, n}]; Array[a, 20] (* Amiram Eldar, Jun 06 2021 *)
  • PARI
    a(n) = sum(k=1, n, n^(n\k-1));

Formula

a(n) = [x^n] (1/(1 - x)) * Sum_{k>=1} x^k * (1 - x^k)/(1 - n*x^k).

A068740 Result after dividing (n^n)! as many times as possible by n!.

Original entry on oeis.org

1, 1, 3, 833712928048000000
Offset: 0

Views

Author

Henry Bottomley, Feb 26 2002

Keywords

Comments

For prime n, it is also the number of generalized knockout tournament seedings with n players in one match and n rounds (see formula below). - Alexander Karpov, Dec 14 2017
Next term is too large to include.
From Robert G. Wilson v, Dec 14 2017: (Start)
a(4) = 4125147631... (370 digits)...3291015625,
a(5) = 3483655217... (7923 digits)...3819109376,
a(6) = 2196422024... (164237 digits)...0161431552,
a(7) = 4948281440... (4005981 digits)...0000000000,
a(8) = 4242413765...(102886160 digits)...4619140625,
(End)

Examples

			a(3)=833712928048000000 since 3!=6 and (3^3)!=27!=10888869450418352160768000000 which is divisible by 6^13=13060694016 but not 6^14=78364164096.
		

Crossrefs

Formula

a(n) = A068741(n)/A068742(n).
For p prime, a(p) = (p^p)!/(p!)^((p^p-1)/(p-1)).

A076483 a(n) = n!*Sum_{k=1..n} (k-1)^k/k!.

Original entry on oeis.org

0, 0, 1, 11, 125, 1649, 25519, 458569, 9433353, 219117905, 5677963451, 162457597961, 5087919552253, 173136159558361, 6361282619516343, 250987334850557369, 10584205713321808529, 475079402305823570849, 22614513693572549266291, 1137911105533216112417161
Offset: 0

Views

Author

Henry Bottomley, Oct 14 2002

Keywords

Comments

Perhaps the largest possible number of ways of choosing (v1, v2, ..., vn), possibly with repetition, from {b1, b2, ..., bn} with b1 < b2 < ... < bn, such that v1 + v2 + ... + vn < b1 + b2 + ... + bn. Clearly the actual number of ways depends on the particular values of {b1, b2, ..., bn}, but {1, n, n^2, ..., n^(n-1)} produces this result for the number of sums strictly less than (n^n-1)/(n-1) = A023037(n).

Examples

			a(4) = 4!*(0^1/1! + 1^2/2! + 2^3/3! + 3^4/4!) = 0 + 12 + 32 + 81 = 125.
		

Crossrefs

Row sums of A076482.

Programs

  • Mathematica
    Table[n! Sum[(k-1)^k/k!, {k,n}], {n,0,17}] (* Stefano Spezia, Sep 11 2022 *)
  • PARI
    a(n) = n!*sum(k=1, n, (k-1)^k/k!); \\ Seiichi Manyama, Jul 15 2023

Formula

Limit_{n->oo} a(n)/(e*a(n-1)) - n = -1/2.
Limit_{n->oo} a(n)/n^n = 1/(e-1).

A125598 a(n) = ((n+1)^(n-1) - 1)/n.

Original entry on oeis.org

0, 1, 5, 31, 259, 2801, 37449, 597871, 11111111, 235794769, 5628851293, 149346699503, 4361070182715, 139013933454241, 4803839602528529, 178901440719363487, 7143501829211426575, 304465936543600121441
Offset: 1

Views

Author

Alexander Adamchuk, Nov 26 2006

Keywords

Comments

Odd prime p divides a(p-2).
a(n) is prime for n = {3,4,6,74, ...}; prime terms are {5, 31, 2801, ...}.
a(n) is the (n-1)-th generalized repunit in base (n+1). For example, a(5) = 259 which is 1111 in base 6. - Mathew Englander, Oct 20 2020

Crossrefs

Cf. A000272 (n^(n-2)), A125599.
Cf. other sequences of generalized repunits, such as A125118, A053696, A055129, A060072, A031973, A173468, A023037, A119598, A085104, and A162861.

Programs

  • Magma
    [((n+1)^(n-1) -1)/n: n in [1..25]]; // G. C. Greubel, Aug 15 2022
  • Mathematica
    Table[((n+1)^(n-1)-1)/n, {n,25}]
  • Sage
    [gaussian_binomial(n,1,n+2) for n in range(0,18)] # Zerinvary Lajos, May 31 2009
    

Formula

a(n) = ((n+1)^(n-1) - 1)/n.
a(n) = (A000272(n+1) - 1)/n.
a(2k-1)/(2k+1) = A125599(k) for k>0.
From Mathew Englander, Dec 17 2020: (Start)
a(n) = (A060072(n+1) - A083069(n-1))/2.
For n > 1, a(n) = Sum_{k=0..n-2} (n+1)^k.
For n > 1, a(n) = Sum_{j=0..n-2} n^j*C(n-1,j+1). (End)
Previous Showing 11-20 of 36 results. Next