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

A155118 Array T(n,k) read by antidiagonals: the k-th term of the n-th iterated differences of A140429.

Original entry on oeis.org

0, 1, 1, 1, 2, 3, 3, 4, 6, 9, 5, 8, 12, 18, 27, 11, 16, 24, 36, 54, 81, 21, 32, 48, 72, 108, 162, 243, 43, 64, 96, 144, 216, 324, 486, 729, 85, 128, 192, 288, 432, 648, 972, 1458, 2187, 171, 256, 384, 576, 864, 1296, 1944, 2916, 4374, 6561, 341, 512, 768, 1152, 1728, 2592, 3888, 5832, 8748, 13122, 19683
Offset: 0

Views

Author

Paul Curtz, Jan 20 2009

Keywords

Comments

Deleting column k=0 and reading by antidiagonals yields A036561.
Deleting column k=0 and reading the antidiagonals downwards yields A175840.

Examples

			The array starts in row n=0 with columns k>=0 as:
   0   1    3    9    27    81    243    729    2187  ... A140429;
   1   2    6   18    54   162    486   1458    4374  ... A025192;
   1   4   12   36   108   324    972   2916    8748  ... A003946;
   3   8   24   72   216   648   1944   5832   17496  ... A080923;
   5  16   48  144   432  1296   3888  11664   34992  ... A257970;
  11  32   96  288   864  2592   7776  23328   69984  ...
  21  64  192  576  1728  5184  15552  46656  139968  ...
Antidiagonal triangle begins as:
   0;
   1,   1;
   1,   2,   3;
   3,   4,   6,   9;
   5,   8,  12,  18,  27;
  11,  16,  24,  36,  54,  81;
  21,  32,  48,  72, 108, 162, 243;
  43,  64,  96, 144, 216, 324, 486, 729;
  85, 128, 192, 288, 432, 648, 972, 1458, 2187; - _G. C. Greubel_, Mar 25 2021
		

Crossrefs

