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 71-80 of 86 results. Next

A345205 Minimum number of unit cubes needed to fully enclose n unit cubes in 3D space.

Original entry on oeis.org

8, 26, 34, 42, 44, 52, 54, 56, 56, 64, 66, 68, 68, 76, 78, 80, 80, 82, 82, 90, 92, 94, 94, 96, 96, 98, 98, 98
Offset: 0

Views

Author

Abraham Maxfield, Jun 10 2021

Keywords

Comments

Cubes are assumed to be aligned in a 3D grid. Cubes with an exposed edge or corner are not considered enclosed.

Examples

			For a(1) the solution is the number of neighbors in Moore's neighborhood in 3 dimensions (3^3-1 = 26).
For a(2) the solution is the neighbors in Moore's neighborhood in 3 dimensions plus the number of neighbors in 2 dimensions (3^2-1 = 8).
		

Crossrefs

Cf. A345206, A235382 (2D equivalent), A007395 (1D equivalent), A024023.

A030439 a(n+1) = smallest number not containing any digits of a(n), working in base 3.

Original entry on oeis.org

0, 1, 2, 3, 8, 9, 26, 27, 80, 81, 242, 243, 728, 729, 2186, 2187, 6560, 6561, 19682, 19683, 59048, 59049, 177146, 177147, 531440, 531441, 1594322, 1594323, 4782968, 4782969, 14348906, 14348907, 43046720, 43046721, 129140162, 129140163, 387420488, 387420489
Offset: 0

Views

Author

Keywords

Crossrefs

Cf. A030283.
Bisections give: A024023, A000244.

Formula

3^i-1 then 3^i.
a(n) = 4*a(n-2)-3*a(n-4); g.f.: -x*(x^2-2*x-1) / ((x-1)*(x+1)*(3*x^2-1)). - Colin Barker, Sep 13 2014
a(n) = 3^floor(n/2) -1 +(n mod 2). - Alois P. Heinz, Sep 14 2014

A062345 Length of period of continued fraction expansion of square root of 3^n-1.

Original entry on oeis.org

1, 2, 1, 2, 10, 2, 19, 2, 25, 2, 156, 2, 149, 2, 580, 2, 716, 2, 6461, 2, 2485, 2, 123256, 2, 64, 2, 8638, 2, 722190, 2, 3804214, 2, 1783536, 2, 3550696, 2, 86022946, 2, 22119349, 2, 692630166, 2, 8247763078, 2, 43380360, 2, 15150768502, 2, 10229872316, 2, 36580802370, 2, 333495606762, 2, 676122216162, 2
Offset: 1

Views

Author

Labos Elemer, Jul 13 2001

Keywords

Examples

			The period of sqrt(242) contains 10 terms: [1,1,3,1,14,1,3,1,1,30]
		

Crossrefs

Programs

  • Maple
    with(numtheory): [seq(nops(cfrac(sqrt(3^k-1),'periodic','quotients')[2]),k=1..16)];
  • Mathematica
    Table[Length[Last[ContinuedFraction[Sqrt[ -1+3^u]]]], {u, 1, 36}]

Formula

a(n) = A003285(A024023(n)). - Michel Marcus, Sep 25 2019

Extensions

a(37)-a(42) from Vaclav Kotesovec, Aug 28 2019
a(43)-a(44) from Vaclav Kotesovec, Sep 17 2019
a(45)-a(52) from Chai Wah Wu, Sep 25 2019
a(53)-a(56) from Chai Wah Wu, Sep 29 2019

A112027 a(1)=1; then successively add 1, divide by 2, add 2 and then total up the last 4 terms.

Original entry on oeis.org

1, 2, 1, 3, 7, 8, 4, 6, 25, 26, 13, 15, 79, 80, 40, 42, 241, 242, 121, 123, 727, 728, 364, 366, 2185, 2186, 1093, 1095, 6559, 6560, 3280, 3282, 19681, 19682, 9841, 9843, 59047, 59048, 29524, 29526, 177145, 177146, 88573, 88575, 531439, 531440, 265720, 265722, 1594321
Offset: 1

Views

Author

N. J. A. Sloane, Nov 24 2005

Keywords

References

  • Joshua Zucker, Posting to Seq Fan mailing list, Nov 24 2005

Crossrefs

Quadrusections: A058481, A024023, A003462, A067771.

Programs

  • Maple
    a[1]:=1; k:=1; for n from 1 to 16 do k:=k+1; a[k]:=a[k-1]+1; k:=k+1; a[k]:=a[k-1]/2; k:=k+1; a[k]:=a[k-1]+2; k:=k+1; a[k]:=a[k-1]+a[k-2]+a[k-3]+a[k-4]; od;
  • Mathematica
    LinearRecurrence[{0, 0, 0, 4, 0, 0, 0, -3}, {1, 2, 1, 3, 7, 8, 4, 6}, 50] (* Paolo Xausa, May 20 2024 *)

