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 31-39 of 39 results.

A266533 First differences of A266532.

Original entry on oeis.org

1, 3, 3, 9, 3, 9, 9, 21, 3, 9, 9, 21, 9, 21, 21, 45, 3, 9, 9, 21, 9, 21, 21, 45, 9, 21, 21, 45, 21, 45, 45, 93, 3, 9, 9, 21, 9, 21, 21, 45, 9, 21, 21, 45, 21, 45, 45, 93, 9, 21, 21, 45, 21, 45, 45, 93, 21, 45, 45, 93, 45, 93, 93, 189, 3, 9, 9, 21, 9, 21, 21, 45, 9, 21, 21, 45, 21, 45, 45, 93
Offset: 1

Views

Author

David Applegate and Omar E. Pol, Jan 18 2016

Keywords

Comments

Number of Y-toothpicks added at n-th stage in the structure of A266532.
A simplified version of A160121.

Examples

			Written as an irregular triangle in which the row lengths are the terms of A011782 the sequence begins:
1;
3;
3, 9;
3, 9, 9, 21;
3, 9, 9, 21, 9, 21, 21, 45;
3, 9, 9, 21, 9, 21, 21, 45, 9, 21, 21, 45, 21, 45, 45, 93;
...
Observation: at least the first 11 terms of the right border coincide with A068156.
		

Crossrefs

Formula

a(1) = 1. It appears that a(n) = 3*A038573(n-1), n >= 2.

A267701 a(n) = (A160121(n) - A266533(n))/6.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 4, 0, 0, 0, 1, 0, 0, 1, 4, 0, 1, 1, 5, 2, 4, 4, 13, 2, 0, 0, 1, 0, 1, 1, 4, 0, 1, 1, 5, 2, 4, 4, 13, 2, 1, 1, 5, 2, 5, 6, 16, 5, 4, 4, 15, 8, 13, 15, 38, 10, 0, 0, 1, 0, 1
Offset: 1

Views

Author

Omar E. Pol, Jan 19 2016

Keywords

Comments

a(n) is 1/6 of the difference between the number of Y-toothpicks added at n-th stage in the structure of A160120 and the number of Y-toothpicks added at n-th stage stage in the structure of A266532 (the outward version of A160120).

Examples

			Written as an irregular triangle in which the row lengths are the terms of A011782 the sequence begins:
0;
0;
0,  0;
0,  0,0,0;
1,  0,0,0,1,0,1,1;
4,  0,0,0,1,0,0,1,4,0,1,1,5,2,4,4;
13, 2,0,0,1,0,1,1,4,0,1,1,5,2,4,4,13,2,1,1,5,2,5,6,16,5,4,4,15,8,13,15;
38,10,0,0,1,0,1...
		

Crossrefs

A322662 a(n) is to A151723(n+1) as A319018(n+1) is to A147562(n+1), n >= 0.

Original entry on oeis.org

1, 13, 25, 109, 121, 193, 325, 493, 529, 661, 829, 1129, 1189, 1405, 1657, 2101, 2149, 2281, 2533, 3133, 3337, 3709, 4309, 4909, 5065, 5449, 5917, 6757, 6877, 7381, 7873, 8845, 8893, 9025, 9277, 9877, 10165, 10849, 11737
Offset: 0

Views

Author

Bradley Klee, Dec 22 2018

Keywords

Comments

Also the number of ON cells after n generations in a knight's-move, one-neighbor, accumulative cellular automaton on the hexagonal lattice A_2. Define v(m)=2*sqrt(3)*[cos(m*Pi/3+Pi/6), sin(m*Pi/3+Pi/6)], vL(m)=2*v(m)+v(m+1), vR(m)=2*v(m)+v(m-1). The set of "knight's moves", M={vL(m):m=1,2,..6} U {vR(m):m=1,2,..6}, follows from an analogy between Z^2 and A_2. At each generation all ON cells remain ON while an OFF cell turns ON if and only if it has exactly one M-neighbor in the previous generation.
Fractal Structure Theorem (FST). A pair of lattice vectors M={v1,v2} generate a wedge, W = {x*v1 + y*v2 : x>=0, y>=0}. Define W-Subsets T_k such that T_{k+1}= T_k U { 2^n*v1 + v : v in T_k } U {2^n*v2 + v : v in T_k}, T_0 = { [0,0] }. The limit set T_{oo} is a fractal, and acquires the topology of a binary tree when points are connected by either v1 or v2. As a tree, T_k has height 2^k-1, with 2^k vertices at maximum depth, along a line in the direction v1-v2. Assume a one-M-neighbor, accumulative cellular automaton on W, where all vertices in T_k are ON. In the next generation, the front F_k={2^k*v1+m*(v2-v1) : 0<=m<=2^k} contains only two ON cells, {2^k*v1,2^k*v2}. The spacing, 2^k-1, is wide enough to turn ON two copies of T_k, one starting from each of the two ON cells in F_k. Thus T_{k+1} is also ON. Whenever only T_0 is ON as an initial condition, by induction, T_{oo} is ultimately ON.
The FST applies here to 12 distinct wedges: with {v1,v2}={vL(m), vR(m)} or with (v1,v2)={vL(m), vR(m+1)}, and m=1,2,..6. The triangle inequality ensures that paths including other vectors cannot reach the front F_k by generation 2^k. However, other vectors do generate retrogressive growth, which turns ON many additional cells.
The FST applies to a wide range of Cellular Automata. Wolfram's one-dimensional rule 90 gives the most elementary example where T_{oo} determines every ON cell. The tree structure T_{oo} also occurs with two-dimensional, accumulative, one-neighbor C.A. such as A151723, A319018, A147562. Also try: M={[0,1],[0,-1],[2,1],[-2,-1]}.
According to S. Ulam (cf. Links), some version of the FST was already known to J. Holladay circa 1960.
The FST implies scale resonance between this cellular automaton and the arrowed half hexagon tiling (cf. Links).

