A246595 Run Length Transform of squares.
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
Offset: 0
Keywords
Examples
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)
Links
- Chai Wah Wu, Table of n, a(n) for n = 0..8192
- N. J. A. Sloane, On the Number of ON Cells in Cellular Automata, arXiv:1503.01168 [math.CO], 2015.
Crossrefs
Programs
-
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 *)
-
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
Formula
a(n) = A227349(n)^2. - Omar E. Pol, Feb 10 2015
Comments