Formula

G.f.: -x*(6*x^7-3*x^4-3*x^3-x^2-2*x-1) / ((x-1)*(x+1)*(x^2+1)*(3*x^4-1)). - Colin Barker, Jul 28 2013

Extensions

Definition found by Franklin T. Adams-Watters, Feb 01 2006
More terms from N. J. A. Sloane, Feb 22 2006

A225585 Floor((3^n-1)/n).

Original entry on oeis.org

2, 4, 8, 20, 48, 121, 312, 820, 2186, 5904, 16104, 44286, 122640, 341640, 956593, 2690420, 7596480, 21523360, 61171656, 174339220, 498112057, 1426411800, 4093181688, 11767897353, 33891544377, 97764070320, 282429536480, 817028301962, 2366564736720
Offset: 1

Views

Author

Vincenzo Librandi, May 30 2013

Keywords

Crossrefs

Programs

  • Magma
    [Floor((3^n-1)/n): n in [1..30]];
  • Mathematica
    Table[Floor[(3^n - 1) / n], {n, 30}] (* or *) Table[Quotient[3^n - 1, n], {n, 30}]

A230445 Triangle read by rows: T(n,m) = 3^m*2^(n-m)-1, the number of neighbors in an n-dimensional cubic array.

Original entry on oeis.org

0, 1, 2, 3, 5, 8, 7, 11, 17, 26, 15, 23, 35, 53, 80, 31, 47, 71, 107, 161, 242, 63, 95, 143, 215, 323, 485, 728, 127, 191, 287, 431, 647, 971, 1457, 2186, 255, 383, 575, 863, 1295, 1943, 2915, 4373, 6560, 511, 767, 1151, 1727, 2591, 3887, 5831, 8747, 13121
Offset: 0

Views

Author

Ron R. King, Oct 18 2013

Keywords

Comments

Let n be the dimension of the cubic array.
Let m be the "placement depth" of the cell within the array. m = (number of horizontal or vertical neighbors)-n. 0 <= m <= n.
Let T(n,m) represent the number of neighbors (horizontally, vertically, or diagonally) a cell has in an n-dimensional cube that has at least 3^n cells.
The sequence forms a triangle structure similar to Pascal’s triangle: T(0,0) in row one, T(1,0), T(1,1) in row two, etc.
The triangle in A094615 is a subtriangle. - Philippe Deléham, Oct 31 2013
In a finite n-dimensional hypercube lattice, the sequence gives the number of nodes situated at a Chebyshev distance of 1 for a node, situated on an m-cube bound, which is not on an (m-1)-cube bound. The number of m-cube bounds for n-cube is given by A013609. In cellular automata theory, the cell surrounding with Chebyshev distance 1 is called Moore's neighborhood. For von Neumann neighborhood (with Manhattan distance 1), an analogous sequence is represented by A051162. - Dmitry Zaitsev, Oct 22 2015

Examples

			Triangle starts:
n \ m  0    1    2    3    4    5     6     7     8     9    10 ...
0:     0
1:     1    2
2:     3    5    8
3:     7   11   17   26
4:    15   23   35   53   80
5:    31   47   71  107  161  242
6:    63   95  143  215  323  485   728
7:   127  191  287  431  647  971  1457  2186
8:   255  383  575  863 1295 1943  2915  4373  6560
9:   511  767 1151 1727 2591 3887  5831  8747 13121 19682
10: 1023 1535 2303 3455 5183 7775 11663 17495 26243 39365 59048
... (reformatted (and extended) by _Wolfdieter Lang_, May 04 2022)
For a 3-d cube, at a corner, the number of horizontal and vertical neighbors is 3, hence m = 3-3 = 0.
Along the edge, the number of horizontal and vertical neighbors is 4, hence m = 4-3 = 1.
In a face, the number of horizontal and vertical neighbors is 5, hence m = 5-3 = 2.
In the interior, the number of horizontal and vertical neighbors is 6, hence m = 6-3 = 3.
T(3,2) = 17 because a cell on the face of a 3-d cube has 17 neighbors.
		

Crossrefs

Sequence numbers are 1 less than A036561.

Programs

  • C
    void a10(){int p3[10], p2[10], n, m, a; p3[0]=1; p2[0]=1;
    for(n=1;n<10;n++){ p2[n]=p2[n-1]*2; p3[n]=p3[n-1]*3;
      for(m=0;m<=d;m++){ a=p3[m]*p2[n-m]-1; printf("%d ",a); }
      printf("\n"); } } /* Dmitry Zaitsev, Oct 23 2015 */
  • Mathematica
    Table[3^m 2^(n - m) - 1, {n, 0, 9}, {m, 0, n}] // Flatten (* Michael De Vlieger, Oct 23 2015 *)

