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.

User: Armands Strazds

Armands Strazds's wiki page.

Armands Strazds has authored 4 sequences.

A275536 Differences of the exponents of the adjacent distinct powers of 2 in the binary representation of n (with -1 subtracted from the least exponent present) are concatenated as decimal digits in reverse order.

Original entry on oeis.org

1, 2, 11, 3, 12, 21, 111, 4, 13, 22, 112, 31, 121, 211, 1111, 5, 14, 23, 113, 32, 122, 212, 1112, 41, 131, 221, 1121, 311, 1211, 2111, 11111, 6, 15, 24, 114, 33, 123, 213, 1113, 42, 132, 222, 1122, 312, 1212, 2112, 11112
Offset: 1

Author

Armands Strazds, Aug 01 2016

Keywords

Comments

A preferable representation is a sequence of arrays, since multi-digit items are possible: [1],[2],[1,1],[3],[1,2],[2,1],[1,1,1],[4],[1,3],[2,2],[1,1,2],[3,1],[1,2,1],[2,1,1],[1,1,1,1],[5],[1,4],[2,3],[1,1,3],[3,2],[1,2,2],[2,1,2],[1,1,1,2],[4,1],[1,3,1],[2,2,1],[1,1,2,1],[3,1,1],[1,2,1,1],[2,1,1,1],[1,1,1,1,1],[6],[1,5],[2,4],[1,1,4],[3,3],[1,2,3],[2,1,3],[1,1,1,3],[4,2],[1,3,2],[2,2,2],[1,1,2,2],[3,1,2],[1,2,1,2],[2,1,1,2],[1,1,1,1,2]. 0 is not allowed as a digit.
a(512) is the first term which cannot be expressed unambiguously in decimal. - Charles R Greathouse IV, Aug 02 2016
The first two terms which are equal (because of the ambiguity inherent in using decimal, or more generally any finite base) are a(3) = a(1024) = 11. a(3) corresponds to the array [1,1] while a(1024) corresponds to [11]. - Charles R Greathouse IV, Mar 19 2017

Examples

			5 = 2^2 + 2^0, so the representation is [2-0, 0-(-1)] = [2, 1] so a(5) = 12.
6 = 2^2 + 2^1, so the representation is [2-1, 1-(-1)] = [1, 2] so a(6) = 21.
18 = 2^4 + 2^1, so the representation is [4-1, 1-(-1)] = [3, 2] so a(18) = 23.
		

Programs

  • PARI
    a(n)=my(v=List(),k); while(n, k=valuation(n,2)+1; n>>=k; listput(v,k)); fromdigits(Vec(v)) \\ Charles R Greathouse IV, Aug 02 2016
  • PHP
    function dec2delta($k) {
      $p = -1;
      while ($k > 0) {
        $k -= $c = pow(2, floor(log($k, 2)));
        if ($p > -1) $d[] = $p - floor(log($c, 2));
        $p = floor(log($c, 2));
      }
      $d[] = $p + 1;
      return array_reverse($d);
    }
    function delta2dec($d) {
      $k = 0;
      $e = -1;
      foreach ($d AS $v) {
        if ($v > 0) {
          $e += $v;
          $k += pow(2, $e);
        }
      }
      return $k;
    }
    

Formula

For n=1..511, a(n) = A004086(A004719(A071160(n))) [In other words, terms of A071160 with 0-digits deleted and the remaining digits reversed.] - Antti Karttunen, Sep 03 2016

A258055 Concatenation of the decimal representations of the lengths (increased by 1) of the runs of zeros between successive ones in the binary representation of n.

Original entry on oeis.org

0, 0, 0, 1, 0, 2, 1, 11, 0, 3, 2, 21, 1, 12, 11, 111, 0, 4, 3, 31, 2, 22, 21, 211, 1, 13, 12, 121, 11, 112, 111, 1111, 0, 5, 4, 41, 3, 32, 31, 311, 2, 23, 22, 221, 21, 212, 211, 2111, 1, 14, 13, 131, 12, 122, 121, 1211, 11, 113, 112, 1121, 111, 1112, 1111
Offset: 0

Author

Armands Strazds, May 17 2015

Keywords

Comments

Originally called the "Golden Book's ZI-sequence" by the author.
The ZI-sequence is related to the binary numbers sequence with 10 ^ n substituted by the respective exponent increased by 1 (i.e., 10 as 2, 100 as 3, etc.) and the least significant bit discarded, e.g., binary 1011 converts to ZI 21.
a(n) = 0 when no successive ones exist in the binary representation of n, i.e., when n=0 and when n is a power of 2. - Giovanni Resta, Aug 31 2015

Examples

			Example for n=6: binary 110 => split into 10^m components: 1 (10^0) and 10 (10^1) => 1; the least significant bit, and thus the whole last component, here 10, is discarded.
840 in binary is 1100101000. The runs of zeros between successive ones have length 0, 2 and 1, hence a(840) = 132. - _Giovanni Resta_, Aug 31 2015
		

Crossrefs

Cf. A248646, A256494. See also A261300 for another version.

Programs

  • Mathematica
    a[0] = 0; a[n_] := FromDigits@ Flatten[ IntegerDigits /@ Most[ Length /@ (Split[ Flatten[ IntegerDigits[n, 2] /. 1 -> {1, 0}]][[2 ;; ;; 2]]) ]]; Table[a@ n, {n, 0, 100}] (* Giovanni Resta, Aug 31 2015 *)
  • PHP
    function dec2zi ($d) {
    $b = base_convert($d, 10, 2); $b = str_split($b);
    $i = $z = 0; $r = "";
    foreach($b as $v) {
    if (!$v) {
    $i++;
    } else {
    if ($i > 0) {
    $r .= $i + $v; $i = 0;
    } else {
    if ($z > 0) {
    $r .= $v; $z = 0;
    }
    $z++; }}}
    return $r == "" ? 0 : $r; }

