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

A120910 Triangle read by rows: T(n,k) is the number of ternary words of length n having k levels (n >= 1, 0 <= k <= n-1). A level is a pair of identical consecutive letters.

Original entry on oeis.org

3, 6, 3, 12, 12, 3, 24, 36, 18, 3, 48, 96, 72, 24, 3, 96, 240, 240, 120, 30, 3, 192, 576, 720, 480, 180, 36, 3, 384, 1344, 2016, 1680, 840, 252, 42, 3, 768, 3072, 5376, 5376, 3360, 1344, 336, 48, 3, 1536, 6912, 13824, 16128, 12096, 6048, 2016, 432, 54, 3, 3072
Offset: 1

Views

Author

Emeric Deutsch, Jul 15 2006

Keywords

Comments

Row sums are the powers of 3 (A000244).
T(n,k) = 3*A038207(n-1,k).
T(n,k) = A120909(n,n-k).
Sum_{k>=0} k*T(n,k) = (n-1)*3^(n-1) = A036290(n-1).

Examples

			T(3,1)=12 because we have 001,002,011,022,100,110,112,122,200,211,220 and 221.
Triangle starts:
   3;
   6,  3
  12, 12,  3;
  24, 36, 18,  3;
  48, 96, 72, 24,  3;
		

Crossrefs

