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

A242083 a(n) = 3^p - 2^p - 1, where p is prime(n).

Original entry on oeis.org

4, 18, 210, 2058, 175098, 1586130, 129009090, 1161737178, 94134790218, 68629840493970, 617671248800298, 450283768452043890, 36472994178147530850, 328256958598444055418, 26588814218220014932458, 19383245658672820642055730
Offset: 1

Views

Author

Vincenzo Librandi, May 04 2014

Keywords

Comments

For p>3, all terms are divisible by 42.

Crossrefs

Programs

  • Magma
    [3^p-2^p-1: p in PrimesUpTo(60)];
    
  • Mathematica
    Table[(3^Prime[n] - 2^Prime[n] - 1), {n, 1, 30}]
    3^#-2^#-1&/@Prime[Range[20]] (* Harvey P. Dale, Aug 05 2016 *)
  • PARI
    a(n) = my(p = prime(n)); 3^p-2^p-1; \\ Michel Marcus, May 05 2014
    
  • Sage
    [3^p-2^p-1 for p in primes(60)] # Bruno Berselli, May 12 2014

Formula

a(n) = abs(A083321(A000040(n))). - Michel Marcus, May 05 2014

A332096 Irregular table where T(n,m) = min_{A subset {1..m-1}} |m^n - Sum_{x in A} x^n|, for 1 <= m <= A332098(n) = largest m for which this is nonzero.

Original entry on oeis.org

1, 1, 1, 3, 4, 2, 0, 1, 0, 1, 1, 7, 18, 28, 25, 0, 1, 8, 0, 7, 1, 1, 15, 64, 158, 271, 317, 126, 45, 17, 59, 14, 2, 15, 3, 0, 2, 1, 2, 1, 2, 2, 2, 1, 2, 0, 2, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 31, 210, 748, 1825, 3351, 4606, 3760, 398, 131, 299, 0, 318, 0, 8
Offset: 1

Views

Author

M. F. Hasler, Jul 20 2020

Keywords

Comments

It is known (Sprague 1948, cf. A001661) that for any n, only a finite number of positive integers are not the sum of distinct positive n-th powers. Therefore each row is finite, their lengths are given by A332098.
The number of nonzero terms in row n is A332066(n).
The column of the first zero (exact solution m^n = Sum_{x in A} x^n) in each row is given by A030052, unless A030052(n) = A332066(n) + 1 = A332098(n) + 1.

Examples

			The table reads:
  n\ m=1   2    3    4     5     6     7     8    9   10   11  12   13
----+--------------------------------------------------------------------------
  1 |  1   1                                                  (A332098(1) = 2.)
  2 |  1   3    4    2     0     1     0     1                (A332098(2) = 8.)
  3 |  1   7   18   28    25     0     1     8    0    7    1
  4 |  1  15   64  158   271   317   126    45   17   59   14   2   15  3  0 ...
  5 |  1  31  210  748  1825  3351  4606  3760  398  131  299   0  318  0  8 ...
The first column is all ones (A000012), since {1..m-1} = {} for m = 1.
The second column is 2^n - 1 = A000225 \ {0}, since {1..m-1} = {1} for m = 2.
The third column is 3^n - 2^n - 1 = |A083321(n)| for n > 1.
		

Crossrefs

