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-40 of 53 results. Next

A161415 First differences of A160414.

Original entry on oeis.org

1, 8, 12, 28, 12, 36, 36, 92, 12, 36, 36, 108, 36, 108, 108, 292, 12, 36, 36, 108, 36, 108, 108, 324, 36, 108, 108, 324, 108, 324, 324, 908, 12, 36, 36, 108, 36, 108, 108, 324, 36, 108, 108, 324, 108, 324, 324, 972, 36, 108, 108, 324, 108, 324, 324, 972, 108, 324, 324
Offset: 1

Views

Author

Omar E. Pol, May 20 2009, Jun 13 2009

Keywords

Crossrefs

Programs

  • Maple
    Contribution from R. J. Mathar, Oct 16 2010: (Start)
    isA000079 := proc(n) if type(n,'even') then nops(numtheory[factorset](n)) = 1 ; else false ; fi ; end proc:
    A048883 := proc(n) 3^wt(n) ; end proc:
    A161415 := proc(n) if n = 1 then 1; elif isA000079(n) then 4*A048883(n-1)-2*n ; else 4*A048883(n-1) ; end if; end proc: seq(A161415(n),n=1..90) ; (End)
  • Mathematica
    a[1] = 1; a[n_] := 4*3^DigitCount[n-1, 2, 1] - If[IntegerQ[Log[2, n]], 2n, 0];
    Array[a, 60] (* Jean-François Alcover, Nov 17 2017, after N. J. A. Sloane *)

Formula

For n > 1, a(n) = 4*A048883(n-1), except a(n) = 4*A048883(n-1) - 2n if n is a power of 2. - N. J. A. Sloane, Jul 13 2009

Extensions

More terms from R. J. Mathar, Oct 16 2010

A151710 First differences of A160715.

Original entry on oeis.org

1, 3, 3, 9, 3, 9, 9, 21, 3, 9, 9, 21, 15, 21, 27, 51, 3, 9, 9, 21, 15, 21, 27, 51, 21, 21, 27, 51
Offset: 1

Views

Author

Omar E. Pol, Jun 02 2009

Keywords

Comments

Number of Y-toothpick added at n-th stage to the structure of A160715.
Similar to A160121. [From Omar E. Pol, May 29 2010]

Examples

			Contribution from _Omar E. Pol_, Dec 18 2012 (Start):
Written as an irregular triangle begins:
1;
3;
3, 9;
3, 9, 9, 21;
3, 9, 9, 21, 15, 21, 27, 51;
3, 9, 9, 21, 15, 21, 27, 51, 21, 21, 27, 51,...
(End)
		

Crossrefs

Extensions

More terms from Omar E. Pol, May 29 2010

A116640 a(n) = A116623(A059893(n)).

Original entry on oeis.org

1, 5, 7, 19, 11, 23, 29, 65, 19, 31, 37, 73, 49, 85, 103, 211, 35, 47, 53, 89, 65, 101, 119, 227, 89, 125, 143, 251, 179, 287, 341, 665, 67, 79, 85, 121, 97, 133, 151, 259, 121, 157, 175, 283, 211, 319, 373, 697, 169, 205, 223, 331, 259, 367, 421, 745, 331
Offset: 0

Views

Author

Antti Karttunen, Feb 20 2006. Proposed by Pierre Lamothe (plamothe(AT)aei.ca), May 21 2004

Keywords

Comments