Crossrefs

Hexagonal: A151723. Square: A319018, A147562. Tree: A006046, A267700, A038573. A322663.

Programs

  • Mathematica
    HexStar=2*Sqrt[3]*{Cos[#*Pi/3+Pi/6],Sin[#*Pi/3+Pi/6]}&/@Range[0,5];
    MoveSet=Join[2*HexStar+RotateRight[HexStar],2*HexStar+RotateLeft[HexStar]];
    Clear@Pts;Pts[0] = {{0, 0}};
    Pts[n_]:=Pts[n]=With[{pts=Pts[n-1]},Union[pts,Cases[Tally[Flatten[pts/.{x_,y_}:> Evaluate[{x,y}+#&/@MoveSet],1]],{x_,1}:>x]]];Length[Pts[#]]&/@Range[0,32]

A356195 The binary expansion of a(n) is obtained by applying the totalistic cellular automaton with rule 2*n to the binary expansion of n.

Original entry on oeis.org

0, 1, 0, 3, 0, 6, 3, 7, 0, 14, 3, 14, 0, 9, 7, 15, 0, 30, 3, 30, 0, 25, 7, 30, 0, 16, 12, 29, 7, 23, 15, 31, 0, 62, 3, 62, 0, 57, 7, 62, 0, 48, 12, 61, 7, 55, 15, 62, 0, 32, 28, 60, 7, 38, 28, 61, 0, 33, 19, 51, 15, 47, 31, 63, 0, 126, 3, 126, 0, 121, 7, 126
Offset: 0

Views

Author

Rémy Sigrist, Jul 29 2022

Keywords

Comments

To compute the binary expansion of a(n):
- we scan the binary digits of n from right to left,
- at some position k >= 0 (0 corresponding to the least significant bit):
- we count the number of 1's at positions >= k, say we have w 1's,
- if 2^w appears in the binary expansion of 2*n,
then we insert a 1,
otherwise we insert a 0,
- as we are considering an even automaton (with rule 2*n),
once scanning the leading 0's of n, we will only insert 0's,
- and the result will have finitely many 1's.
More formally: 2^k appears in the binary expansion of a(n) iff 2^A000120(floor(n/2^k)) appears in the binary expansion of 2*n.

Examples

			For n = 43:
- the binary expansion of 2*43 is "1010110",
- so we apply the following totalistic cellular automaton:
       w   | >=7  6   5   4   3   2   1   0
       out |  0   1   0   1   0   1   1   0
- scanning the binary expansion of n, we obtains:
    bin(n)    | 1   0   1   0   1   1
    w         | 1   1   2   2   3   4
    bin(a(n)) | 1   1   1   1   0   1
- so a(n) = 61.
		

Crossrefs

Programs

  • PARI
    a(n) = { my (v=0, m=n); for (k=0, oo, if (m==0, return (v), bittest(2*n, hammingweight(m)), v+=2^k); m\=2) }

Formula

a(n) = n iff n belongs to A000225.
a(n) = 0 iff n AND A038573(n) = 0 (where AND denotes the bitwise AND operator).

A322663 First differences of A322662 divided by 12.

Original entry on oeis.org

1, 1, 7, 1, 6, 11, 14, 3, 11, 14, 25, 5, 18, 21, 37, 4, 11, 21, 50, 17, 31, 50, 50, 13, 32, 39, 70, 10, 42, 41, 81, 4, 11, 21, 50, 24, 57, 74, 89, 40, 62, 84, 105, 48, 66, 85, 111, 18, 37, 64, 151, 41, 80, 126, 131, 29
Offset: 1

Views

Author

Bradley Klee, Dec 22 2018

Keywords

Comments

Unlike A322050, this sequence contains only finitely many 1's. However, the Cellular Automaton and its counting sequences still admit a 2^n fractal structure (Cf. A322662). The subsequences L_n = {a(2^n), a(2^n+1), ... a(2^(n+1)-1)} appear to approach a limit sequence L_{oo}, starting with 4 ON cells. Of these 4, one is a "pioneer" at distance d*2^n from the origin, with d the distance of one knight step. The other three of four ON cells are due to retrogressive growth.

Examples

			Written as a 2^k triangle:
1,
1, 7,
1, 6,  11, 14,
3, 11, 14, 25, 5,  18, 21, 37,
4, 11, 21, 50, 17, 31, 50, 50, 13, 32, 39, 70,  10, 42, 41, 81,
4, 11, 21, 50, 24, 57, 74, 89, 40, 62, 84, 105, 48, 66, 85, 111, ...
		

Crossrefs

Hexagonal: A151724, A170898, A256537. Square: A147582, A147610, A048883; A319019, A322050, A322049. Lower Bound: A038573.

Programs

  • Mathematica
    HexStar=2*Sqrt[3]*{Cos[#*Pi/3+Pi/6],Sin[#*Pi/3+Pi/6]}&/@Range[0,5];
    MoveSet2 =Join[2*HexStar+RotateRight[HexStar],2*HexStar+RotateLeft[HexStar]];
    Clear@Pts;Pts[0] = {{0, 0}};
    Pts[n_]:=Pts[n]=With[{pts=Pts[n-1]},Union[pts,Cases[Tally[Flatten[pts/.{x_,y_}:> Evaluate[{x,y}+#&/@MoveSet2],1]],{x_,1}:>x]]];
    Abs[(1/12)*Subtract@@#&/@Partition[Length[Pts[#]]&/@Range[0,32],2,1]]

Formula

a(n) = (A322662(n)-A322662(n-1))/12.

A348647 Irregular table read by rows; the n-th row contains the lengths of the runs of consecutive terms with the same parity in the n-th row of Pascal's triangle (A007318).

Original entry on oeis.org

1, 2, 1, 1, 1, 4, 1, 3, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 8, 1, 7, 1, 2, 6, 2, 1, 1, 1, 5, 1, 1, 1, 4, 4, 4, 1, 3, 1, 3, 1, 3, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 1, 15, 1, 2, 14, 2, 1, 1, 1, 13, 1, 1, 1, 4, 12, 4, 1, 3, 1, 11, 1, 3, 1
Offset: 0

Views

Author

Rémy Sigrist, Oct 27 2021

Keywords

Comments

For any n >= 0, the n-th row:
- is palindromic,
- has A038573(n+1) terms,
- has leading term A006519(n+1),
- has central term A080079(n+1).

Examples

			Triangle begins:
    1;
    2;
    1, 1, 1;
    4;
    1, 3, 1;
    2, 2, 2;
    1, 1, 1, 1, 1, 1, 1;
    8;
    1, 7, 1;
    2, 6, 2;
    1, 1, 1, 5, 1, 1, 1;
    4, 4, 4;
    1, 3, 1, 3, 1, 3, 1;
    2, 2, 2, 2, 2, 2, 2;
    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1;
    16;
    ...
		

Crossrefs

Programs

  • PARI
    row(n) = { my (b=binomial(n)%2, r=[], p=1, w=1); for (k=2, #b, if (p==b[k], w++, r=concat(r, w); p=b[k]; w=1)); concat(r, w) }

Formula

Sum_{k = 1..A038573(n+1)} T(n, k) = n+1.
T(n, 1) = A006519(n+1).
T(n, A048896(n)) = A080079(n+1).
T(2^k-1, 1) = 2^k for any k >= 0.

A348706 Delete all 0's from ternary expansion of n.

Original entry on oeis.org

1, 2, 1, 4, 5, 2, 7, 8, 1, 4, 5, 4, 13, 14, 5, 16, 17, 2, 7, 8, 7, 22, 23, 8, 25, 26, 1, 4, 5, 4, 13, 14, 5, 16, 17, 4, 13, 14, 13, 40, 41, 14, 43, 44, 5, 16, 17, 16, 49, 50, 17, 52, 53, 2, 7, 8, 7, 22, 23, 8, 25, 26, 7, 22, 23, 22, 67, 68, 23, 70, 71, 8, 25
Offset: 1

Views

Author

Rémy Sigrist, Oct 30 2021

Keywords

Examples

			The first terms, in decimal and in base 3, are:
  n   a(n)  ter(n)  ter(a(n))
  --  ----  ------  ---------
   1     1       1          1
   2     2       2          2
   3     1      10          1
   4     4      11         11
   5     5      12         12
   6     2      20          2
   7     7      21         21
   8     8      22         22
   9     1     100          1
  10     4     101         11
  11     5     102         12
  12     4     110         11
  13    13     111        111
  14    14     112        112
  15     5     120         12
		

Crossrefs

Cf. A004719 (decimal analog), A032924 (fixed points), A038573 (binary analog).

Programs

  • Mathematica
    a[n_] := FromDigits[DeleteCases[IntegerDigits[n, 3], 0], 3]; Array[a, 100] (* Amiram Eldar, Oct 31 2021 *)
  • PARI
    a(n, base=3) = fromdigits(select(sign, digits(n, base)), base)
    
  • Python
    from gmpy2 import digits
    def A348706(n): return int(digits(n,3).replace('0',''),3) # Chai Wah Wu, Nov 02 2021

Formula

a(n) <= n with equality iff n belongs to A032924.

A373886 a(n) is the least number whose binary expansion can be obtained by reversing one or more consecutive bits in the binary expansion of n.

Original entry on oeis.org

0, 1, 1, 3, 1, 3, 3, 7, 1, 3, 5, 7, 3, 7, 7, 15, 1, 3, 6, 7, 5, 11, 13, 15, 3, 7, 11, 15, 7, 15, 15, 31, 1, 3, 6, 7, 9, 13, 14, 15, 5, 11, 21, 23, 13, 27, 29, 31, 3, 7, 14, 15, 11, 23, 27, 31, 7, 15, 23, 31, 15, 31, 31, 63, 1, 3, 6, 7, 12, 13, 14, 15, 9, 19
Offset: 0

Views

Author

Rémy Sigrist, Aug 10 2024

Keywords

Comments

This sequence has similarities with A087734; here we reverse some consecutive bits, there we negate some consecutive bits.

Examples

			The first terms, alongside their binary expansion, are:
  n   a(n)  bin(n)  bin(a(n))
  --  ----  ------  ---------
   0     0       0          0
   1     1       1          1
   2     1      10          1
   3     3      11         11
   4     1     100          1
   5     3     101         11
   6     3     110         11
   7     7     111        111
   8     1    1000          1
   9     3    1001         11
  10     5    1010        101
  11     7    1011        111
  12     3    1100         11
  13     7    1101        111
  14     7    1110        111
  15    15    1111       1111
  16     1   10000          1
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local L,nL,i,j,k,r,x;
      L:= convert(n,base,2);
      nL:= nops(L);
      r:= n;
      for i from 1 to nL-1 do
        for j from i+1 to nL do
          r:= min(r, n + add((L[j-k]-L[i+k])*2^(i+k-1),k=0..j-i));
      od od;
      r
    end proc:
    map(f, [$0..100]); # Robert Israel, Aug 13 2024
  • PARI
    a(n, base = 2) = { my (d = if (n, digits(n, base), [0])); setbinop((i, j) -> fromdigits(concat([d[1..i-1], Vecrev(d[i..j]), d[j+1..#d]]), base), [1..#d])[1]; }
    
  • Python
    def a(n):
        b = bin(n)[2:]
        return min(int(b[:i]+b[i:j][::-1]+b[j:], 2) for i in range(len(b)) for j in range(i, len(b)+1))
    print([a(n) for n in range(74)]) # Michael S. Branicky, Aug 13 2024

Formula

a(n) <= n with equality iff n belongs to A000225.
a^k(n) = A038573(n) for k sufficiently large (where a^k denotes the k-th iterate of the sequence).
a(2^k) = 1 for any k >= 0.
A000120(a(n)) = A000120(n).

A038586 Write n in ternary then sort the digits.

Original entry on oeis.org

0, 1, 2, 1, 11, 12, 2, 12, 22, 1, 11, 12, 11, 111, 112, 12, 112, 122, 2, 12, 22, 12, 112, 122, 22, 122, 222, 1, 11, 12, 11, 111, 112, 12, 112, 122, 11, 111, 112, 111, 1111, 1112, 112, 1112, 1122, 12, 112, 122, 112, 1112, 1122, 122, 1122, 1222, 2, 12, 22, 12, 112
Offset: 0

Views

Author

Keywords

Crossrefs

Cf. A038573.

Extensions

More terms from Erich Friedman.
Previous Showing 31-39 of 39 results.