Programs

  • PARI
    A332096(n,m,r=0)={if(r, (m<2||r<2^(n-1)) && return(r-1); my(E, t=1); while(m^n>=r, E=m--); E=abs(r-(m+!!E)^n); for(a=2,m, if(r=m && return(min(E,r-t)); while(m>=t && E, E=min(self()(n,m-1,r-m^n),E); E && E=min(self()(n,m-=1,r),E)); E, m < n/log(2)+1.5, m^n-sum(x=1,m-1,x^n), self()(n,m-1,m^n))}

Formula

For all n and m, T(n,m) <= A332097(n) = T(n,m*) with m* = A078607(n).
For m <= m* + 1, T(n,m) = m^n - Sum_{0 < x < m} x^n.

A152692 a(n) = n*3^n - n*2^n - n*1^n.

Original entry on oeis.org

0, 0, 8, 54, 256, 1050, 3984, 14406, 50432, 172530, 580240, 1926078, 6328128, 20619690, 66732176, 214742070, 687698944, 2193154530, 6968850192, 22073006382, 69714716480, 219623377050, 690291036688, 2165100175014
Offset: 0

Views

Author

Keywords

Crossrefs

Cf. A152691.

Programs

  • Magma
    [n*3^n-n*2^n-n*1^n: n in [0..30]]; // Vincenzo Librandi, Sep 05 2011
    
  • Mathematica
    Table[n(3^n-2^n-1),{n,0,30}] (* Harvey P. Dale, Oct 20 2013 *)
    CoefficientList[Series[-(2 x^2 (-4 + 21 x - 36 x^2 + 21 x^3))/(-1 + 6 x - 11 x^2 + 6 x^3)^2, {x, 0, 50}], x] (* Stefano Spezia, Sep 04 2018 *)
  • PARI
    vector(30, n, n--; n*(3^n-2^n-1)) \\ G. C. Greubel, Sep 02 2018

Formula

From R. J. Mathar, Dec 12 2008: (Start)
a(n) = (-1)^(n+1)*n*A083321(n).
G.f.: 2*x^2*(4-21*x+36*x^2-21*x^3)/((1-x)^2*(1-3*x)^2*(1-2*x)^2). (End)
E.g.f.: x*(3*exp(3*x) - 2*exp(2*x) - exp(x)). - G. C. Greubel, Sep 02 2018

Extensions

Offset changed from 1 to 0 by Vincenzo Librandi, Sep 05 2011

A178690 Expansion of (exp(3*x)-1)*(exp(2*x)-1)*(exp(x)-1).

Original entry on oeis.org

0, 0, 0, 36, 432, 3660, 27000, 185556, 1223712, 7862940, 49653000, 309776676, 1915868592, 11772890220, 71992229400, 438593697396, 2664227115072, 16146540253500, 97676540188200, 590011376299716, 3559691497843152, 21455715437760780, 129219925869401400
Offset: 0

Views

Author

Geoffrey Critzer, Dec 25 2010

Keywords

Comments

a(n) is the number of 3 X n matrices with the following properties:
i) Each row has at least one nonzero entry.
ii) Each column has exactly one nonzero entry.
iii) The nonzero entries in row m, 1 <= m <= 3, are in {1,2,...,m}.
This sequence counts such 3 X n matrices but the results are easily generalized for any such m X n matrix.

Crossrefs

Cf. A083321, which is essentially the case for m=2.

Programs

  • Magma
    m:=30; R:=PowerSeriesRing(Rationals(), m); b:=Coefficients(R!( (Exp(3*x)-1)*(Exp(2*x)-1)*(Exp(x)-1) )); [0,0,0] cat [Factorial(n+2)*b[n]: n in [1..m-3]]; // G. C. Greubel, Jan 26 2019
    
  • Mathematica
    a=Exp[x]-1;b=Exp[2x]-1;c=Exp[3x]-1;Range[0,20]! CoefficientList[Series[a b c,{x,0,20}],x]
  • PARI
    concat([0,0,0], Vec(-12*x^3*(20*x^2-18*x+3)/((x-1)*(2*x-1)*(4*x-1)*(5*x-1)*(6*x-1)) + O(x^30))) \\ Colin Barker, Dec 01 2014
    
  • Sage
    m = 30; T = taylor((exp(3*x)-1)*(exp(2*x)-1)*(exp(x)-1), x, 0, m); [factorial(n)*T.coefficient(x, n) for n in (0..m)] # G. C. Greubel, Jan 26 2019

Formula

E.g.f.: (exp(3*x)-1)*(exp(2*x)-1)*(exp(x)-1).
G.f.: 12*x^3*(3-18*x+20*x^2)/((1-x)*(1-2*x)*(1-4*x)*(1-5*x)*(1-6*x)). - Colin Barker, Nov 30 2014
For n > 0, a(n) = 1 + 2^n - 4^n - 5^n + 6^n. - Vaclav Kotesovec, Dec 01 2014
a(n) = 18*a(n-1) - 121*a(n-2) + 372*a(n-3) - 508*a(n-4) + 240*a(n-5). - Vaclav Kotesovec, Dec 01 2014