Programs

  • Magma
    t:= func< n,k | k eq 0 select (2^(n-k) -(-1)^(n-k))/3 else 2^(n-k)*3^(k-1) >;
    [t(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Mar 25 2021
    
  • Maple
    T:=proc(n,k)if(k>0)then return 2^n*3^(k-1):else return (2^n - (-1)^n)/3:fi:end:
    for d from 0 to 8 do for m from 0 to d do print(T(d-m,m)):od:od: # Nathaniel Johnston, Apr 13 2011
  • Mathematica
    t[n_, k_]:= If[k==0, (2^(n-k) -(-1)^(n-k))/3, 2^(n-k)*3^(k-1)];
    Table[t[n, k], {n,0,12}, {k,0,n}]//Flatten (* G. C. Greubel, Mar 25 2021 *)
  • Sage
    def A155118(n,k): return (2^(n-k) -(-1)^(n-k))/3 if k==0 else 2^(n-k)*3^(k-1)
    flatten([[A155118(n,k) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Mar 25 2021

Formula

For the square array:
T(n,k) = 2^n*3^(k-1), k>0.
T(n,k) = T(n-1,k+1) - T(n-1,k), n>0.
Rows:
T(0,k) = A140429(k) = A000244(k-1).
T(1,k) = A025192(k).
T(2,k) = A003946(k).
T(3,k) = A080923(k+1).
T(4,k) = A257970(k+3).
Columns:
T(n,0) = A001045(n) (Jacobsthal numbers J_{n}).
T(n,1) = A000079(n).
T(n,2) = A007283(n).
T(n,3) = A005010(n).
T(n,4) = A175806(n).
T(0,k) - T(k+1,0) = 4*A094705(k-2).
From G. C. Greubel, Mar 25 2021: (Start)
For the antidiagonal triangle:
t(n, k) = T(n-k, k).
t(n, k) = (2^(n-k) - (-1)^(n-k))/3 (J_{n-k}) if k = 0 else 2^(n-k)*3^(k-1).
Sum_{k=0..n} t(n, k) = 3^n - J_{n+1}, where J_{n} = A001045(n).
Sum_{k=0..n} t(n, k) = A004054(n-1) for n >= 1. (End)

Extensions

a(22) - a(57) from Nathaniel Johnston, Apr 13 2011

A178501 Zero followed by powers of ten.

Original entry on oeis.org

0, 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000, 10000000000, 100000000000, 1000000000000, 10000000000000, 100000000000000, 1000000000000000, 10000000000000000, 100000000000000000, 1000000000000000000, 10000000000000000000, 100000000000000000000
Offset: 0

Views

Author

Reinhard Zumkeller, May 28 2010

Keywords

Comments

The sequence S consisting of the nonnegative numbers arranged in lexicographic order according to their decimal expansion begins 0, 1, 10, 100, 1000, ..., 2, 20, 200, 2000, ..., 3, 30, ... does not have an OEIS entry, since there are uncountably many terms before 2 appears (or even before 100000010000 appears). However, S does begin with the present sequence. - N. J. A. Sloane, Dec 09 2024
a(n)^k + reverse(a(n))^k is a palindrome for any positive integer k. - Bui Quang Tuan, Mar 31 2015

Crossrefs

Cf. A093136, A131577, A140429, A178500; subsequence of A029793.
The powers of 10, A011557, is a subsequence.

Programs

Formula

a(n+1) = A011557(n).
a(n) = A178500(n)/10.
From Paul Barry, Jul 09 2003: (Start)
a(n) = (10^n - 0^n)/10.
E.g.f.: exp(5*x)*sinh(5*x)/5.
Binomial transform of A015577. (End)
G.f.: x/(1 - 10*x). - Chai Wah Wu, Jun 17 2020
From Elmo R. Oliveira, Jul 21 2025: (Start)
a(n) = 10*a(n-1) for n > 1.
a(n) = A093136(n)/2 for n >= 1. (End)

Extensions

More terms from Elmo R. Oliveira, Jul 21 2025

A174980 Stern's diatomic series type ([0,1], 1).

Original entry on oeis.org

0, 0, 1, 0, 2, 1, 1, 0, 3, 2, 3, 1, 2, 1, 1, 0, 4, 3, 5, 2, 5, 3, 4, 1, 3, 2, 3, 1, 2, 1, 1, 0, 5, 4, 7, 3, 8, 5, 7, 2, 7, 5, 8, 3, 7, 4, 5, 1, 4, 3, 5, 2, 5, 3, 4, 1, 3, 2, 3, 1, 2, 1, 1, 0, 6, 5, 9, 4, 11, 7, 10, 3, 11, 8, 13, 5, 12, 7, 9, 2, 9, 7, 12, 5, 13, 8, 11, 3, 10, 7, 11, 4, 9, 5, 6, 1, 5, 4, 7, 3, 8
Offset: 0

Views

Author

Peter Luschny, Apr 03 2010

Keywords

Comments

A variant of Stern's diatomic series A002487. See the link [Luschny] and the Maple function below for the classification by types which is based on a generalization of Dijkstra's fusc function.
a(n) is also the number of superduperbinary integer partitions of n.
It appears that a(n) is equal to the multiplicative inverse of A002487(n+2) mod A002487(n+1). - Gary W. Adamson, Dec 23 2023

Examples

			The sequence splits into rows of length 2^k:
  0,
  0, 1,
  0, 2, 1, 1,
  0, 3, 2, 3, 1, 2, 1, 1,
  0, 4, 3, 5, 2, 5, 3, 4, 1, 3, 2, 3, 1, 2, 1, 1,
  ...
.
The first few partitions counted are:
[ 0], []
[ 1], []
[ 2], [[2]]
[ 3], []
[ 4], [[4], [2, 2]]
[ 5], [[4, 1]]
[ 6], [[4, 1, 1]]
[ 7], []
[ 8], [[8], [4, 4], [2, 2, 2, 2]]
[ 9], [[8, 1], [4, 4, 1]]
[10], [[8, 2], [8, 1, 1], [4, 4, 1, 1]]
[11], [[8, 2, 1]]
[12], [[8, 2, 2], [8, 2, 1, 1]]
[13], [[8, 2, 2, 1]]
[14], [[8, 2, 2, 1, 1]]
[15], []
[16], [[16], [8, 8], [4, 4, 4, 4], [2, 2, 2, 2, 2, 2, 2, 2]]
[17], [[16, 1], [8, 8, 1], [4, 4, 4, 4, 1]]
[18], [[16, 2], [8, 8, 2], [16, 1, 1], [8, 8, 1, 1], [4, 4, 4, 4, 1, 1]]
[19], [[16, 2, 1], [8, 8, 2, 1]]
[20], [[16, 4], [16, 2, 2], [8, 8, 2, 2], [16, 2, 1, 1], [8, 8, 2, 1, 1]]
[21], [[16, 4, 1], [16, 2, 2, 1], [8, 8, 2, 2, 1]]
[22], [[16, 4, 2], [16, 4, 1, 1], [16, 2, 2, 1, 1], [8, 8, 2, 2, 1, 1]]
[23], [[16, 4, 2, 1]]
[24], [[16, 4, 4], [16, 4, 2, 2], [16, 4, 2, 1, 1]]
		

Crossrefs

Programs

  • Maple
    SternDijkstra := proc(L, p, n) local k, i, len, M; len := nops(L); M := L; k := n; while k > 0 do M[1+(k mod len)] := add(M[i], i=1..len); k := iquo(k, len); od; op(p, M) end:
    a := n -> SternDijkstra([0,1], 1, n);
  • Mathematica
    a[0] = 0; a[n_?OddQ] := a[n] = a[(n-1)/2]; a[n_?EvenQ] := a[n] = a[n/2 - 1] + a[n/2] + Boole[ IntegerQ[ Log[2, n/2]]]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Jul 26 2013 *)
  • Python
    # Generating the partitions.
    def SDBinaryPartition(n):
        def Double(W, T):
            B = []
            for L in W:
                A = [a*2 for a in L]
                if T > 0: A += [1]*T
                B.append(A)
            return B
        if n == 2: return [[2]]
        if n <  4: return []
        h = n // 2
        H = SDBinaryPartition(h)
        B = Double(H, n % 2)
        if n % 2 == 0:
            H = SDBinaryPartition(h - 1)
            if H != []: B += Double(H, 2)
            if (n & (n - 1)) == 0: B.append([2]*h)
        return B
    for n in range(25): print([n], SDBinaryPartition(n)) # Peter Luschny, Sep 02 2019
  • SageMath
    def A174980(n):
        M = [0, 1]
        for b in n.bits():
            M[b] = M[0] + M[1]
        return M[0]
    print([A174980(n) for n in (0..100)]) # Peter Luschny, Nov 28 2017
    

Formula

Recursion: a(2n + 1) = a(n) and a(2n) = a(n - 1) + a(n) + [n = 2^k] for n = 1, a(0) = 0. [n = 2^k] is 1 if n is a power of 2, 0 otherwise.

A352502 a(n) is the number of integers k in the interval 0..n such that k and n-k can be added without carries in balanced ternary.

Original entry on oeis.org

1, 2, 2, 4, 4, 2, 4, 4, 6, 10, 8, 6, 10, 8, 2, 4, 4, 6, 10, 8, 6, 10, 8, 10, 16, 12, 18, 28, 20, 14, 22, 16, 10, 16, 12, 18, 28, 20, 14, 22, 16, 2, 4, 4, 6, 10, 8, 6, 10, 8, 10, 16, 12, 18, 28, 20, 14, 22, 16, 10, 16, 12, 18, 28, 20, 14, 22, 16, 18, 28, 20, 30
Offset: 0

Views

Author

Rémy Sigrist, Apr 28 2022

Keywords

Comments

Two integers can be added without carries in balanced ternary if they have no equal nonzero digit at the same position.
This sequence has connections with Gould's sequence (A001316); here we work with balanced ternary, there with binary.

Examples

			For n = 8:
- we consider the following cases:
              k|    0    1    2    3    4    5    6    7    8
      ---------+---------------------------------------------
        bter(k)|    0    1   1T   10   11  1TT  1T0  1T1  10T
      bter(8-k)|  10T  1T1  1T0  1TT   11   10   1T    1    0
       carries?|  no   yes  no   no   yes  no   no   yes  no
- so a(8) = 6.
		

Crossrefs

Cf. A001316, A059095, A140429, A353174 (corresponding k's).

Programs

  • PARI
    ok(u,v) = { while (u && v, my (uu=[0,+1,-1][1+u%3], vv=[0,+1,-1][1+v%3]); if (abs(uu+vv)>1, return (0)); u=(u-uu)/3; v=(v-vv)/3); return (1) }
    a(n) = sum(k=0, n, ok(n-k, k))

Formula

a(n) <= n+1 with equality iff n belongs to A140429.
a(3*n) = 3*a(n) - 2.
a(3*n+1) = a(3*n-1) + 2.

A376478 a(1) = 1, a(2) = 2, and a(n) = 3^(n-2) for n > 2.

Original entry on oeis.org

1, 2, 3, 9, 27, 81, 243, 729, 2187, 6561, 19683, 59049, 177147, 531441, 1594323, 4782969, 14348907, 43046721, 129140163, 387420489, 1162261467, 3486784401, 10460353203, 31381059609, 94143178827, 282429536481, 847288609443, 2541865828329, 7625597484987, 22876792454961
Offset: 1

Views

Author

Stefano Spezia, Sep 24 2024

Keywords

Comments

Graham's conjecture: also numbers k such sigma(k) - k = floor(k/2). See Guy.
Also the domination number of the n-Sierpinski gasket graph. - Eric W. Weisstein, Mar 10 2025

References

  • R. K. Guy, Unsolved Problems in Number Theory, Springer, 1st edition, 1981. See section B2.

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{3},{1,2,3},30]
  • Python
    def A376478(n): return n if n<3 else 3**(n-2) # Chai Wah Wu, Nov 13 2024

Formula

a(n) = 3*a(n-1) for n > 3.
G.f.: (1 - x - 3*x^2)/(1 - 3*x).
E.g.f.: (2 + exp(3*x) + 3*x)/3.

A126184 Number of hex trees with n edges and having no nonroot nodes of outdegree 2.

Original entry on oeis.org

1, 3, 10, 33, 108, 351, 1134, 3645, 11664, 37179, 118098, 373977, 1180980, 3720087, 11691702, 36669429, 114791256, 358722675, 1119214746, 3486784401, 10847773692, 33705582543, 104603532030, 324270949293, 1004193907488
Offset: 0

Views

Author

Emeric Deutsch, Dec 19 2006

Keywords

Comments

A hex tree is a rooted tree where each vertex has 0, 1, or 2 children and, when only one child is present, it is either a left child, or a middle child, or a right child (name due to an obvious bijection with certain tree-like polyhexes; see the Harary-Read reference).

Crossrefs

Programs

  • Maple
    1,seq(3^(n-2)*(n+8),n=1..28);

Formula

a(n) = A126183(n,0).
a(n) = (n+8)*3^(n-2) for n >= 1; a(0)=1.
G.f.: (1-3z+z^2)/(1-3z)^2.
From Paul Curtz, Mar 27 2022: (Start)
a(n+1) = 3*a(n) + A140429(n), for n >= 0; a(0)=1.
Binomial transform of A172481(n) for n >= 0.
Also, with a different offset, the binomial transform of A045891(n+2) for n >= 0. (End)

A287479 Expansion of g.f. (x + x^2)/(1 + 3*x^2).

Original entry on oeis.org

0, 1, 1, -3, -3, 9, 9, -27, -27, 81, 81, -243, -243, 729, 729, -2187, -2187, 6561, 6561, -19683, -19683, 59049, 59049, -177147, -177147, 531441, 531441, -1594323, -1594323, 4782969, 4782969, -14348907, -14348907, 43046721, 43046721, -129140163, -129140163, 387420489
Offset: 0

Views

Author

Keywords

Comments

This is the inverse binomial transform of A157241.
Successive differences of A157241 begin:
0, 1, 3, 3, -5, -21, -21, 43, 171, 171, ... = A157241
1, 2, 0, -8, -16, 0, 64, 128, 0, -512, ... = A088138
1, -2, -8, -8, 16, 64, 64, -128, -512, -512, ... = A138230
-3, -6, 0, 24, 48, 0, -192, -384, 0, 1536, ...
-3, 6, 24, 24, -48, -192, -192, 384, 1536, 1536, ...
9, 18, 0, -72, -144, 0, 576, 1152, 0, -4608, ...
9, -18, -72 -72, 144, 576, 576, -1152, -4608, -4608, ...
...
a(n) is the n-th term of the first column.
Successive differences of a(n) begin:
0, 1, 1, -3, -3, 9, 9, -27, -27, 81, ...
1, 0, -4, 0, 12, 0, -36, 0, 108, 0, ...
-1, -4, 4, 12, -12, -36, 36, 108, -108, -324, ...
-3, 8, 8, -24, -24, 72, 72, -216, -216, 648, ...
11, 0, -32, 0, 96, 0, -288, 0, 864, 0, ...
-11, -32, 32, 96, -96, -288, 288, 864, -864, -2592, ...
-21, 64, 64, -192, -192, 576, 576, -1728, -1728, 5184, ...
85, 0, -256, 0, 768, 0, -2304, 0, 6912, 0, ...
...
First column appears to be a subsequence of Jacobsthal numbers A001045 (the trisection A082311 is missing), second column is A104538, and third column is A137717.
a(n) = A128019(n-2) for n > 2. - Georg Fischer, Oct 23 2018

Crossrefs

Programs

  • Mathematica
    Join[{0}, LinearRecurrence[{0, -3}, {1, 1}, 40]]
    (* or, computation from b = A157241 : *)
    b[n_] := (Switch[Mod[n, 3], 0, (-1)^((n + 3)/3), 1, (-1)^((n + 5)/3), 2, (-1)^((n + 4)/3)*2]*2^n + 1)/3; tb = Table[b[n], {n, 0, 40}]; Table[ Differences[tb, n], {n, 0, 40}][[All, 1]]
  • PARI
    concat([0], Vec((x + x^2)/(1 + 3*x^2) + O(x^40))) \\ Felix Fröhlich, Oct 23 2018

Formula

a(n) = -3*a(n-2) for n > 2.
E.g.f.: (1 - cos(sqrt(3)*x) + sqrt(3)*sin(sqrt(3)*x))/3. - Stefano Spezia, Jul 15 2024

A155734 Binomial transform of A154879.

Original entry on oeis.org

3, 1, 3, 9, 27, 81, 243, 729, 2187, 6561, 19683, 59049, 177147, 531441, 1594323, 4782969, 14348907, 43046721, 129140163, 387420489, 1162261467, 3486784401, 10460353203, 31381059609, 94143178827, 282429536481, 847288609443, 2541865828329
Offset: 0

Views

Author

Paul Curtz, Jan 26 2009

Keywords

Comments

Binomial transform of the third differences of A001045.
The binomial transform of the first differences of A001045 is in A133494.
The binomial transform of the 2nd differences of A001045 is in A133494, with the sign of A133494(0) flipped.
The binomial transform of the p-th differences of A001045 is the number A077925(p-1) followed by A000244.

Crossrefs

Cf. A154879, A078008. Essentially the same as A140429 and A000244.

Programs

  • Maple
    read("transforms") ; A001045 := proc(n) option remember ; if n <= 1 then n; else procname(n-1)+2*procname(n-2) ; fi; end:
    a001045 := [seq(A001045(n),n=0..80) ] ; a154879 := DIFF(DIFF(DIFF(a001045))) ; BINOMIAL(a154879) ; # R. J. Mathar, Jul 23 2009

Formula

From Colin Barker, Apr 05 2012: (Start)
a(n) = 3*a(n-1) for n > 1.
G.f.: (3-8*x)/(1-3*x). (End)
G.f.: (1 - 2/G(0))/x where G(k) = 1 + 2^k/(1 - 2*x/(2*x + 2^k/G(k+1))); (recursively defined continued fraction). - Sergei N. Gladkovskii, Dec 06 2012

Extensions

Edited and extended by R. J. Mathar, Jul 23 2009
Showing 1-8 of 8 results.