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-10 of 11 results. Next

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.

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

A060072 a(n) = (n^(n-1) - 1)/(n-1) for n>1, a(1) = 0.

Original entry on oeis.org

0, 1, 4, 21, 156, 1555, 19608, 299593, 5380840, 111111111, 2593742460, 67546215517, 1941507093540, 61054982558011, 2085209001813616, 76861433640456465, 3041324492229179280, 128583032925805678351, 5784852794328402307380, 275941052631578947368421
Offset: 1

Views

Author

Henry Bottomley, Feb 21 2001

Keywords

Comments

(n-1)-digit repunits in base n written in decimal.

Examples

			a(10)=111111111; i.e., just nine 1's (converted from base 10 to decimal).
		

Crossrefs

Cf. other sequences of generalized repunits, such as A053696, A055129, A031973, A125598, A173468, A023037, A119598, A085104, and A162861.

Programs

  • Magma
    [0] cat [ (n^(n-1) -1)/(n-1) : n in [2..25]]; // G. C. Greubel, Aug 15 2022
    
  • Mathematica
    Join[{0},Array[(#^(#-1)-1)/(#-1)&,20,2]] (* Harvey P. Dale, Jun 04 2013 *)
  • PARI
    a(n) = if (n==1, 0, (n^(n - 1) - 1)/(n - 1)); \\ Harry J. Smith, Jul 01 2009
    
  • SageMath
    [0]+[(n^(n-1) -1)/(n-1) for n in (2..25)] # G. C. Greubel, Aug 15 2022

Formula

a(n+1) = Sum_{k=1..n} n^(k-1)*C(n, k). - Olivier Gérard, Jun 26 2001 [Corrected by Mathew Englander, Dec 15 2020]
a(n) = Sum_{j=2..n} n^(n-j). - Zerinvary Lajos, Sep 11 2006
a(n+1) = A125118(n,n). - Reinhard Zumkeller, Nov 21 2006
a(n) = Integral_{x=1/n..1} 1/x^n dx. - Francesco Daddi, Aug 01 2011
a(n) = A037205(n-1)/(n-1) = A060073(n)*(n-1) = A023037(n) - A000169(n).
a(n) = [x^n] x^2/((1 - x)*(1 - n*x)). - Ilya Gutkovskiy, Oct 04 2017
a(n) = 1 + A228275(n, n-2) for n >= 2. - Mathew Englander, Dec 14 2020

Extensions

Name edited by Michel Marcus, Dec 14 2020

A198410 a(n) = ((3^(n-1) + 1)^3 -1)/3^n.

Original entry on oeis.org

7, 37, 271, 2269, 19927, 177877, 1596511, 14355469, 129159847, 1162320517, 10460530351, 94143710269, 847290203767, 7625602267957, 68630391713791, 617673439330669, 5559060695695687, 50031545486420197, 450283907053258831, 4052555156505760669, 36472996387631139607
Offset: 2

Views

Author

Michel Lagneau, Oct 24 2011

Keywords

Comments

This sequence is generalizable :
Proposition: p^n divide (p^(n-1) + 1)^ p - 1.
Proof: Let a and p be two integers such that p>=2, and k = gcd(a, p). Then ak divides (a + 1)^p - 1 because (a+1)^p - 1 = [a^p + binomial(p,1)*a^(p-1) + … + binomial(p,p-2)*a^2] + pa == binomial(p,1)*n^(n-1) == 0 (mod p^n) with a = p^(n-1) and k = p.
a(n) is the least k such that k*3^n+1 is a cube. Thus, the cube is given by (3^(n-1)+1)^3. - Derek Orr, Mar 23 2014

Examples

			a(2) = ((3 + 1)^3 - 1)/3^2 = 63/9 = 7.
		

Crossrefs

Cf. A060073.

Programs

  • Magma
    I:=[7,37,271]; [n le 3 select I[n] else 13*Self(n-1)-39*Self(n-2)+27*Self(n-3): n in [1..30]]; // Vincenzo Librandi, Mar 25 2014
    
  • Maple
    A198410 := proc(n)
            (3^(n-1)+1)^3 ;
            (%-1)/3^n ;
    end proc:
    seq(A198410(n), n=2..20) ; # R. J. Mathar, Oct 25 2011
  • Mathematica
    Table[((3^(n - 1) + 1)^3 - 1)/3^n, {n, 2, 20}] (* Wesley Ivan Hurt, Mar 24 2014 *)
    CoefficientList[Series[(7 - 54 x + 63 x^2)/((1 - x) (3 x - 1) (9 x - 1)), {x, 0, 40}], x] (* Vincenzo Librandi, Mar 25 2014 *)
    LinearRecurrence[{13,-39,27},{7,37,271},30] (* Harvey P. Dale, Mar 04 2015 *)
  • PARI
    a(n)=9^n/27+3^n/3+1 \\ Charles R Greathouse IV, Jun 11 2015

Formula

G.f.: -x^2*(7-54*x+63*x^2) / ( (x-1)*(3*x-1)*(9*x-1) ). - R. J. Mathar, Oct 25 2011
a(n) = 13*a(n-1)-39*a(n-2)+27*a(n-3) for n>2. - Vincenzo Librandi, Mar 25 2014

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

Original entry on oeis.org

0, 1, 8, 63, 624, 7775, 117648, 2097151, 43046720, 999999999, 25937424600, 743008370687, 23298085122480, 793714773254143, 29192926025390624, 1152921504606846975, 48661191875666868480, 2185911559738696531967, 104127350297911241532840, 5242879999999999999999999, 278218429446951548637196400, 15519448971100888972574851071
Offset: 0

Views

Author

Keywords

Comments

For n >= 1, a(n) = order of Fibonacci group F(n+1,n).
The terms, written in base n+1, are n digits of value n. For example, a(4) = 624 = 4444 in base 5. - Marc Morgenegg, Nov 30 2016
For n >= 1, in a square grid of side n, this is the number of ways to populate the grid with 1 X 1 blocks (with at least one block) so that no block falls under the effect of gravity. - Paolo Xausa, Apr 12 2021
For n > 1, (n-1)^2 | a(n). - David A. Corneth, Dec 15 2022

References

  • D. L. Johnson, Presentation of Groups, Cambridge, 1976, p. 182.
  • Richard M. Thomas, The Fibonacci groups revisited, in Groups - St. Andrews 1989, Vol. 2, 445-454, London Math. Soc. Lecture Note Ser., 160, Cambridge Univ. Press, Cambridge, 1991.

Crossrefs

A diagonal of A202624.

Programs

  • Magma
    [(n + 1)^n - 1: n in [0..25]]; // G. C. Greubel, Nov 10 2017
  • Mathematica
    Table[(n + 1)^n - 1, {n, 0, 21}] (* or *)
    Table[If[n < 1, Length@ #, FromDigits[#, n + 1]] &@ ConstantArray[n, n], {n, 0, 21}] (* Michael De Vlieger, Nov 30 2016 *)
  • PARI
    for(n=0,25, print1((n + 1)^n - 1, ", ")) \\ G. C. Greubel, Nov 10 2017
    

Formula

a(n) = A000169(n+1) - 1 = A060072(n+1)*(n-1) = A060073(n+1)*(n-1)^2.
E.g.f.: 1/(exp(LambertW(-x)) - x) - exp(x). - Ilya Gutkovskiy, Nov 30 2016
E.g.f.: -exp(x) - 1/(x + x/LambertW(-x)). - Vaclav Kotesovec, Dec 05 2016
a(n) = Sum_{k=1..n} binomial(n,k)*n^k [from Paolo Xausa's comment]. - Joerg Arndt, Apr 12 2021

Extensions

Revised by N. J. A. Sloane, Dec 30 2011

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

Original entry on oeis.org

1, 0, 1, 5, 41, 434, 5713, 90075, 1657009, 34867844, 826446281, 21794641505, 633095889817, 20088655029078, 691413758034721, 25657845139503479, 1021273028302258913, 43404581642184336392, 1961870762757168078553
Offset: 0

Views

Author

Vladeta Jovovic, Apr 17 2003

Keywords

Comments

From Mathew Englander, Oct 19 2020: (Start)
The sum of two adjacent terms of the sequence cannot be prime.
In base n, a(n) has n-1 digits, which are (beginning from the left): n-2, 2, n-4, 4, and so on, except that if n is even the rightmost digit is 1 instead of 0. In that case, the other digits form a palindrome with every even digit from 2 to n-2 appearing twice. For example, a(14) in base 14 is c2a486684a2c1. If n is odd, then all digits from 1 to n-1 occur exactly once. For example, a(15) in base 15 is d2b496785a3c1e.
For any positive integer k, any prime p, and any positive integer h such that h*p > 2, a(h*p^k - 2) == (-1)^h * (1 - 2^(h-1)) (mod p). For example, a(7*p^k - 2) == 63 (mod p); a(10*p^k - 2) == -511 (mod p).
Suppose k and m are positive integers. If k is even, then a(k*m) == 1, a(k*m+1) == 0, and a(k*m-1) == -1 (all mod m). If k is odd, then a(k*m) == (-1)^m and a(k*m+1) == ceiling(m/2) (both mod m), while a(k*m-1) == m/2 - 1 for m even, and a(k*m-1) == 1 for m odd (mod m).
For proofs of the above, see the Englander link. (End)

Crossrefs

Programs

  • Maple
    seq((j^(j+1)+(-1)^j)/(j+1)^2, j=0..50); # Robert Israel, May 19 2016
  • Mathematica
    Array[(#^(# + 1) + (-1)^#)/(# + 1)^2 &, 19, 0] (* Michael De Vlieger, Nov 13 2020 *)
  • PARI
    a(n) = (n^(n+1)+(-1)^n)/(n+1)^2; \\ Michel Marcus, Oct 20 2020

Formula

a(n) = (-1)^n + Sum_{k=1..n} (-1)^(k+1)*(n+1)^(n-k)*C(n+1,n+2-k). - Gionata Neri, May 19 2016
E.g.f.: (Ei(1,x) - Ei(1,-LambertW(-x)))/x. - Robert Israel, May 19 2016
For n > 1, a(n) = Sum_{k=1..floor(n/2)} (n^(n-2*k) * (2*k/n + n - 2*k)). - Mathew Englander, Oct 19 2020

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

A070189 a(n) = 12345679*n.

Original entry on oeis.org

0, 12345679, 24691358, 37037037, 49382716, 61728395, 74074074, 86419753, 98765432, 111111111, 123456790, 135802469, 148148148, 160493827, 172839506, 185185185, 197530864, 209876543, 222222222, 234567901, 246913580, 259259259, 271604938, 283950617, 296296296, 308641975
Offset: 0

Views

Author

Henry Bottomley, Apr 24 2002

Keywords

Comments

a(82)=1012345678 is the first term which has a digit appearing more than once without an obvious pattern, although a(-82)=-1012345678 might be seen as the concatenation of ten consecutive numbers.

References

  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, Revised edition 1987. See entry 12345679 at p. 188.

Crossrefs

Programs

  • Mathematica
    Table[12345679*n,{n,0,30}] (* or *) LinearRecurrence[{2,-1},{0,12345679},30] (* Harvey P. Dale, Oct 16 2015 *)
  • PARI
    a(n)=12345679*n \\ Charles R Greathouse IV, Jan 09 2012
    
  • PARI
    concat(0, Vec(12345679*x/(1-x)^2 + O(x^26))) \\ Elmo R. Oliveira, Jun 26 2025

Formula

a(n) = n*(10^(10-1)-1)/(10-1)^2.
From Elmo R. Oliveira, Jun 26 2025: (Start)
G.f.: 12345679*x/(1-x)^2.
E.g.f.: 12345679*x*exp(x).
a(n) = 333667*A085959(n).
a(n) = 2*a(n-1) - a(n-2). (End)

Extensions

More terms from Elmo R. Oliveira, Jun 26 2025

A137665 Quotients ((p+1)^p - 1)/p^2 for p = prime(n).

Original entry on oeis.org

2, 7, 311, 42799, 6140565047, 4696537119847, 7563707819165039903, 14523213296398891966759, 105051652240885643072548950287, 8160568057655529131985731272294887039239, 47525417447024678661670292427038339608998847, 20681861558186805237407813095538883147812221153173966103
Offset: 1

Views

Author

Alexander Adamchuk, Feb 04 2008

Keywords

Comments

p^2 divides a(n) = (p+1)^p - 1, p = prime(n). (p+1)^p - 1 = A137664(n) = {8, 63, 7775, 2097151, 743008370687, 793714773254143, 2185911559738696531967, ...}.
Least prime factors of a(n) are listed in A128456(n) = {2, 7, 311, 127, 23, 157, 7563707819165039903, ...}.
Largest prime factors a(n) are listed in A137666.
a(n) is prime for n = {1, 2, 3, 7, 595, ...} corresponding to p = prime(n) = {2, 3, 5, 17, 4357, ...} = A127837.
Primes in this sequence are A128466.

Crossrefs

Programs

  • Mathematica
    Table[ ((Prime[n] + 1)^Prime[n] - 1)/Prime[n]^2, {n,1,15} ]
  • PARI
    a(n) = my(p=prime(n)); polcyclo(p,p+1)/p \\ Hugo Pfoertner, Jul 21 2024

Formula

a(n) = ((prime(n) + 1)^prime(n) - 1)/prime(n)^2;
a(n) = A137664(n)/prime(n)^2.

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

Original entry on oeis.org

1, 3, 37, 1305, 95051, 11878363, 2277696793, 622353150177, 229930796172439, 110462212541120451, 66954547910007962117, 49988751334503886046233, 45082285083777592171142467, 48321795074001873489007405947
Offset: 1

Views

Author

Michel Lagneau, Sep 01 2010

Keywords

Comments

If we consider the general case ((n^(p-1) + 1)^n - 1)/n^p, we obtain this sequence for p=3, the sequence A060073 for p = 2, and the sequence A000051 for n = 2 and p = 2,3,...

Examples

			a(3) = ((3^2 + 1)^3 - 1)/3^3 = 999/27 = 37.
		

Crossrefs

Programs

  • Magma
    [((n^2 + 1)^n - 1)/n^3 : n in [1..20]]; // Vincenzo Librandi, Sep 01 2011
    
  • Maple
    seq(((n^2 + 1)^n - 1)/n^3,n=1..10) ;
  • Mathematica
    Table[((n^2 + 1)^n - 1)/n^3, {n,1,20}] (* G. C. Greubel, Nov 11 2018 *)
  • PARI
    vector(20, n, ((n^2 + 1)^n - 1)/n^3) \\ G. C. Greubel, Nov 11 2018
Showing 1-10 of 11 results. Next