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 10 results.

A004488 Tersum n + n.

Original entry on oeis.org

0, 2, 1, 6, 8, 7, 3, 5, 4, 18, 20, 19, 24, 26, 25, 21, 23, 22, 9, 11, 10, 15, 17, 16, 12, 14, 13, 54, 56, 55, 60, 62, 61, 57, 59, 58, 72, 74, 73, 78, 80, 79, 75, 77, 76, 63, 65, 64, 69, 71, 70, 66, 68, 67, 27, 29, 28, 33, 35, 34, 30, 32, 31, 45, 47, 46, 51
Offset: 0

Views

Author

Keywords

Comments

Could also be described as "Write n in base 3, then replace each digit with its base-3 negative" as with A048647 for base 4. - Henry Bottomley, Apr 19 2000
a(a(n)) = n, a self-inverse permutation of the nonnegative integers. - Reinhard Zumkeller, Dec 19 2003
First 3^n terms of the sequence form a permutation s(n) of 0..3^n-1, n>=1; the number of inversions of s(n) is A016142(n-1). - Gheorghe Coserea, Apr 23 2018

Crossrefs

Programs

  • Haskell
    a004488 0 = 0
    a004488 n = if d == 0 then 3 * a004488 n' else 3 * a004488 n' + 3 - d
                where (n', d) = divMod n 3
    -- Reinhard Zumkeller, Mar 12 2014
    
  • Maple
    a:= proc(n) local t, r, i;
          t, r:= n, 0;
          for i from 0 while t>0 do
            r:= r+3^i *irem(2*irem(t, 3, 't'), 3)
          od; r
        end:
    seq(a(n), n=0..80);  # Alois P. Heinz, Sep 07 2011
  • Mathematica
    a[n_] := FromDigits[Mod[3-IntegerDigits[n, 3], 3], 3]; Table[a[n], {n, 0, 66}] (* Jean-François Alcover, Mar 03 2014 *)
  • PARI
    a(n) = my(b=3); fromdigits(apply(d->(b-d)%b, digits(n, b)), b);
    vector(67, i, a(i-1))  \\ Gheorghe Coserea, Apr 23 2018
    
  • Python
    from sympy.ntheory.factor_ import digits
    def a(n): return int("".join([str((3 - i)%3) for i in digits(n, 3)[1:]]), 3) # Indranil Ghosh, Jun 06 2017

Formula

Tersum m + n: write m and n in base 3 and add mod 3 with no carries, e.g., 5 + 8 = "21" + "22" = "10" = 1.
a(n) = Sum(3-d(i)-3*0^d(i): n=Sum(d(i)*3^d(i): 0<=d(i)<3)). - Reinhard Zumkeller, Dec 19 2003
a(3*n) = 3*a(n), a(3*n+1) = 3*a(n)+2, a(3*n+2) = 3*a(n)+1. - Robert Israel, May 09 2014

A078122 Infinite lower triangular matrix, M, that satisfies [M^3](i,j) = M(i+1,j+1) for all i,j>=0 where [M^n](i,j) denotes the element at row i, column j, of the n-th power of matrix M, with M(0,k)=1 and M(k,k)=1 for all k>=0.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 12, 9, 1, 1, 93, 117, 27, 1, 1, 1632, 3033, 1080, 81, 1, 1, 68457, 177507, 86373, 9801, 243, 1, 1, 7112055, 24975171, 15562314, 2371761, 88452, 729, 1, 1, 1879090014, 8786827629, 6734916423, 1291958181, 64392813, 796797, 2187, 1
Offset: 0

Views

Author

Paul D. Hanna, Nov 18 2002

Keywords

Comments

M also satisfies: [M^(3k)](i,j) = [M^k](i+1,j+1) for all i,j,k >=0; thus [M^(3^n)](i,j) = M(i+n,j+n) for all n >= 0.
Conjecture: the sum of the n-th row equals the number of partitions of 3^n into powers of 3 (A078125).

Examples

			The cube of the matrix is the same matrix excluding the first row and column:
  [1, 0, 0, 0]^3 = [ 1,  0, 0, 0]
  [1, 1, 0, 0]     [ 3,  1, 0, 0]
  [1, 3, 1, 0]     [12,  9, 1, 0]
  [1,12, 9, 1]     [93,117,27, 1]
		

Crossrefs

Programs

  • Maple
    S:= proc(i, j) option remember;
           add(M(i, k)*M(k, j), k=0..i)
        end:
    M:= proc(i, j) option remember; `if`(j=0 or i=j, 1,
           add(S(i-1, k)*M(k, j-1), k=0..i-1))
        end:
    seq(seq(M(n,k), k=0..n), n=0..10);  # Alois P. Heinz, Feb 27 2015
  • Mathematica
    m[i_, j_] := m[i, j]=If[j==0||i==j, 1, m3[i-1, j-1]]; m2[i_, j_] := m2[i, j]=Sum[m[i, k]m[k, j], {k, j, i}]; m3[i_, j_] := m3[i, j]=Sum[m[i, k]m2[k, j], {k, j, i}]; Flatten[Table[m[i, j], {i, 0, 8}, {j, 0, i}]]

Formula

M(1, j) = A078124(j), M(j+1, j)=3^j, M(j+2, j) = A016142(j).
M(n, k) = the coefficient of x^(3^n - 3^(n-k)) in the power series expansion of 1/Product_{j=0..n-k}(1-x^(3^j)) whenever 0<=k0 (conjecture).

A263950 Array read by antidiagonals: T(n,k) is the number of lattices L in Z^k such that the quotient group Z^k / L is C_n.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 4, 7, 1, 1, 6, 13, 15, 1, 1, 6, 28, 40, 31, 1, 1, 12, 31, 120, 121, 63, 1, 1, 8, 91, 156, 496, 364, 127, 1, 1, 12, 57, 600, 781, 2016, 1093, 255, 1, 1, 12, 112, 400, 3751, 3906, 8128, 3280, 511, 1, 1, 18, 117, 960, 2801, 22932, 19531, 32640
Offset: 1

Views

Author

Álvar Ibeas, Oct 30 2015

Keywords

Comments

All the enumerated lattices have full rank k, since the quotient group is finite.
For m>=1, T(n,k) is the number of lattices L in Z^k such that the quotient group Z^k / L is C_nm x (C_m)^(k-1); and also, (C_nm)^(k-1) x C_m.
Also, number of subgroups of (C_n)^k isomorphic to C_n (and also, to (C_n)^{k-1}), cf. [Butler, Lemma 1.4.1].
T(n,k) is the sum of the divisors d of n^(k-1) such that n^(k-1)/d is k-free. Namely, the coefficient in n^(-(k-1)*s) of the Dirichlet series zeta(s) * zeta(s-1) / zeta(ks).
Also, number of isomorphism classes of connected (C_n)-fold coverings of a connected graph with circuit rank k.
Columns are multiplicative functions.

Examples

			There are 7 = A160870(4,2) lattices of volume 4 in Z^2. Among them, only one (<(2,0), (0,2)>) gives the quotient group C_2 x C_2, whereas the rest give C_4. Hence, T(4,2) = 6 and T(1,2) = 1.
Array begins:
      k=1    k=2    k=3    k=4    k=5    k=6
n=1     1      1      1      1      1      1
n=2     1      3      7     15     31     63
n=3     1      4     13     40    121    364
n=4     1      6     28    120    496   2016
n=5     1      6     31    156    781   3906
n=6     1     12     91    600   3751  22932
		

References

  • Lynne M. Butler, Subgroup lattices and symmetric functions. Mem. Amer. Math. Soc., Vol. 112, No. 539, 1994.

Crossrefs

Programs

  • Mathematica
    f[p_, e_, k_] := p^((k - 1)*(e - 1))*(p^k - 1)/(p - 1); T[n_, 1] = T[1, k_] = 1; T[n_, k_] := Times @@ (f[First[#], Last[#], k] & /@ FactorInteger[n]); Table[T[n - k + 1, k], {n, 1, 11}, {k, 1, n}] // Flatten (* Amiram Eldar, Nov 08 2022 *)

Formula

T(n,k) = J_k(n) / J_1(n) = (Sum_{d|n} mu(n/d) * d^k) / phi(n).
T(n,k) = n^(k-1) * Product_{p|n, p prime} (p^k - 1) / ((p - 1) * p^(k-1)).
Dirichlet g.f. of k-th column: zeta(s-k+1) * Product_{p prime} (1 + p^(-s) + p^(1-s) + ... + p^(k-2-s)).
If n is squarefree, T(n,k) = A160870(n,k) = A000203(n^(k-1)).
From Amiram Eldar, Nov 08 2022: (Start)
Sum_{i=1..n} T(i, k) ~ c * n^k, where c = (1/k) * Product_{p prime} (1 + (p^(k-1)-1)/((p-1)*p^k)).
Sum_{i>=1} 1/T(i, k) = zeta(k-1)*zeta(k) * Product_{p prime} (1 - 2/p^k + 1/p^(2*k-1)), for k > 2. (End)
T(n,k) = (1/n) * Sum_{d|n} mu(n/d)*sigma(d^k). - Ridouane Oudra, Apr 03 2025

A016163 Expansion of 1/((1-5*x)*(1-9*x)).

Original entry on oeis.org

1, 14, 151, 1484, 13981, 128954, 1176211, 10664024, 96366841, 869254694, 7833057871, 70546348964, 635161281301, 5717672234834, 51465153629131, 463216900240304, 4169104690053361, 37522705149933374, 337708161046665991
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

Formula

a(n) = ((7+sqrt4)^n - (7-sqrt4)^n)/4. Offset 1. a(3)=151. - Al Hakanson (hawkuu(AT)gmail.com), Dec 31 2008
a(n) = 14*a(n-1) - 45*a(n-2). - Philippe Deléham, Jan 01 2009
a(0)=1, a(n) = 9*a(n-1) + 5^n. - Vincenzo Librandi, Feb 09 2011
From G. C. Greubel, Nov 09 2024: (Start)
a(n) = (9^(n+1) - 5^(n+1))/4.
E.g.f.: (1/4)*(9*exp(9*x) - 5*exp(5*x)). (End)

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

Original entry on oeis.org

0, 3, 36, 351, 3240, 29403, 265356, 2390391, 21520080, 193700403, 1743362676, 15690441231, 141214502520, 1270932117003, 11438393835996, 102945558872871, 926510072902560, 8338590785263203, 75047317454789316, 675425858255365311
Offset: 0

Views

Author

Keywords

Comments

Sum of all base-3 numbers with length at most n. - Alois P. Heinz, Feb 23 2020

Crossrefs

Programs

Formula

a(n) = C(3^n,2), n>=0. - Zerinvary Lajos, Jan 07 2008
a(0) = 0, a(1)=3, a(n)=12*a(n-1)-27*a(n-2). - Harvey P. Dale, Oct 07 2012
G.f.: 3*x / ( (9*x-1)*(3*x-1) ). a(n) = 3*A016142(n-1). - R. J. Mathar, Mar 24 2013

A059410 J_n(9) (see A059379).

Original entry on oeis.org

0, 6, 72, 702, 6480, 58806, 530712, 4780782, 43040160, 387400806, 3486725352, 31380882462, 282429005040, 2541864234006, 22876787671992, 205891117745742, 1853020145805120, 16677181570526406, 150094634909578632, 1350851716510730622, 12157665455570144400, 109418989121052006006
Offset: 0

Views

Author

N. J. A. Sloane, Jan 30 2001

Keywords

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 199, #3.

Crossrefs

Programs

Formula

a(n) = 9^n - 3^n; a(n) = 12*a(n-1) - 27*a(n-2) for n > 1. - Vincenzo Librandi, Jun 03 2011
From Vincenzo Librandi, Oct 04 2014: (Start)
a(n) = 3^n*(3^n-1) = A000244(n)*A024023(n).
G.f.: 6*x/((1-3*x)*(1-9*x)). (End)
a(n) = 6*A016142(n). - R. J. Mathar, Nov 23 2018
E.g.f.: 2*exp(6*x)*sinh(3*x). - Elmo R. Oliveira, Mar 31 2025

A226804 Expansion of 1/((1-3x)(1-9x)(1-27x)(1-81x)).

Original entry on oeis.org

1, 120, 10890, 914760, 74987451, 6098153040, 494603769780, 40080553611120, 3247001410058901, 263019982119962760, 21304965990387308670, 1725711626112542281080, 139782894999601166334351, 11322421333652608793333280, 917116312670388314093059560
Offset: 0

Views

Author

Vincenzo Librandi, Jul 11 2013

Keywords

Crossrefs

Programs

  • Magma
    m:=25; R:=PowerSeriesRing(Integers(), m); Coefficients(R!(1/((1-3*x)*(1-9*x)*(1-27*x)*(1-81*x))));
    
  • Magma
    I:=[1,120,10890,914760]; [n le 4 select I[n] else 120*Self(n-1)-3510*Self(n-2)+29160*Self(n-3)-59049*Self(n-4): n in [1..25]];
  • Mathematica
    CoefficientList[Series[1 / ((1 - 3 x) (1 - 9 x) (1 - 27 x) (1 - 81 x)), {x, 0, 20}], x]
    LinearRecurrence[{120,-3510,29160,-59049},{1,120,10890,914760},20] (* Harvey P. Dale, Sep 21 2016 *)

Formula

G.f.: 1/((1-3*x)*(1-9*x)*(1-27*x)*(1-81*x)).
a(n) = 3^n*(3^(n+1)-1)*(3^(n+2)-1)*(3^(n+3)-1)/416.
a(0)=1, a(1)=120, a(2)=10890, a(3)=914760; for n>3, a(n) = 120*a(n-1) -3510*a(n-2) +29160*a(n-3) -59049*a(n-4).
a(n) -108*a(n-1) +2187*a(n-2) = A016142(n) with a(-1)=a(-2)=0. [Bruno Berselli, Jul 11 2013]

A219205 a(n) = 3^(n-1)*(3^n - 1), n >= 0.

Original entry on oeis.org

0, 2, 24, 234, 2160, 19602, 176904, 1593594, 14346720, 129133602, 1162241784, 10460294154, 94143001680, 847288078002, 7625595890664, 68630372581914, 617673381935040, 5559060523508802, 50031544969859544, 450283905503576874
Offset: 0

Views

Author

Jon Perry, Nov 14 2012

Keywords

Comments

Last digit has period 4: 0, 2, 4, 4.

Crossrefs

Programs

  • JavaScript
    for (j=0;j<20;j++) document.write((Math.pow(3,j)-1)*Math.pow(3,j-1)+", ");
    
  • Mathematica
    LinearRecurrence[{12, -27}, {0, 2}, 20] (* Hugo Pfoertner, Feb 14 2024 *)
  • Maxima
    A219205(n):=3^(n-1)*(3^n - 1)$ makelist(A219205(n),n,0,30); /* Martin Ettl, Nov 15 2012 */

Formula

a(n) = 2 * A016142(n-1).
a(n) = 12*a(n-1)-27*a(n-2). G.f.: 2*x/((3*x-1)*(9*x-1)). [Colin Barker, Nov 23 2012]

Extensions

a(19) corrected by Colin Barker, Nov 23 2012

A017897 Expansion of 1/((1-3*x)*(1-5*x)*(1-9*x)).

Original entry on oeis.org

1, 17, 202, 2090, 20251, 189707, 1745332, 15900020, 144066901, 1301455397, 11737424062, 105758621150, 952437144751, 8574983669087, 77190104636392, 694787214149480, 6253466332501801, 56283104147438777, 506557473488982322, 4559064943373269010
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    m:=20; R:=PowerSeriesRing(Integers(), m); Coefficients(R!(1/((1-3*x)*(1-5*x)*(1-9*x)))); // Vincenzo Librandi, Jul 01 2013
    
  • Magma
    I:=[1, 17, 202]; [n le 3 select I[n] else 17*Self(n-1)-87*Self(n-2)+135*Self(n-3): n in [1..20]]; // Vincenzo Librandi, Jul 01 2013
    
  • Maple
    a:= n -> (Matrix(3, (i,j)-> if (i=j-1) then 1 elif j=1 then [17, -87, 135][i] else 0 fi)^n)[1,1]: seq (a(n), n=0..25); # Alois P. Heinz, Aug 04 2008
  • Mathematica
    CoefficientList[Series[1 / ((1 - 3 x) (1 - 5 x) (1 - 9 x)), {x, 0, 30}], x] (* Vincenzo Librandi, Jul 01 2013 *)
    LinearRecurrence[{17,-87,135},{1,17,202},30] (* Harvey P. Dale, Sep 26 2014 *)
    a[n_]:=(9^(n+2) - 3*5^(n+2) + 2*3^(n+2))/24; Array[a, 30, 0] (* Stefano Spezia, Oct 04 2018 *)
  • PARI
    a(n) = (9^(n+2) - 3*5^(n+2) + 2*3^(n+2))/24; \\ Joerg Arndt, Aug 13 2013
    
  • SageMath
    def A017897(n): return (9^(n+2) -3*5^(n+2) +2*3^(n+2))//24
    [A017897(n) for n in range(41)] # G. C. Greubel, Nov 09 2024

Formula

a(n) = term (1,1) in the 3 X 3 matrix [17,1,0; -87,0,1; 135,0,0]^n. - Alois P. Heinz, Aug 04 2008
From Vincenzo Librandi, Jul 01 2013: (Start)
a(n) = 17*a(n-1) - 87*a(n-2) + 135*a(n-3); a(0)=1, a(1)=17, a(2)=202.
a(n) = 14*a(n-1) - 45*a(n-2) + 3^n. (End)
a(n) = (9^(n+2) - 3*5^(n+2) + 2*3^(n+2))/24. - Yahia Kahloune, Aug 13 2013
E.g.f.: exp(3*x)*(6 - 25*exp(2*x) + 27*exp(6*x))/8. - Stefano Spezia, Nov 09 2024

A227524 Expansion of 1/((1-3x)(1-9x)(1-27x)).

Original entry on oeis.org

1, 39, 1170, 32670, 891891, 24169509, 653373540, 17648258940, 476567558181, 12867905191779, 347438670325110, 9380891170278810, 253284485241566871, 6838684914320250849, 184644527001833063880, 4985402537886183692280, 134605871302457221445961
Offset: 0

Views

Author

Vincenzo Librandi, Jul 17 2013

Keywords

Crossrefs

Programs

  • Magma
    m:=25; R:=PowerSeriesRing(Integers(), m); Coefficients(R!(1/((1-3*x)*(1-9*x)*(1-27*x))));
    
  • Magma
    I:=[1, 39, 1170]; [n le 3 select I[n] else 39*Self(n-1)-351*Self(n-2)+729*Self(n-3): n in [1..25]];
  • Mathematica
    CoefficientList[Series[1 / ((1 - 3 x) (1 - 9 x) (1 - 27 x)), {x, 0, 30}], x]
    LinearRecurrence[{39,-351,729},{1,39,1170},20] (* Harvey P. Dale, Jul 04 2022 *)

Formula

G.f.: 1/((1-3*x)*(1-9*x)*(1-27*x)).
a(n) = 3^n*(3^(n+1)-1)*(3^(n+2)-1)/16.
a(0)=1, a(1)=39, a(2)=1170; for n>2, a(n) = 39*a(n-1)-351*a(n-2)+729*a(n-3).
a(n)-27*a(n-1) = A016142(n), with a(-1)=0; a(n) = A226804(n)-81*A226804(n-1), with A226804(-1)=0. [Bruno Berselli, Jul 17 2013]
Showing 1-10 of 10 results.