Programs

  • Maple
    T:=(n,k)->3*2^(n-k-1)*binomial(n-1,k): for n from 1 to 11 do seq(T(n,k),k=0..n-1) od; # yields sequence in triangular form
  • Mathematica
    sol=Solve[{a==v(z^2+a z),b==v(z^2+b z),c==v(z^2+c z)},{a,b,c}];f[z_,u_]:=1/(1-3z-a-b-c)/.sol/.v->u-1;nn=10;Drop[Map[Select[#,#>0&]&,Level[CoefficientList[Series[f[z,u],{z,0,nn}],{z,u}],{2}]],1]//Grid (* Geoffrey Critzer, May 19 2014 *)

Formula

T(n,k) = 3*2^(n-k-1)*binomial(n-1,k).
G.f.: (1 - (y - 1)*x)/(1 - (y + 2)*x). Generally for the number of length n words with k levels on an m-ary alphabet (m>1): (1 - (y - 1)*x)/(1 - (y + m - 1)*x). - Geoffrey Critzer, May 19 2014

A178756 Rectangular array T(n,k) = binomial(n,2)*k*n^(k-1) read by antidiagonals.

Original entry on oeis.org

1, 4, 3, 12, 18, 6, 32, 81, 48, 10, 80, 324, 288, 100, 15, 192, 1215, 1536, 750, 180, 21, 448, 4374, 7680, 5000, 1620, 294, 28, 1024, 15309, 36864, 31250, 12960, 3087, 448, 36, 2304, 52488, 172032, 187500, 97200, 28812, 5376, 648, 45
Offset: 2

Views

Author

Geoffrey Critzer, Dec 26 2010

Keywords

Comments

T(n,k) is the sum of the digits in all n-ary words of length k. That is, sequences of k digits taken on an alphabet of {0,1,2,...,n-1}.
Note the rectangle is indexed begining from n = 2 (binary sequences) which is A001787.

Examples

			1,4,12,32,80,192,448,1024
3,18,81,324,1215,4374,15309,52488
6,48,288,1536,7680,36864,172032,786432
10,100,750,5000,31250,187500,1093750,6250000
15,180,1620,12960,97200,699840,4898880,33592320
		

Crossrefs

Cf. A036290 (ternary sequences), A034967 (decimal digits).

Programs

  • GAP
    T:=Flat(List([3..10], n-> List([2..n-1], k-> Binomial(k,2)*(n-k)* k^(n-k-1) ))); # G. C. Greubel, Jan 24 2019
  • Magma
    [[Binomial(k,2)*(n-k)*k^(n-k-1): k in [2..n-1]]: n in [3..10]]; // G. C. Greubel, Jan 24 2019
    
  • Maple
    T:= (n, k)-> binomial(n, 2)*k*n^(k-1):
    seq(seq(T(n, 1+d-n), n=2..d), d=2..14); # Alois P. Heinz, Jan 17 2013
  • Mathematica
    Table[Range[8]! Rest[CoefficientList[Series[Binomial[n,2]x Exp[n x],{x,0,8}],x]],{n,2,10}]//Grid
    T[n_, k_]:= Binomial[n, 2]*k*n^(k-1); Table[T[k,n-k], {n,2,10}, {k, 2, n-1}]//Flatten (* G. C. Greubel, Jan 24 2019 *)
  • PARI
    {T(n,k) = binomial(n,2)*k*n^(k-1)};
    for(n=2,10, for(k=2,n-1, print1(T(k,n-k), ", "))) \\ G. C. Greubel, Jan 24 2019
    
  • Sage
    [[binomial(k,2)*(n-k)*k^(n-k-1) for k in (2..n-1)] for n in (3..10)] # G. C. Greubel, Jan 24 2019
    

Formula

E.g.f. for row n: binomial(n,2)*x*exp(n*x).

A265121 Integers k such that k*3^k + 2 is prime.

Original entry on oeis.org

0, 1, 3, 5, 11, 15, 17, 153, 169, 273, 317, 373, 923, 1403, 1969, 2349, 7809, 10313, 12291, 24865, 41289
Offset: 1

Views

Author

Altug Alkan, Dec 01 2015

Keywords

Comments

Initial corresponding primes are 2, 5, 83 and 1217.
How do this sequence and A006552 compare asymptotically?
a(22) > 10^5. - Michael S. Branicky, Oct 08 2024

Examples

			a(3) = 3 because 3^3 * 3 + 2 = 83 is prime.
		

Crossrefs

Programs

  • Magma
    [n: n in [0..400] | IsPrime(n*3^n+2)]; // Vincenzo Librandi, Dec 02 2015
  • Mathematica
    Select[Range[0, 10000], PrimeQ[# 3^# + 2] &] (* Vincenzo Librandi, Dec 02 2015 *)
  • PARI
    for(n=0, 1e6, if(ispseudoprime(3^n*n + 2), print1(n, ", ")));
    

Extensions

a(1) = 0 added by Vincenzo Librandi, Dec 02 2015
a(21) from Michael S. Branicky, May 16 2023

A289399 Total path length of the complete ternary tree of height n.

Original entry on oeis.org

0, 3, 21, 102, 426, 1641, 6015, 21324, 73812, 250959, 841449, 2790066, 9167358, 29893557, 96855123, 312088728, 1000836264, 3196219035, 10169787837, 32252755710, 101988443730, 321655860993, 1012039172391, 3177332285412, 9955641160956, 31137856397031
Offset: 0

Views

Author

F. Skerman, Jul 05 2017

Keywords

Examples

			The complete ternary tree of height two consists of one root node (at depth 0), three children of the root (at depth 1) and 9 leaf nodes (at depth 2). Thus a(2) = 0 + 3*1 + 9*2 = 21.
		

Crossrefs

Partial sums of A036290.

Programs

  • PARI
    concat(0, Vec(3*x / ((1 - x)*(1 - 3*x)^2) + O(x^30))) \\ Colin Barker, Jul 05 2017

Formula

From Colin Barker, Jul 05 2017: (Start)
G.f.: 3*x / ((1 - x)*(1 - 3*x)^2).
a(n) = 3*(1 - 3^n + 2*3^n*n) / 4.
a(n) = 7*a(n-1) - 15*a(n-2) + 9*a(n-3) for n>2.
(End)

A273893 Denominator of n/3^n.

Original entry on oeis.org

1, 3, 9, 9, 81, 243, 243, 2187, 6561, 2187, 59049, 177147, 177147, 1594323, 4782969, 4782969, 43046721, 129140163, 43046721, 1162261467, 3486784401, 3486784401, 31381059609, 94143178827, 94143178827, 847288609443, 2541865828329, 282429536481, 22876792454961
Offset: 0

Views

Author

Paul Curtz, Jun 02 2016

Keywords

Comments

The reduced values are Ms(n) = 0, 1/3, 2/9, 1/9, 4/81, 5/243, 2/243, 7/2187, 8/6561, 1/2187, ... .
Numerators: 0, 1, 2, 1, 4, ... = A038502(n).
Ms(-n) = 0, -3, -18, ... = - A036290(n).
Difference table of Ms(n):
0, 1/3, 2/9, 1/9, 4/81, 5/243, 2/243, ...
1/3, -1/9, -1/9, -5/81, -7/243, -1/81, ...
-4/9, 0, 4/81, 8/243, 4/243, ...
4/9, 4/81, -4/243, -4/243, ...
-32/81, -16/243, 0, ...
80/243, 16/243, ...
-64/243, ...
etc.
The difference table of O(n) = n/2^n (Oresme numbers) has its 0's on the main diagonal. Here the 0's appear every two rows. For n/4^n,they appear every three rows. (The denominators of O(n) are 2^A093048(n)).
All terms are powers of 3 (A000244).

Crossrefs

Programs

  • Mathematica
    Table[Denominator[n/3^n], {n, 0, 28}] (* Michael De Vlieger, Jun 03 2016 *)
  • PARI
    a(n) = denominator(n/3^n) \\ Felix Fröhlich, Jun 07 2016
  • Sage
    [1] + [3^(n-n.valuation(3)) for n in [1..30]] # Tom Edgar, Jun 02 2016
    

Formula

For n>0, a(n) = 3^(n - valuation(n,3)) = 3^(n - A007949(n)). - Tom Edgar, Jun 02 2016
a(3n+1) = 3^(3n+1), a(3n+2) = 3^(3n+2).
a(3n+6) = 27*(3n+3).
From Peter Bala, Feb 25 2019: (Start)
a(n) = 3^n/gcd(n,3^n).
O.g.f.: 1 + F(3*x) - (2/3)*F((3*x)^3) - (2/9)*F((3*x)^9) - (2/27)*F((3*x)^27) - ..., where F(x) = x/(1 - x).
O.g.f. for reciprocals: Sum_{n >= 0} x^n/a(n) = 1 + F((x/3)) + 2*( F((x/3)^3) + 3*F((x/3)^9) + 9*F((x/3)^27) + ... ). Cf. A038502. (End)

A352081 Numbers of the form k*p^k, where k>1 and p is a prime.

Original entry on oeis.org

8, 18, 24, 50, 64, 81, 98, 160, 242, 324, 338, 375, 384, 578, 722, 896, 1029, 1058, 1215, 1682, 1922, 2048, 2500, 2738, 3362, 3698, 3993, 4374, 4418, 4608, 5618, 6591, 6962, 7442, 8978, 9604, 10082, 10240, 10658, 12482, 13778, 14739, 15309, 15625, 15842, 18818
Offset: 1

Views

Author

Amiram Eldar, Apr 16 2022

Keywords

Comments

Each term in this sequence has a single presentation in the form k*p^k.

Examples

			8 is a term since 8 = 2*2^2.
18 is a term since 18 = 2*3^2.
24 is a term since 24 = 3*2^3.
		

Crossrefs

Subsequences: A036289 \ {0, 2}, A036290 \ {0, 3}, A036291 \ {0, 5}, A036293 \ {0, 7}, A073113 \ {2}, A079704, A100042, A104126.

Programs

  • Mathematica
    addP[p_, n_] := Module[{k = 2, s = {}, m}, While[(m = k*p^k) <= n, k++; AppendTo[s, m]]; s]; seq[max_] := Module[{m = Floor[Sqrt[max/2]], s = {}, ps}, ps = Select[Range[m], PrimeQ]; Do[s = Join[s, addP[p, max]], {p, ps}]; Sort[s]]; seq[2*10^4]

Formula

Sum_{n>=1} 1/a(n) = -A143524 = gamma - B_1, where gamma is Euler's constant (A001620), and B_1 is Mertens's constant (A077761).

A004142 a(n) = n*(3^n - 2^n).

Original entry on oeis.org

0, 1, 10, 57, 260, 1055, 3990, 14413, 50440, 172539, 580250, 1926089, 6328140, 20619703, 66732190, 214742085, 687698960, 2193154547, 6968850210, 22073006401, 69714716500, 219623377071, 690291036710
Offset: 0

Views

Author

Keywords

Crossrefs

Equals n * A001047(n).

Programs

  • Mathematica
    Table[n(3^n-2^n),{n,0,30}] (* or *) LinearRecurrence[{10,-37,60,-36},{0,1,10,57},30] (* Harvey P. Dale, Sep 04 2023 *)

Formula

From R. J. Mathar, Feb 10 2022: (Start)
G.f.: -x*(-1+6*x^2) / ( (3*x-1)^2*(2*x-1)^2 ).
a(n) = A036290(n) - A036289(n). (End)

A134574 Array, a(n,k) = total size of all n-length words on a k-letter alphabet, read by antidiagonals.

Original entry on oeis.org

1, 2, 2, 3, 8, 3, 4, 24, 18, 4, 5, 64, 81, 32, 5, 6, 160, 324, 192, 50, 6, 7, 384, 1215, 1024, 375, 72, 7, 8, 896, 4374, 5120, 2500, 648, 98, 8, 9, 2048, 15309, 24576, 15625, 5184, 1029, 128, 9, 10, 4608, 52488, 114688, 93750, 38880, 9604, 1536, 162, 10
Offset: 1

Views

Author

Ross La Haye, Jan 22 2008

Keywords

Examples

			a(2,2) = 8 because there are 2^2 = 4 2-length words on a 2 letter alphabet, each of size 2 and 2*4 = 8.
Array begins:
==================================================================
n\k|  1     2       3        4         5         6          7  ...
---|--------------------------------------------------------------
1  |  1     2       3        4         5         6          7  ...
2  |  2     8      18       32        50        72         98  ...
3  |  3    24      81      192       375       648       1029  ...
4  |  4    64     324     1024      2500      5184       9604  ...
5  |  5   160    1215     5120     15625     38880      84035  ...
6  |  6   384    4374    24576     93750    279936     705894  ...
7  |  7   896   15309   114688    546875   1959552    5764801  ...
8  |  8  2048   52488   524288   3125000  13436928   46118408  ...
9  |  9  4608  177147  2359296  17578125  90699264  363182463  ...
... - _Franck Maminirina Ramaharo_, Aug 07 2018
		

Crossrefs

Cf. a(n, 1) = a(1, k) = A000027(n); a(n, 2) = A036289(n); a(n, 3) = A036290(n); a(n, 4) = A018215(n); a(n, 5) = A036291(n); a(n, 6) = A036292(n); a(n, 7) = A036293(n); a(n, 8) = A036294(n); a(2, k) = A001105(k); a(3, k) = A117642(k); a(n, n) = A007778(n); a(n, n+1) = A066274(n+1): sum[a(i-1, n-i+1), {i, 1, n}] = A062807(n).

Programs

  • Mathematica
    t[n_, k_] := Sum[k^n, {j, n}]; Table[ t[n - k + 1, k], {n, 10}, {k, n}] // Flatten (* Robert G. Wilson v, Aug 07 2018 *)

Formula

a(n,k) = n*k^n.
O.g.f. (by columns): (k*x)/(-1+k*x)^2.
E.g.f. (by columns): k*x*exp(k*x).
a(n,k) = Sum[k^n,{j,1,n}] = n*Sum[C(n,m)*(k-1)^m,{m,0,n}]. - Ross La Haye, Jan 26 2008
Previous Showing 11-18 of 18 results.