Viewed as a binary tree, this is (1); 5; 7,19; 11,23,29,65; ... Cf. A116623.
If we treat (2n+1) as a binary number with the nonzero bits numbered (highest bit first) from 0..k and the regular binary place value of each nonzero bit numbered from b(0) to b(k) then a(n) = 3^0 * b(0) + 3^1 * b(1) + .. + 3^k. For instance, if n=6 then 2n+1 = 13, which is equal to 8+4+1 or 1101 base(2); and a(n)=29 which is 8*1 + 4*3 + 1*9. - Joe Slater, Jan 23 2016

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; piecewise(
        n mod 4 = 0, 3*procname(n/2) - 2*procname(n/4),
      n mod 4 = 1, 6*procname((n-1)/4) - procname((n-1)/2),
      n mod 4 = 2, procname(n/2) + 2*procname((n-2)/4),
      5*procname((n-1)/2) - 6*procname((n-3)/4))
    end proc:
    a(0):= 1:
    map(a, [$0..100]); # Robert Israel, Jan 19 2016
  • Mathematica
    a[n_] := a[n] = Switch[Mod[n, 4], 0, 3a[Floor[n/2]] - 2a[Floor[n/4]], 1, 6a[Floor[n/4]] - a[Floor[n/2]], 2, a[Floor[n/2]] + 2a[Floor[n/4]], 3, 5a[Floor[n/2]] - 6a[Floor[n/4]]]; a[0]=1; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Feb 28 2016 *)
  • PARI
    a(n) = if(n==0, return(1)); 2*a(n\2) - (-1)^n * 3^hammingweight(n) \\ Charles R Greathouse IV, Jan 21 2016
    
  • PARI
    a(n) = my(p=2*n+1,v=vecextract(vector(#binary(p),j,2^(j-1)),p));sum(i=0,#v-1,3^i*v[#v-i]) \\ Joe Slater, May 09 2017

Formula

a(A000225(n)) = A001047(n+1).
For n>= 1 a(A000079(n)) = A062709(n+1).
From Joe Slater, Jan 19 2016: (Start)
a(0) = 1,
a(n) = 3*a(floor(n/2)) - 2*a(floor(n/4)) for n=0 (mod 4) and n>0,
a(n) = 6*a(floor(n/4)) - a(floor(n/2)) for n=1 (mod 4),
a(n) = a(floor(n/2)) + 2*a(floor(n/4)) for n=2 (mod 4),
a(n) = 5*a(floor(n/2)) - 6*a(floor(n/4)) for n=3 (mod 4)
(End)
a(0) = 1, a(n) = 2*a(floor(n/2)) - A033999(n) * A048883(n) for n>0. -
Joe Slater, Jan 22 2016

A122108 a(n)=number of 1's ("live" cells) at stage n of a 2-dimensional cellular automaton evolving by the rule: 1 if N+S+E+W is 1 or 2, else 0, starting from a single live cell.

Original entry on oeis.org

1, 4, 8, 12, 20, 24, 44, 28, 52, 56, 104, 56, 104, 112, 212, 60, 116, 120, 232, 120, 232, 240, 464, 120, 232, 240, 464, 240, 464, 480, 932, 124, 244, 248, 488, 248, 488, 496, 976, 248, 488, 496, 976, 496, 976, 992, 1952, 248, 488, 496, 976, 496, 976, 992, 1952
Offset: 1

Views

Author

John W. Layman, Oct 18 2006

Keywords

Crossrefs

Cf. A048883.

A160727 a(n) = A161415(n+1)/4.

Original entry on oeis.org

2, 3, 7, 3, 9, 9, 23, 3, 9, 9, 27, 9, 27, 27, 73, 3, 9, 9, 27, 9, 27, 27, 81, 9, 27, 27, 81, 27, 81, 81, 227, 3, 9, 9, 27, 9, 27, 27, 81, 9, 27, 27, 81, 27, 81, 81, 243, 9, 27, 27, 81, 27, 81, 81, 243, 27, 81, 81, 243, 81, 243, 243, 697, 3, 9, 9, 27, 9
Offset: 1

Views

Author

Omar E. Pol, Jun 13 2009

Keywords

Examples

			From _Omar E. Pol_, Jan 01 2014: (Start)
Written as an irregular triangle in which row lengths is A000079 the sequence begins:
2;
3,7;
3,9,9,23;
3,9,9,27,9,27,27,73;
3,9,9,27,9,27,27,81,9,27,27,81,27,81,81,227;
3,9,9,27,9,27,27,81,9,27,27,81,27,81,81,243,9,27,27,81,27, 81,81,243,27,81,81,243,81,243,243,697;
(End)
		

Crossrefs

Programs

  • Mathematica
    A160727[n_]:=3^DigitCount[n,2,1]-If[IntegerQ[Log2[n+1]],(n+1)/2,0];Array[A160727,100] (* Paolo Xausa, Sep 01 2023 *)

Formula

a(n) = A048883(n), except a(n) = A048883(n) - (n+1)/2 if n is a power of 2 minus 1. - Omar E. Pol, Jan 06 2014

Extensions

a(11)-a(58) from M. F. Hasler, Dec 03 2012
a(59)-a(68) from Omar E. Pol, Jan 06 2014

A173453 a(n) = A160121(n) - A151710(n).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 78
Offset: 1

Views

Author

Omar E. Pol, May 29 2010

Keywords

Crossrefs

A256140 Square array read by antidiagonals upwards: T(n,k) = n^A000120(k), n>=0, k>=0.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 2, 1, 0, 1, 3, 2, 1, 0, 1, 4, 3, 4, 1, 0, 1, 5, 4, 9, 2, 1, 0, 1, 6, 5, 16, 3, 4, 1, 0, 1, 7, 6, 25, 4, 9, 4, 1, 0, 1, 8, 7, 36, 5, 16, 9, 8, 1, 0, 1, 9, 8, 49, 6, 25, 16, 27, 2, 1, 0, 1, 10, 9, 64, 7, 36, 25, 64, 3, 4, 1, 0, 1, 11, 10, 81, 8, 49, 36, 125, 4, 9, 4, 1, 0, 1, 12, 11, 100, 9, 64, 49, 216, 5, 16, 9, 8, 1, 0
Offset: 0

Views

Author

Omar E. Pol, Mar 16 2015

Keywords

Comments

The partial sums of row n give the n-th row of the square array A256141.
First differs from A244003 at a(25).

Examples

			The corner of the square array with the first 16 terms of the first 12 rows looks like this:
---------------------------------------------------------------------------
A000007: 1, 0, 0,  0,  0,  0,  0,   0,  0,  0,  0,   0,  0,   0,   0,    0
A000012: 1, 1, 1,  1,  1,  1,  1,   1,  1,  1,  1,   1,  1,   1,   1,    1
A001316: 1, 2, 2,  4,  2,  4,  4,   8,  2,  4,  4,   8,  4,   8,   8,   16
A048883: 1, 3, 3,  9,  3,  9,  9,  27,  3,  9,  9,  27,  9,  27,  27,   81
A102376: 1, 4, 4, 16,  4, 16, 16,  64,  4, 16, 16,  64, 16,  64,  64,  256
A256135: 1, 5, 5, 25,  5, 25, 25, 125,  5, 25, 25, 125, 25, 125, 125,  625
A256136: 1, 6, 6, 36,  6, 36, 36, 216,  6, 36, 36, 216, 36, 216, 216, 1296
.......: 1, 7, 7, 49,  7, 49, 49, 343,  7, 49, 49, 343, 49, 343, 343, 2401
.......: 1, 8, 8, 64,  8, 64, 64, 512,  8, 64, 64, 512, 64, 512, 512, 4096
.......: 1, 9, 9, 81,  9, 81, 81, 729,  9, 81, 81, 729, 81, 729, 729, 6561
.......: 1,10,10,100, 10,100,100,1000, 10,100,100,1000,100,1000,1000,10000
.......: 1,11,11,121, 11,121,121,1331, 11,121,121,1331,121,1331,1331,14641
		

Crossrefs

A164982 Number of ON cells after n generations of the 2D cellular automaton described in the comments.

Original entry on oeis.org

1, 3, 4, 12, 7, 21, 16, 40, 22, 42, 34, 67, 52, 85, 70, 125, 94, 126, 102, 150, 118, 172, 177, 234, 209, 240, 238, 319, 285, 363, 378, 458, 383, 444, 404, 493, 474, 520, 529, 628, 583, 602, 622, 727, 664, 816, 835, 948, 873, 926, 952, 1065, 1010, 1090, 1187
Offset: 1

Views

Author

John W. Layman, Sep 03 2009

Keywords

Comments

The cells are the squares of the standard square grid. All cells are initially OFF and one cell is turned ON at generation 1. At subsequent generations a cell is ON if and only if (1) exactly one of neighbors NW, NE, and S was ON, or (2) all three of cells N, SW, and SE were ON in the previous generation. (The 9-cell Moore neighborhood is labeled {{NW,N,NE},{W,C,E},{SW,S,SE}}).

Crossrefs

Programs

  • Mathematica
    RasterGraphics[state_?MatrixQ, colors_Integer : 2, opts___] := Graphics[Raster[Reverse[1 - state/(colors - 1)]], AspectRatio -> (AspectRatio /. {opts} /. AspectRatio -> Automatic), Frame -> True, FrameTicks -> None, GridLines -> None];
    rule=61986;
    Show[GraphicsArray[Map[RasterGraphics, CellularAutomaton[{rule, {2, {{1, 4, 1}, {0, 0, 0}, {4, 1, 4}}}, {1, 1}}, {{{1}}, 0}, 4, -5]]]];
    ca = CellularAutomaton[{rule, {2, {{1, 4, 1}, {0, 0, 0}, {4, 1, 4}}}, {1, 1}}, {{{1}}, 0}, 99, -100];
    Table[Total[ca[[i]], 2], {i, 1, 100}]

A119733 Offsets of the terms of the nodes of the reverse Collatz function.

Original entry on oeis.org

0, 1, 2, 5, 4, 7, 10, 19, 8, 11, 14, 23, 20, 29, 38, 65, 16, 19, 22, 31, 28, 37, 46, 73, 40, 49, 58, 85, 76, 103, 130, 211, 32, 35, 38, 47, 44, 53, 62, 89, 56, 65, 74, 101, 92, 119, 146, 227, 80, 89, 98, 125, 116, 143, 170, 251, 152, 179, 206, 287, 260, 341, 422, 665, 64, 67
Offset: 0

Views

Author

William Entriken, Jun 14 2006

Keywords

Comments

Create a binary tree starting with x. To follow 0 from the root, apply f(x)=2x. To follow 1, apply g(x)=(2x-1)/3. For example, starting with x, the string 010 {also known as f(g(f(x)))}, you would get (8x-2)/3. These expressions represent the reverse Collatz function and will provide numbers whose Collatz path may include x. These expressions will all be of the form (2^a*x-b)/3^c. This sequence concerns b. What makes b interesting is that if you draw the tree, each level of the tree will have the same sequence of values for b. The root of the tree x, can be written as (2^0*x-0)/3^0, which has the first value for b. Each subsequent level contains twice as many values of b.
This sequence is 0 followed by a permutation of A213539, and therefore consists of 0 plus the elements of A116640 multiplied by 2^k, where k >= 0. E.g., 1, 5, 7, 19 becomes 0, 2^0*1, 2^1*1, 2^0*5, 2^2*1, 2^0*7, 2^1*5, 2^0*19, ... - Joe Slater, Dec 19 2016
When this sequence is arranged as an irregular triangle the sum of each row a(2^k)...a(2^(k+1)-1) equals A081039(2^k). The cumulative sum from a(0) to a(2^k-1) equals A002697(k). - Joe Slater, Apr 12 2018

Examples

			a(1) = 1 = 2 * 0 + 3^0 since 0 written in binary contains no 1's.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) `if`(n=0, 0, `if`(irem(n, 2, 'r')=0, 0,
          3^add(i, i=convert(r, base, 2)))+2*a(r))
        end:
    seq(a(n), n=0..127);  # Alois P. Heinz, Aug 13 2017
  • Mathematica
    a[0] := 0; a[n_?OddQ] := 2a[(n - 1)/2] + 3^Plus@@IntegerDigits[(n - 1)/2, 2]; a[n_?EvenQ] := 2a[n/2]; Table[a[n], {n, 0, 65}] (* Alonso del Arte, Apr 21 2011 *)
  • PARI
    a(n) = my(ret=0); if(n, for(i=0,logint(n,2), if(bittest(n,i), ret=3*ret+1<Kevin Ryde, Oct 22 2021
  • Perl
    # call with n to get 2^n values
    $depth=shift; sub funct { my ($i, $b, $c) = @_; if ($i < $depth) { funct($i+1, $b*2, $c); funct($i+1, 2*$b+$c, $c*3); } else { print "$b, "; } } funct(0, 0, 1); print " ";
    
  • Python
    from sympy.core.cache import cacheit
    @cacheit
    def a(n): return 0 if n==0 else 2*a((n - 1)//2) + 3**bin((n - 1)//2).count('1') if n%2 else 2*a(n//2)
    print([a(n) for n in range(131)]) # Indranil Ghosh, Aug 13 2017
    

Formula

a(0) = 0, a(2*n + 1) = 2*a(n) + 3^wt(n) = 2*a(n) + A048883(n), a(2*n) = 2*a(n), where wt(n) = A000120(n) = the number 1's in the binary representation of n.
a(k) = [z^k] 1 + (1/(1-z)) * Sum_{s=0..n-1} 2^s*z^(2^s)*(1 - z^(2^s)) * Product_{r=s+1..n-1} (1 + 3*z^(2^r)), for 0 < k <= 2^n-1. - Wolfgang Hintze, Jul 28 2017
a(n) = Sum_{i=0..k} 2^e[i] * 3^i where binary expansion n = 2^e[0] + 2^e[1] + ... + 2^e[k] with descending e[0] > e[1] > ... > e[k] (A272011). [Martín Chabrera lemma 6.1, adapting index i] - Kevin Ryde, Oct 22 2021

A162349 First differences of A160412.

Original entry on oeis.org

3, 9, 9, 27, 9, 27, 27, 81, 9, 27, 27, 81, 27, 81, 81, 243, 9, 27, 27, 81, 27, 81, 81, 243, 27, 81, 81, 243, 81, 243, 243, 729, 9, 27, 27, 81, 27, 81, 81, 243, 27, 81, 81, 243, 81, 243, 243, 729, 27, 81, 81, 243, 81, 243, 243, 729, 81, 243, 243, 729, 243, 729
Offset: 1

Views

Author

Omar E. Pol, Jul 14 2009

Keywords

Comments

Note that if A048883 is written as a triangle then rows converge to this sequence. - Omar E. Pol, Nov 15 2009

Crossrefs

Programs

  • Mathematica
    a[n_] := 3^(1 + DigitCount[n - 1, 2, 1]); Array[a, 100] (* Amiram Eldar, Feb 02 2024 *)

Formula

a(n) = 3^A063787(n) = 3 * A048883(n-1). - Amiram Eldar, Feb 02 2024

Extensions

More terms from Omar E. Pol, Nov 15 2009
More terms from Colin Barker, Apr 19 2015
More terms from Amiram Eldar, Feb 02 2024
Previous Showing 31-40 of 53 results. Next