Formula

T(n,m) = 3^m*2^(n-m)-1, 0 <= m <= n.
T(n,0) = 2^n-1. (A000225)
T(n,n) = 3^n-1. (A024023)
T(n,m) = (3*T(n,m-1)+1)/2, first part of the Collatz sequence for the number 2^n-1, for n >= 1.
T(n,m) = (T(n-1,m) + T(n,m+1))/2, 0 <= m <= n-1.
T(n,m) = 1 + T(n-1,m-1) + T(n,m-1), 1 <= m <= n.
m = T2(n,k)-n, where T2(n,k) is A051162.
From Wolfdieter Lang, May 04 2022: (Start)
G.f. for column m: G(m, x) = x^m*(3^m - 1 - (3^m - 2)*x)/((1 - 2*x)*(1 - x)).
G.f. for row polynomials R(n, x) = Sum_{m=1..n} T(n, m)*x^m, for n >= 0: G(z, x) = z*(1 + (2 - 5*z)*x)/((1 - 2*z)*(1 - z)*(1 - 3*x*z)*(1 - x*z)).
(End)

A309119 a(n) is the number of 1's minus the number of 2's among the ternary representations of the integers in the interval [0..n].

Original entry on oeis.org

0, 1, 0, 1, 3, 3, 2, 2, 0, 1, 3, 3, 5, 8, 9, 9, 10, 9, 8, 8, 6, 6, 7, 6, 4, 3, 0, 1, 3, 3, 5, 8, 9, 9, 10, 9, 11, 14, 15, 18, 22, 24, 25, 27, 27, 27, 28, 27, 28, 30, 30, 29, 29, 27, 26, 26, 24, 24, 25, 24, 22, 21, 18, 18, 19, 18, 19, 21, 21, 20, 20, 18, 16, 15
Offset: 0

Views

Author

Rémy Sigrist, Jul 13 2019

Keywords

Comments

This sequence has connections with a Takagi (or blancmange) curve.
Let t be the real function defined over [0..1] as follows:
- t(x) = 0 for x in [0..1/3],
- t(x) = x - 1/3 for x in ]1/3..2/3],
- t(x) = 1 - x for x in ]2/3..1].
Let g be the real function defined over [0..1] as follows:
- g(x) = Sum_{k >= 0} t(x * 3^k)/3^k.
The representation of n -> (n/3^k, a(n)/3^k) for n = 0..3^k converges to the representation of g over [0..1] as k tends to infinity.

Examples

			The first terms, alongside the ternary expansion of n and the corresponding number of 1's and 2's, are:
  n   a(n)  ter(n)  A062756(n)  A081603(n)
  --  ----  ------  ----------  ----------
   0     0       0           0           0
   1     1       1           1           0
   2     0       2           0           1
   3     1      10           1           0
   4     3      11           2           0
   5     3      12           1           1
   6     2      20           0           1
   7     2      21           1           1
   8     0      22           0           2
   9     1     100           1           0
  10     3     101           2           0
		

Crossrefs