A332099 Square array T(n,k) = k^n - Sum_{0 < i < k} e(i)*(k-i)^n where e(i) = 1 if the partial sum up to this term would remain <= k^n, or 0 else; n, k >= 1; read by falling antidiagonals.

Original entry on oeis.org

1, 1, 1, 0, 3, 1, 0, 4, 7, 1, 0, 2, 18, 15, 1, 0, 0, 28, 64, 31, 1, 0, 1, 25, 158, 210, 63, 1, 0, 0, 0, 271, 748, 664, 127, 1, 0, 1, 1, 317, 1825, 3302, 2058, 255, 1, 0, 0, 8, 126, 3351, 10735, 14068, 6304, 511, 1, 0, 2, 0, 45, 4606, 26141, 59425, 58718, 19170, 1023, 1, 0, 0, 19, 47, 3760, 50478, 183111, 318271, 241948, 58024, 2047, 1
Offset: 1

Views

Author

M. F. Hasler, Apr 19 2020

Keywords

Comments

To compute T(n,k), start from k^n, then subtract (progressively strictly) smaller n-th powers whenever possible.
Since we subtract the smaller n-th powers in a greedy way, T(n,k) may be nonzero even if k^n is a sum of smaller n-th powers: cf. rows of A332065 for these k.

Examples

			The square array starts
  n\k: 1   2    3     4      5      6     7     8     9    10    11    12    13
  --+----------------------------------------------------------------------------
  1 |  1   1    0     0      0      0     0     0     0     0     0     0     0
  2 |  1   3    4     2      0      1     0     1     0     2     0     2     0
  3 |  1   7   18    28     25      0     1     8     0    19    15    18     0
  4 |  1  15   64   158    271    317    126   45    47    59   191    61    285
  5 |  1  31  210   748   1825   3351   4606  3760  398   131   702     0   1229
  6 |  1  63  664  3302  10735  26141  50478 77324 84477 21595 55300 29603  2093
  (...)
Columns 1, 2, 3: A000012, A000225, |A083321|, cf. FORMULA.
We have T(2,10) = 10^2 - 9^2 - 4^2 - 1 = 2, because we first have to subtract 9^2 = 81, even though 10 is in row 2 of A332065 since 10^2 - 8^2 - 6^2 = 0.
		

Crossrefs

Cf. A030052 (least k such that k^n = sum of distinct n-th powers).
Cf. A332065 (all k such that k^n is a sum of distinct n-th powers).
Cf. A332101 (least k such that k^n <= sum of all smaller n-th powers).

Programs

  • PARI
    A332099(n,k,t=k^n)={while(k&&t,t-=(k=min(sqrtnint(t,n),k-1))^n);t}

Formula

T(n,k) > 0 for k < A030052(n), and T(n,k) = 0 for k = A030052(n).
T(n,k) = k^n - Sum_{0 < m < k} m^k for k < A332101(n).
T(n,1) = 1 = A000012(n); T(n,2) = 2^n - 1 = A000225(n);
T(n,3) = 3^n - 2^n - 1 = |A083321(n)|.

A362316 Expansion of e.g.f (exp(x)-1)*(exp(2*x)-1).

Original entry on oeis.org

0, 0, 4, 18, 64, 210, 664, 2058, 6304, 19170, 58024, 175098, 527344, 1586130, 4766584, 14316138, 42981184, 129009090, 387158344, 1161737178, 3485735824, 10458256050, 31376865304, 94134790218, 282412759264, 847255055010, 2541798719464, 7625463267258, 22876524019504, 68629840493970
Offset: 0

Views

Author

Enrique Navarrete, Apr 16 2023

Keywords

Comments

Number of ternary strings with at least one 0 or one 1 and at least one 2.

Examples

			The 4 strings for n=4 are 12, 21, 02, 20.
		

Crossrefs

Cf. A001550, A053152, A083321 (alternates signs).

Programs

  • Mathematica
    LinearRecurrence[{6,-11,6},{0,0,4,18},30] (* Paolo Xausa, Aug 07 2023 *)

Formula

a(n) = 3^n - 2^n - 1, n>0; a(0)=0.
a(n) = 2*A053152(n).
Showing 1-6 of 6 results.