A256494 Expansion of -x^2*(x^3+x-1) / ((x-1)*(x+1)*(2*x-1)*(x^2+1)).

Original entry on oeis.org

0, 1, 1, 2, 3, 7, 13, 26, 51, 103, 205, 410, 819, 1639, 3277, 6554, 13107, 26215, 52429, 104858, 209715, 419431, 838861, 1677722, 3355443, 6710887, 13421773, 26843546, 53687091, 107374183, 214748365, 429496730, 858993459, 1717986919, 3435973837, 6871947674, 13743895347, 27487790695, 54975581389, 109951162778
Offset: 1

Author

Armands Strazds, Mar 30 2015

Keywords

Comments

Previous name was: Golden Book's Level Leap Sequence.
x-positions a(n) of transition from phase 1 (I I) to 2 (/\) for the Golden Book’s y-position n.

Crossrefs

Programs

  • Magma
    I:=[0,1,1,2,3,7]; [n le 6 select I[n] else 2*Self(n-1)+Self(n-4)-2*Self(n-5): n in [1..40]]; // Vincenzo Librandi, Dec 25 2015
  • Mathematica
    Join[{0}, LinearRecurrence[{2, 0, 0, 1, - 2}, {1, 1, 2, 3, 7}, 50]] (* Vincenzo Librandi, Dec 25 2015 *)
  • PARI
    concat(0, Vec(-x^2*(x^3+x-1)/((x-1)*(x+1)*(2*x-1)*(x^2+1)) + O(x^100))) \\ Colin Barker, Apr 09 2015
    
  • PHP
    $r = array(1, -1, 0, -1);
    $a[0] = 0;
    for ($n = 1; $n < 40; $n++) {
    $a[$n] = 2 * $a[$n - 1] + $r[($n - 1) % 4];
    }
    echo(implode(", ", $a));
    

Formula

a(n) = 2 * a(n - 1) + r((n - 1) % 4); r = array(1, -1, 0, -1).
From Colin Barker, Apr 09 2015: (Start)
a(n) = 2*a(n-1)+a(n-4)-2*a(n-5) for n>5.
a(n) = (5+5*(-1)^n-(1+2*i)*(-i)^n-(1-i*2)*i^n+2^(1+n))/20 for n>0 where i=sqrt(-1).
G.f.: -x^2*(x^3+x-1) / ((x-1)*(x+1)*(2*x-1)*(x^2+1)). (End)
E.g.f.: (5*cosh(x) + cosh(2*x) - cos(x) + sinh(2*x) - 2*sin(x) - 5)/10. - Stefano Spezia, May 18 2025

Extensions

New name (using g.f. from Colin Barker) from Joerg Arndt, Dec 26 2015

A248646 Expansion of x*(5+x+x^2)/(1-2*x).

Original entry on oeis.org

2, 5, 11, 23, 46, 92, 184, 368, 736, 1472, 2944, 5888, 11776, 23552, 47104, 94208, 188416, 376832, 753664, 1507328, 3014656, 6029312, 12058624, 24117248, 48234496, 96468992, 192937984, 385875968, 771751936, 1543503872, 3087007744, 6174015488, 12348030976
Offset: 1

Author

Armands Strazds, Oct 10 2014

Keywords

Comments

Previous name was: The Golden Book sequence.
Golden Book is a weighted binary pattern, which instead of 0 and 1 uses distance elements, namely 2 and 3 units long. All the horizontal junction points between the elements (2 and 2, 2 and 3, 3 and 2, or 3 and 3) are connected by a straight line on adjacent levels if the vertical distance between those points is sqrt(2) or less. The weighted binary pattern is:
L(0): 2, 3, 2, 3, 2, 3, 2, 3, ...
L(1): 2, 2, 3, 3, 2, 2, 3, 3, ...
L(2): 2, 2, 2, 2, 3, 3, 3, 3, ...
...
Starting from the level 2 all single levels of the Golden Book have always these 5 phases: |||, /\ |, / /, | \/, | |. A combination of any 2 adjacent levels (2..n) have 11 phases, etc.

Crossrefs

Programs

  • PHP
    $a = array(0 => 2);
    $m = array(1 => 1, 2 => 0, 3 => 0, 4 => 0);
    for ($n = 1; $n < 20; $n++) { $a[$n] = 2 * $a[$n - 1] + ($m[pow(2, $n) % 5]++ ? 0 : 1); }
    print_r($a); /* Armands Strazds, Oct 30 2014 */
    
  • Python
    print([int(23*2**(n-4)) for n in range(1, 34)]) # Karl V. Keller, Jr., Sep 28 2020

Formula

Full cycle length: 2 + 3*A001045(0)..A001045(L-1) + (1/2)*(-1^L + 1 + 3*2^(L-1)) + A001045(0)..A001045(L); L, level (0..n).
From Colin Barker, Oct 11 2014: (Start)
a(n) = 23*2^(n-3) for n > 2.
a(n) = 2*a(n-1) for n > 3.
G.f.: -x*(x^2 + x + 5) / (2*x-1). (End)

Extensions

More terms from Vincenzo Librandi, Oct 17 2014
New name using g.f. from Joerg Arndt, Sep 29 2020