Programs

  • Mathematica
    Accumulate[Table[Total[IntegerDigits[n,3]/.(2->-1)],{n,0,80}]] (* Harvey P. Dale, Jun 23 2020 *)
  • PARI
    s = 0; for (n=0, 73, t = digits(n,3); print1 (s+=sum(i=1, #t, if (t[i]==1, +1, t[i]==2, -1, 0)) ", "))

Formula

a(n) = Sum_{k = 0..n} (A062756(k) - A081603(k)).
a(n) >= 0 with equality iff n = 3^k - 1 for some k >= 0 (A024023).
a(3*k + 2) = 3*a(k) for any k >= 0.
a(3^k + m) = a(m) + m + 1 for any k >= 0 and m = 0..3^k-1.
a(2*3^k + m) = a(m) + 3^k - m - 1 for any k >= 0 and m = 0..3^k-1.

A338478 Let b be an odd function such that b(0) = 0, b(1) = 1, and for any n > 1 such that 3^x < 2*n < 3^(x+1) for some x > 0, b(n) = b(3^x-n) - 3^x; a(n) = abs(b(n)) for any n >= 0.

Original entry on oeis.org

0, 1, 2, 3, 4, 13, 12, 11, 8, 9, 10, 7, 6, 5, 32, 33, 34, 37, 36, 35, 38, 39, 40, 31, 30, 29, 26, 27, 28, 25, 24, 23, 14, 15, 16, 19, 18, 17, 20, 21, 22, 103, 102, 101, 98, 99, 100, 97, 96, 95, 104, 105, 106, 109, 108, 107, 110, 111, 112, 121, 120, 119, 116
Offset: 0

Views

Author

Rémy Sigrist, Oct 29 2020

Keywords

Comments

This sequence is a self-inverse permutation of the nonnegative integers.
It is possible to build a continuous injective complex-valued function of a real-variable, say f, such that Im(f(r)) = 0 iff r is an integer and for any n in Z, f(n) = b(n) (see illustration in Links section).

Examples

			For n = 3:
- we have 3^1 < 2*3 < 3^(1+1),
- so b(3) = b(3 - 3) - 3 = 0 - 3 = -3,
- a(3) = abs(b(3)) = 3.
		

Crossrefs

Programs

  • PARI
    b(n) = { if (n<0,  return (-b(-n)), n==0, return (0), n==1, return (1), for (x=1, oo, my (w=3^x, h=w\2); if (w<2*n && 2*n<3*w, return (b(w-n)-w)))) }
    a(n) = abs(b(n))

Formula

a(n) = n iff abs(n - 3^x) <= 1 for some x >= 0.

A343766 Lexicographically earliest sequence of distinct integers such that a(0) = 0 and the balanced ternary expansions of two consecutive terms differ by a single digit, as far to the right as possible.

Original entry on oeis.org

0, -1, 1, -2, -4, -3, 3, 2, 4, -5, -7, -6, -12, -13, -11, -8, -10, -9, 9, 8, 10, 7, 5, 6, 12, 11, 13, -14, -16, -15, -21, -22, -20, -17, -19, -18, -36, -37, -35, -38, -40, -39, -33, -34, -32, -23, -25, -24, -30, -31, -29, -26, -28, -27, 27, 26, 28, 25, 23, 24
Offset: 0

Views

Author

Rémy Sigrist, Apr 28 2021

Keywords

Comments

This sequence has similarities with A003188 and with A341055.
A007949 gives the positions of the digit that is altered from one term to the other.
To compute a(n):
- consider the ternary representation of A128173(n),
- replace 1's by -1's and 2's by 1's,
- convert back to decimal.

Examples

			The first terms, alongside their balanced ternary expansion (with T's denoting -1's), are:
  n   a(n)  bter(a(n))
  --  ----  ----------
   0     0           0
   1    -1           T
   2     1           1
   3    -2          T1
   4    -4          TT
   5    -3          T0
   6     3          10
   7     2          1T
   8     4          11
   9    -5         T11
  10    -7         T1T
  11    -6         T10
  12   -12         TT0
  13   -13         TTT
  14   -11         TT1
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

a(n) = -A117966(A128173(n)).
Sum_{k=0..n-1} sign(a(k)) = -A081134(n).
Sum_{k=0..n} a(k) = 0 iff n belongs to A024023.

A351839 Triangle read by rows: T(n, k) = A027375(n)*Sum_{m=1..floor(n/k)} binomial(n, k*m).

Original entry on oeis.org

2, 6, 2, 14, 6, 6, 30, 14, 24, 12, 62, 30, 60, 60, 30, 126, 62, 126, 180, 180, 54, 254, 126, 252, 420, 630, 378, 126, 510, 254, 504, 852, 1680, 1512, 1008, 240, 1022, 510, 1014, 1620, 3780, 4536, 4536, 2160, 504, 2046, 1022, 2040, 3060, 7590, 11340, 15120, 10800, 5040, 990
Offset: 1

Views

Author

Stefano Spezia, Feb 21 2022

Keywords

Comments

T(n, k) is the number of k-th roots of unity as eigenvalues of the quantum operator O for a free Motzkin spin chain of length n. For k = 1, it gives the correct result if one excludes the eigenvalue 2.
For the definitions of both a free Motzkin spin chain and the quantum operator O, see Hao et al.

Examples

			Triangle begins:
    2;
    6,   2;
   14,   6,   6;
   30,  14,  24,  12;
   62,  30,  60,  60,  30;
  126,  62, 126, 180, 180,  54;
  254, 126, 252, 420, 630, 378, 126;
  ...
		

Crossrefs

Cf. A000918 (k = 2), A007318, A024023 (row sums), A027375 (leading diagonal), A095121 (k = 1).

Programs

  • Mathematica
    g[n_]:= DivisorSum[n,(2^#)*MoebiusMu[n/#]&]; binomSum[n_,k_]:=Sum[Binomial[n, i],{i,k,n,k}]; T[n_,k_]:=g[k]*binomSum[n,k]; (* See p. 9 in Hao et al. *)
    Flatten[Table[T[n,k],{n,10},{k,n}]]
  • PARI
    T(n,k) = sumdiv(k,d,moebius(d)*2^(k/d))*sum(m=1,n\k,binomial(n,k*m)) \\ Andrew Howroyd, Feb 21 2022
Previous Showing 71-80 of 86 results. Next