[go: up one dir, main page]

login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
Search: a071053 -id:a071053
Displaying 1-10 of 43 results found. page 1 2 3 4 5
     Sort: relevance | references | number | modified | created      Format: long | short | data
A253102 a(n) = A071053(n)^3. +20
2
1, 27, 27, 125, 27, 729, 125, 1331, 27, 729, 729, 3375, 125, 3375, 1331, 9261, 27, 729, 729, 3375, 729, 19683, 3375, 35937, 125, 3375, 3375, 15625, 1331, 35937, 9261, 79507, 27, 729, 729, 3375, 729, 19683, 3375, 35937, 729, 19683, 19683, 91125, 3375, 91125, 35937, 250047, 125, 3375, 3375, 15625 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
COMMENTS
Number of ON cells at n-th generation of 3-D CA defined by generalization of Rule 150, starting with a single ON cell at generation 0.
Number of odd coefficients in ((1/x+1+x)*(1/y+1+y)*(1/z+1+z))^n.
Run length transform of A253103.
LINKS
N. J. A. Sloane, On the No. of ON Cells in Cellular Automata, Video of talk in Doron Zeilberger's Experimental Math Seminar at Rutgers University, Feb. 05 2015: Part 1, Part 2
N. J. A. Sloane, On the Number of ON Cells in Cellular Automata, arXiv:1503.01168 [math.CO], 2015.
MATHEMATICA
a71053[n_] := Total[CoefficientList[(x^2 + x + 1)^n, x, Modulus -> 2]];
Table[a71053[n]^3, {n, 0, 51}] (* Jean-François Alcover, Sep 15 2018 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Feb 20 2015
STATUS
approved
A246660 Run Length Transform of factorials. +10
16
1, 1, 1, 2, 1, 1, 2, 6, 1, 1, 1, 2, 2, 2, 6, 24, 1, 1, 1, 2, 1, 1, 2, 6, 2, 2, 2, 4, 6, 6, 24, 120, 1, 1, 1, 2, 1, 1, 2, 6, 1, 1, 1, 2, 2, 2, 6, 24, 2, 2, 2, 4, 2, 2, 4, 12, 6, 6, 6, 12, 24, 24, 120, 720, 1, 1, 1, 2, 1, 1, 2, 6, 1, 1, 1, 2, 2, 2, 6, 24, 1, 1, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
COMMENTS
For the definition of the Run Length Transform see A246595.
Only Jordan-Polya numbers (A001013) are terms of this sequence.
LINKS
FORMULA
a(2^n-1) = n!.
a(0) = 1, a(2n) = a(n), a(2n+1) = a(n) * A007814(2n+2). - Antti Karttunen, Sep 08 2014
a(n) = A112624(A005940(1+n)). - Antti Karttunen, May 29 2017
a(n) = A323505(n) / A323506(n). - Antti Karttunen, Jan 17 2019
MATHEMATICA
Table[Times @@ (Length[#]!&) /@ Select[Split[IntegerDigits[n, 2]], #[[1]] == 1&], {n, 0, 83}] (* Jean-François Alcover, Jul 11 2017 *)
PROG
(Sage)
def RLT(f, size):
L = lambda n: [a for a in Integer(n).binary().split('0') if a != '']
return [mul([f(len(d)) for d in L(n)]) for n in range(size)]
A246660_list = lambda len: RLT(factorial, len)
A246660_list(88)
(PARI)
A246660(n) = { my(i=0, p=1); while(n>0, if(n%2, i++; p = p * i, i = 0); n = n\2); p; };
for(n=0, 8192, write("b246660.txt", n, " ", A246660(n)));
\\ Antti Karttunen, Sep 08 2014
(Scheme)
;; A stand-alone loop version, like the Pari-program above:
(define (A246660 n) (let loop ((n n) (i 0) (p 1)) (cond ((zero? n) p) ((odd? n) (loop (/ (- n 1) 2) (+ i 1) (* p (+ 1 i)))) (else (loop (/ n 2) 0 p)))))
;; One based on given recurrence, utilizing memoizing definec-macro from my IntSeq-library:
(definec (A246660 n) (cond ((zero? n) 1) ((even? n) (A246660 (/ n 2))) (else (* (A007814 (+ n 1)) (A246660 (/ (- n 1) 2))))))
;; Yet another implementation, using fold:
(define (A246660 n) (fold-left (lambda (a r) (* a (A000142 r))) 1 (bisect (reverse (binexp->runcount1list n)) (- 1 (modulo n 2)))))
(definec (A000142 n) (if (zero? n) 1 (* n (A000142 (- n 1)))))
;; Other functions are as in A227349 - Antti Karttunen, Sep 08 2014
(Python)
from operator import mul
from functools import reduce
from re import split
from math import factorial
def A246660(n):
return reduce(mul, (factorial(len(d)) for d in split('0+', bin(n)[2:]) if d)) if n > 0 else 1 # Chai Wah Wu, Sep 09 2014
CROSSREFS
Cf. A003714 (gives the positions of ones).
Run Length Transforms of other sequences: A001316, A071053, A227349, A246588, A246595, A246596, A246661, A246674.
KEYWORD
nonn,base
AUTHOR
Peter Luschny, Sep 07 2014
STATUS
approved
A038184 State of one-dimensional cellular automaton 'sigma' (Rule 150): 000,001,010,011,100,101,110,111 -> 0,1,1,0,1,0,0,1 at generation n, converted to a decimal number. +10
15
1, 7, 21, 107, 273, 1911, 5189, 28123, 65793, 460551, 1381653, 7039851, 17829905, 124809335, 340873541, 1840690907, 4295032833, 30065229831, 90195689493, 459568513131, 1172543963409, 8207807743863, 22286925370437 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
COMMENTS
Generation n (starting from the generation 0: 1) interpreted as a binary number, but written in base 10.
Rows of the mod 2 trinomial triangle (A027907), interpreted as binary numbers: 1, 111, 10101, 1101011, ... (A118110). - Jacob A. Siehler, Aug 25 2006
See A071053 for number of ON cells. - N. J. A. Sloane, Jul 28 2014
LINKS
Eric Weisstein's World of Mathematics, Rule 150
EXAMPLE
Bit patterns with "0" replaced by "." for visibilty [Georg Fischer, Dec 16 2021]:
0: 1
1: 111
2: 1.1.1
3: 11.1.11
4: 1...1...1
5: 111.111.111
6: 1.1...1...1.1
7: 11.11.111.11.11
8: 1.......1.......1
9: 111.....111.....111
10: 1.1.1...1.1.1...1.1.1
11: 11.1.11.11.1.11.11.1.11
12: 1...1.......1.......1...1
13: 111.111.....111.....111.111
14: 1.1...1.1...1.1.1...1.1...1.1
15: 11.11.11.11.11.1.11.11.11.11.11
MAPLE
bit_n := (x, n) -> `mod`(floor(x/(2^n)), 2);
sigmagen := proc(n) option remember: if (0 = n) then (1)
else sum('((bit_n(sigmagen(n-1), i)+bit_n(sigmagen(n-1), i-1)+bit_n(sigmagen(n-1), i-2)) mod 2)*(2^i)', 'i'=0..(2*n)) fi: end:
MATHEMATICA
f[n_] := Sum[2^k*Coefficient[ #, x, k], {k, 0, 2n}] & @ Expand[(1 + x + x^2)^n, Modulus -> 2] (* Jacob A. Siehler, Aug 25 2006 *)
PROG
(PARI)
a(n) = subst(lift(Pol(Mod([1, 1, 1], 2), 'x)^n), 'x, 2);
vector(23, n, a(n-1)) \\ Gheorghe Coserea, Jun 12 2016
CROSSREFS
Cf. A006977, A006978, A038183, A038185 (other cellular automata).
This sequence, A071036 and A118110 are equivalent descriptions of the Rule 150 automaton.
KEYWORD
nonn
AUTHOR
Antti Karttunen, Feb 15 1999
STATUS
approved
A246035 Number of odd terms in f^n, where f = (1/x+1+x)*(1/y+1+y). +10
13
1, 9, 9, 25, 9, 81, 25, 121, 9, 81, 81, 225, 25, 225, 121, 441, 9, 81, 81, 225, 81, 729, 225, 1089, 25, 225, 225, 625, 121, 1089, 441, 1849, 9, 81, 81, 225, 81, 729, 225, 1089, 81, 729, 729, 2025, 225, 2025, 1089, 3969, 25, 225, 225, 625, 225, 2025, 625, 3025, 121, 1089, 1089, 3025, 441, 3969, 1849, 7225, 9, 81, 81, 225, 81, 729, 225 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
COMMENTS
This is the number of ON cells in a certain 2-D CA in which the neighborhood of a cell is defined by f, and in which a cell is ON iff there was an odd number of ON cells in the neighborhood at the previous generation.
This is the odd-rule cellular automaton defined by OddRule 777 (see Ekhad-Sloane-Zeilberger "Odd-Rule Cellular Automata on the Square Grid" link).
Run Length Transform of {A001045(k+2)^2} (or of A139818).
The Run Length Transform of a sequence {S(n), n>=0} is defined to be the sequence {T(n), n>=0} given by T(n) = Product_i S(i), where i runs through the lengths of runs of 1's in the binary expansion of n. E.g. 19 is 10011 in binary, which has two runs of 1's, of lengths 1 and 2. So T(19) = S(1)*S(2). T(0)=1 (the empty product).
LINKS
Shalosh B. Ekhad, N. J. A. Sloane, and  Doron Zeilberger, A Meta-Algorithm for Creating Fast Algorithms for Counting ON Cells in Odd-Rule Cellular Automata, arXiv:1503.01796 [math.CO], 2015; see also the Accompanying Maple Package.
Shalosh B. Ekhad, N. J. A. Sloane, and  Doron Zeilberger, Odd-Rule Cellular Automata on the Square Grid, arXiv:1503.04249 [math.CO], 2015.
N. J. A. Sloane, On the No. of ON Cells in Cellular Automata, Video of talk in Doron Zeilberger's Experimental Math Seminar at Rutgers University, Feb. 05 2015: Part 1, Part 2
N. J. A. Sloane, On the Number of ON Cells in Cellular Automata, arXiv:1503.01168 [math.CO], 2015.
FORMULA
a(n) = A071053(n)^2.
EXAMPLE
Here is the neighborhood:
[X, X, X]
[X, X, X]
[X, X, X]
which contains a(1) = 9 ON cells.
.
From Omar E. Pol, Mar 17 2015: (Start)
Apart from the initial 1, the sequence can be written also as an irregular tetrahedron T(s,r,k) = A139818(r+2) * a(k), s>=1, 1<=r<=s, 0<=k<=(A011782(s-r)-1) as shown below:
..
9;
...
9;
25;
..........
9, 81;
25;
121;
....................
9, 81, 81, 225;
25, 225;
121;
441;
........................................
9, 81, 81, 225, 81, 729, 225, 1089;
25, 225, 225, 625;
121, 1089;
441;
1849;
...
Note that every row r is equal to A139818(r+2) times the beginning of the sequence itself, thus in 3D every column contains the same number: T(s,r,k) = T(s+1,r,k).
(End)
MAPLE
C:=f->subs({x=1, y=1}, f);
# Find number of ON cells in CA for generations 0 thru M defined by rule
# that cell is ON iff number of ON cells in nbd at time n-1 was odd
# where nbd is defined by a polynomial or Laurent series f(x, y).
OddCA:=proc(f, M) global C; local n, a, i, f2, p;
f2:=simplify(expand(f)) mod 2;
a:=[]; p:=1;
for n from 0 to M do a:=[op(a), C(p)]; p:=expand(p*f2) mod 2; od:
lprint([seq(a[i], i=1..nops(a))]);
end;
f:=(1/x+1+x)*(1/y+1+y);
OddCA(f, 70);
MATHEMATICA
b[0] = 1; b[n_] := b[n] = Expand[b[n - 1]*(x^2 + x + 1)];
a[n_] := Count[CoefficientList[b[n], x], _?OddQ]^2;
Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Apr 30 2017 *)
CROSSREFS
Other CA's that use the same rule but with different cell neighborhoods: A160239, A102376, A071053, A072272, A001316, A246034.
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Aug 20 2014
STATUS
approved
A245562 Table read by rows: row n gives list of lengths of runs of 1's in binary expansion of n, starting with high-order bits. +10
12
0, 1, 1, 2, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 3, 4, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 3, 2, 2, 1, 2, 1, 2, 2, 3, 3, 1, 4, 5, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 3, 1, 4, 2, 2, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
COMMENTS
A formula for A071053(n) depends on this table.
LINKS
N. J. A. Sloane, On the Number of ON Cells in Cellular Automata, arXiv:1503.01168, 2015
EXAMPLE
Here are the run lengths for the numbers 0 through 21:
0, []
1, [1]
2, [1]
3, [2]
4, [1]
5, [1, 1]
6, [2]
7, [3]
8, [1]
9, [1, 1]
10, [1, 1]
11, [1, 2]
12, [2]
13, [2, 1]
14, [3]
15, [4]
16, [1]
17, [1, 1]
18, [1, 1]
19, [1, 2]
20, [1, 1]
21, [1, 1, 1]
MAPLE
for n from 0 to 128 do
lis:=[]; t1:=convert(n, base, 2); L1:=nops(t1); out1:=1; c:=0;
for i from 1 to L1 do
if out1 = 1 and t1[i] = 1 then out1:=0; c:=c+1;
elif out1 = 0 and t1[i] = 1 then c:=c+1;
elif out1 = 1 and t1[i] = 0 then c:=c;
elif out1 = 0 and t1[i] = 0 then lis:=[c, op(lis)]; out1:=1; c:=0;
fi;
if i = L1 and c>0 then lis:=[c, op(lis)]; fi;
od:
lprint(n, lis);
od:
PROG
(Python)
from re import split
A245562_list = [0]
for n in range(1, 100):
....A245562_list.extend(len(d) for d in split('0+', bin(n)[2:]) if d != '')
# Chai Wah Wu, Sep 07 2014
(PARI) row(n)=my(v=List(), k); while(n, n>>=valuation(n, 2); listput(v, k=valuation(n+1, 2)); n>>=k); Vecrev(v) \\ Charles R Greathouse IV, Oct 21 2016
CROSSREFS
Row sums = A000120 (the binary weight).
KEYWORD
nonn,base,tabf,easy
AUTHOR
N. J. A. Sloane, Aug 10 2014
STATUS
approved
A245563 Table read by rows: row n gives list of lengths of runs of 1's in binary expansion of n, starting with low-order bits. +10
11
0, 1, 1, 2, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 3, 4, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 3, 1, 2, 1, 2, 1, 2, 2, 2, 3, 1, 3, 4, 5, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 3, 1, 4, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 1, 2, 2, 2, 3, 2, 3, 1, 3, 1, 3, 2, 3, 4, 1, 4, 5, 6, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
COMMENTS
A formula for A071053(n) depends on this table.
LINKS
EXAMPLE
Here are the run lengths for the numbers 0 through 21:
0, []
1, [1]
2, [1]
3, [2]
4, [1]
5, [1, 1]
6, [2]
7, [3]
8, [1]
9, [1, 1]
10, [1, 1]
11, [2, 1]
12, [2]
13, [1, 2]
14, [3]
15, [4]
16, [1]
17, [1, 1]
18, [1, 1]
19, [2, 1]
20, [1, 1]
21, [1, 1, 1]
MAPLE
for n from 0 to 128 do
lis:=[]; t1:=convert(n, base, 2); L1:=nops(t1); out1:=1; c:=0;
for i from 1 to L1 do
if out1 = 1 and t1[i] = 1 then out1:=0; c:=c+1;
elif out1 = 0 and t1[i] = 1 then c:=c+1;
elif out1 = 1 and t1[i] = 0 then c:=c;
elif out1 = 0 and t1[i] = 0 then lis:=[op(lis), c]; out1:=1; c:=0;
fi;
if i = L1 and c>0 then lis:=[op(lis), c]; fi;
od:
lprint(n, lis);
od:
MATHEMATICA
Join@@Table[Length/@Split[Join@@Position[Reverse[IntegerDigits[n, 2]], 1], #2==#1+1&], {n, 0, 100}] (* Gus Wiseman, Nov 03 2019 *)
PROG
(Haskell)
import Data.List (group)
a245563 n k = a245563_tabf !! n !! k
a245563_row n = a245563_tabf !! n
a245563_tabf = [0] : map
(map length . (filter ((== 1) . head)) . group) (tail a030308_tabf)
-- Reinhard Zumkeller, Aug 10 2014
(Python)
from re import split
A245563_list = [0]
for n in range(1, 100):
....A245563_list.extend(len(d) for d in split('0+', bin(n)[:1:-1]) if d != '')
# Chai Wah Wu, Sep 07 2014
CROSSREFS
Row sums = A000120 (the binary weight).
Row lengths are A069010.
The version for prime indices (instead of binary indices) is A124010.
Numbers with distinct run-lengths are A328592.
Numbers with equal run-lengths are A164707.
KEYWORD
nonn,base,tabf
AUTHOR
N. J. A. Sloane, Aug 10 2014
STATUS
approved
A246588 Run Length Transform of S(n) = wt(n) = 0,1,1,2,1,2,2,3,1,... (cf. A000120). +10
11
1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 2, 1, 1, 1, 1, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,8
COMMENTS
The Run Length Transform of a sequence {S(n), n>=0} is defined to be the sequence {T(n), n>=0} given by T(n) = Product_i S(i), where i runs through the lengths of runs of 1's in the binary expansion of n. E.g. 19 is 10011 in binary, which has two runs of 1's, of lengths 1 and 2. So T(19) = S(1)*S(2). T(0)=1 (the empty product).
LINKS
MAPLE
A000120 := proc(n) local w, m, i; w := 0; m :=n; while m > 0 do i := m mod 2; w := w+i; m := (m-i)/2; od; w; end: wt := A000120;
ans:=[];
for n from 0 to 100 do lis:=[]; t1:=convert(n, base, 2); L1:=nops(t1); out1:=1; c:=0;
for i from 1 to L1 do
if out1 = 1 and t1[i] = 1 then out1:=0; c:=c+1;
elif out1 = 0 and t1[i] = 1 then c:=c+1;
elif out1 = 1 and t1[i] = 0 then c:=c;
elif out1 = 0 and t1[i] = 0 then lis:=[c, op(lis)]; out1:=1; c:=0;
fi;
if i = L1 and c>0 then lis:=[c, op(lis)]; fi;
od:
a:=mul(wt(i), i in lis);
ans:=[op(ans), a];
od:
ans;
MATHEMATICA
f[n_] := DigitCount[n, 2, 1]; Table[Times @@ (f[Length[#]]&) /@ Select[ Split[ IntegerDigits[n, 2]], #[[1]] == 1&], {n, 0, 100}] (* Jean-François Alcover, Jul 11 2017 *)
PROG
(Haskell)
import Data.List (group)
a246588 = product . map (a000120 . length) .
filter ((== 1) . head) . group . a030308_row
-- Reinhard Zumkeller, Feb 13 2015, Sep 05 2014
(Python)
from operator import mul
from functools import reduce
from re import split
def A246588(n):
return reduce(mul, (bin(len(d)).count('1') for d in split('0+', bin(n)[2:]) if d)) if n > 0 else 1 # Chai Wah Wu, Sep 07 2014
(Sage) # uses[RLT from A246660]
A246588_list = lambda len: RLT(lambda n: sum(Integer(n).digits(2)), len)
A246588_list(88) # Peter Luschny, Sep 07 2014
CROSSREFS
Cf. A000120.
Run Length Transforms of other sequences: A071053, A227349, A246595, A246596, A246660, A246661, A246674.
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Sep 05 2014
STATUS
approved
A246595 Run Length Transform of squares. +10
11
1, 1, 1, 4, 1, 1, 4, 9, 1, 1, 1, 4, 4, 4, 9, 16, 1, 1, 1, 4, 1, 1, 4, 9, 4, 4, 4, 16, 9, 9, 16, 25, 1, 1, 1, 4, 1, 1, 4, 9, 1, 1, 1, 4, 4, 4, 9, 16, 4, 4, 4, 16, 4, 4, 16, 36, 9, 9, 9, 36, 16, 16, 25, 36, 1, 1, 1, 4, 1, 1, 4, 9, 1, 1, 1, 4, 4, 4, 9, 16, 1, 1, 1, 4, 1, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
COMMENTS
The Run Length Transform of a sequence {S(n), n>=0} is defined to be the sequence {T(n), n>=0} given by T(n) = Product_i S(i), where i runs through the lengths of runs of 1's in the binary expansion of n. E.g., 19 is 10011 in binary, which has two runs of 1's, of lengths 1 and 2. So T(19) = S(1)*S(2). T(0)=1 (the empty product).
LINKS
N. J. A. Sloane, On the Number of ON Cells in Cellular Automata, arXiv:1503.01168 [math.CO], 2015.
FORMULA
a(n) = A227349(n)^2. - Omar E. Pol, Feb 10 2015
EXAMPLE
From Omar E. Pol, Feb 10 2015: (Start)
Written as an irregular triangle in which row lengths is A011782:
1;
1;
1,4;
1,1,4,9;
1,1,1,4,4,4,9,16;
1,1,1,4,1,1,4,9,4,4,4,16,9,9,16,25;
1,1,1,4,1,1,4,9,1,1,1,4,4,4,9,16,4,4,4,16,4,4,16,36,9,9,9,36,16,16,25,36;
...
Right border gives A253909: 1 together with the positive squares.
(End)
From Omar E. Pol, Mar 19 2015: (Start)
Also, the sequence can be written as an irregular tetrahedron T(s,r,k) as shown below:
1;
..
1;
..
1;
4;
.......
1, 1;
4;
9;
...............
1, 1, 1, 4;
4, 4;
9;
16;
.............................
1, 1, 1, 4, 1, 1, 4, 9;
4, 4, 4, 16;
9, 9;
16;
25;
......................................................
1, 1, 1, 4, 1, 1, 4, 9, 1, 1, 1, 4, 4, 4, 9, 16;
4, 4, 4, 16, 4, 4, 16, 36;
9, 9, 9, 36;
16, 16;
25;
36;
...
Apart from the initial 1, we have that T(s,r,k) = T(s+1,r,k).
(End)
MAPLE
ans:=[];
for n from 0 to 100 do lis:=[]; t1:=convert(n, base, 2); L1:=nops(t1); out1:=1; c:=0;
for i from 1 to L1 do
if out1 = 1 and t1[i] = 1 then out1:=0; c:=c+1;
elif out1 = 0 and t1[i] = 1 then c:=c+1;
elif out1 = 1 and t1[i] = 0 then c:=c;
elif out1 = 0 and t1[i] = 0 then lis:=[c, op(lis)]; out1:=1; c:=0;
fi;
if i = L1 and c>0 then lis:=[c, op(lis)]; fi;
od:
a:=mul(i^2, i in lis);
ans:=[op(ans), a];
od:
ans;
MATHEMATICA
Table[Times @@ (Length[#]^2&) /@ Select[Split[IntegerDigits[n, 2]], #[[1]] == 1&], {n, 0, 85}] (* Jean-François Alcover, Jul 11 2017 *)
PROG
(Python)
from operator import mul
from functools import reduce
from re import split
def A246595(n):
return reduce(mul, (len(d)**2 for d in split('0+', bin(n)[2:]) if d != '')) if n > 0 else 1 # Chai Wah Wu, Sep 07 2014
(Sage) # uses[RLT from A246660]
A246595_list = lambda len: RLT(lambda n: n^2, len)
A246595_list(86) # Peter Luschny, Sep 07 2014
(Scheme) ; using MIT/GNU Scheme
(define (A246595 n) (fold-left (lambda (a r) (* a r r)) 1 (bisect (reverse (binexp->runcount1list n)) (- 1 (modulo n 2)))))
;; Other functions are as in A227349 - Antti Karttunen, Sep 08 2014
CROSSREFS
Cf. A003714 (gives the positions of ones).
Run Length Transforms of other sequences: A071053, A227349, A246588, A246596, A246660, A246661, A246674.
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Sep 06 2014
STATUS
approved
A246596 Run Length Transform of Catalan numbers A000108. +10
11
1, 1, 1, 2, 1, 1, 2, 5, 1, 1, 1, 2, 2, 2, 5, 14, 1, 1, 1, 2, 1, 1, 2, 5, 2, 2, 2, 4, 5, 5, 14, 42, 1, 1, 1, 2, 1, 1, 2, 5, 1, 1, 1, 2, 2, 2, 5, 14, 2, 2, 2, 4, 2, 2, 4, 10, 5, 5, 5, 10, 14, 14, 42, 132, 1, 1, 1, 2, 1, 1, 2, 5, 1, 1, 1, 2, 2, 2, 5, 14, 1, 1, 1, 2, 1, 1, 2, 5 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
COMMENTS
The Run Length Transform of a sequence {S(n), n>=0} is defined to be the sequence {T(n), n>=0} given by T(n) = Product_i S(i), where i runs through the lengths of runs of 1's in the binary expansion of n. E.g. 19 is 10011 in binary, which has two runs of 1's, of lengths 1 and 2. So T(19) = S(1)*S(2). T(0)=1 (the empty product).
LINKS
FORMULA
a(n) = A069739(A005940(1+n)). - Antti Karttunen, May 29 2017
EXAMPLE
From Omar E. Pol, Feb 15 2015: (Start)
Written as an irregular triangle in which row lengths are the terms of A011782:
1;
1;
1,2;
1,1,2,5;
1,1,1,2,2,2,5,14;
1,1,1,2,1,1,2,5,2,2,2,4,5,5,14,42;
1,1,1,2,1,1,2,5,1,1,1,2,2,2,5,14,2,2,2,4,2,2,4,10,5,5,5,10,14,14,42,132;
...
Right border gives the Catalan numbers. This is simply a restatement of the theorem that this sequence is the Run Length Transform of A000108.
(End)
MAPLE
Cat:=n->binomial(2*n, n)/(n+1);
ans:=[];
for n from 0 to 100 do lis:=[]; t1:=convert(n, base, 2); L1:=nops(t1); out1:=1; c:=0;
for i from 1 to L1 do
if out1 = 1 and t1[i] = 1 then out1:=0; c:=c+1;
elif out1 = 0 and t1[i] = 1 then c:=c+1;
elif out1 = 1 and t1[i] = 0 then c:=c;
elif out1 = 0 and t1[i] = 0 then lis:=[c, op(lis)]; out1:=1; c:=0;
fi;
if i = L1 and c>0 then lis:=[c, op(lis)]; fi;
od:
a:=mul(Cat(i), i in lis);
ans:=[op(ans), a];
od:
ans;
MATHEMATICA
f = CatalanNumber; Table[Times @@ (f[Length[#]]&) /@ Select[ Split[ IntegerDigits[n, 2]], #[[1]] == 1&], {n, 0, 87}] (* Jean-François Alcover, Jul 11 2017 *)
PROG
(Python)
from operator import mul
from functools import reduce
from gmpy2 import divexact
from re import split
def A246596(n):
s, c = bin(n)[2:], [1, 1]
for m in range(1, len(s)):
c.append(divexact(c[-1]*(4*m+2), (m+2)))
return reduce(mul, (c[len(d)] for d in split('0+', s))) if n > 0 else 1
# Chai Wah Wu, Sep 07 2014
(Sage) # uses[RLT from A246660]
A246596_list = lambda len: RLT(lambda n: binomial(2*n, n)/(n+1), len)
A246596_list(88) # Peter Luschny, Sep 07 2014
(Scheme) ; using MIT/GNU Scheme
(define (A246596 n) (fold-left (lambda (a r) (* a (A000108 r))) 1 (bisect (reverse (binexp->runcount1list n)) (- 1 (modulo n 2)))))
(define A000108 (EIGEN-CONVOLUTION 1 *))
;; Note: EIGEN-CONVOLUTION can be found from my IntSeq-library and other functions are as in A227349. - Antti Karttunen, Sep 08 2014
CROSSREFS
Cf. A000108.
Cf. A003714 (gives the positions of ones).
Run Length Transforms of other sequences: A005940, A069739, A071053, A227349, A246588, A246595, A246660, A246661, A246674.
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Sep 06 2014
STATUS
approved
A246674 Run Length Transform of A000225. +10
11
1, 1, 1, 3, 1, 1, 3, 7, 1, 1, 1, 3, 3, 3, 7, 15, 1, 1, 1, 3, 1, 1, 3, 7, 3, 3, 3, 9, 7, 7, 15, 31, 1, 1, 1, 3, 1, 1, 3, 7, 1, 1, 1, 3, 3, 3, 7, 15, 3, 3, 3, 9, 3, 3, 9, 21, 7, 7, 7, 21, 15, 15, 31, 63, 1, 1, 1, 3, 1, 1, 3, 7, 1, 1, 1, 3, 3, 3, 7, 15, 1, 1, 1, 3, 1, 1, 3, 7, 3, 3, 3, 9, 7, 7, 15, 31, 3, 3, 3, 9, 3, 3, 9, 21, 3, 3, 3, 9, 9, 9, 21, 45, 7, 7, 7, 21, 7, 7, 21, 49, 15, 15, 15, 45, 31, 31, 63, 127, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
COMMENTS
a(n) can be also computed by replacing all consecutive runs of zeros in the binary expansion of n with * (multiplication sign), and then performing that multiplication, still in binary, after which the result is converted into decimal. See the example below.
LINKS
FORMULA
For all n >= 0, a(A051179(n)) = A247282(A051179(n)) = A051179(n).
EXAMPLE
115 is '1110011' in binary. The run lengths of 1-runs are 2 and 3, thus a(115) = A000225(2) * A000225(3) = ((2^2)-1) * ((2^3)-1) = 3*7 = 21.
The same result can be also obtained more directly, by realizing that '111' and '11' are the binary representations of 7 and 3, and 7*3 = 21.
From Omar E. Pol, Feb 15 2015: (Start)
Written as an irregular triangle in which row lengths are the terms of A011782:
1;
1;
1,3;
1,1,3,7;
1,1,1,3,3,3,7,15;
1,1,1,3,1,1,3,7,3,3,3,9,7,7,15,31;
1,1,1,3,1,1,3,7,1,1,1,3,3,3,7,15,3,3,3,9,3,3,9,21,7,7,7,21,15,15,31,63;
...
Right border gives 1 together with the positive terms of A000225.
(End)
MATHEMATICA
f[n_] := 2^n - 1; Table[Times @@ (f[Length[#]]&) /@ Select[ Split[ IntegerDigits[n, 2]], #[[1]] == 1&], {n, 0, 100}] (* Jean-François Alcover, Jul 11 2017 *)
PROG
(MIT/GNU Scheme)
(define (A246674 n) (fold-left (lambda (a r) (* a (A000225 r))) 1 (bisect (reverse (binexp->runcount1list n)) (- 1 (modulo n 2)))))
(define (A000225 n) (- (A000079 n) 1))
(define (A000079 n) (expt 2 n))
;; Other functions as in A227349.
(Python)
# uses RLT function in A278159
def A246674(n): return RLT(n, lambda m: 2**m-1) # Chai Wah Wu, Feb 04 2022
CROSSREFS
Cf. A003714 (gives the positions of ones).
A001316 is obtained when the same transformation is applied to A000079, the powers of two.
Run Length Transforms of other sequences: A071053, A227349, A246588, A246595, A246596, A246660, A246661, A246685, A247282.
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Sep 08 2014
STATUS
approved
page 1 2 3 4 5

Search completed in 0.028 seconds

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 29 09:09 EDT 2024. Contains 375511 sequences. (Running on oeis4.)