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!)
A366370 Square array A(n,k) giving the length of the least significant run of 0-bits in binary expansion of A000225(n)^k, or 0 if A000225(n)^k is a binary repunit. 3

%I #19 Dec 02 2023 16:07:48

%S 0,0,0,0,2,0,0,1,3,0,0,3,1,4,0,0,2,4,1,5,0,0,2,2,5,1,6,0,0,1,3,2,6,1,

%T 7,0,0,4,1,4,2,7,1,8,0,0,3,5,1,5,2,8,1,9,0,0,2,3,6,1,6,2,9,1,10,0,0,1,

%U 3,3,7,1,7,2,10,1,11,0,0,3,1,4,3,8,1,8,2,11,1,12,0,0,2,4,1,5,3,9,1,9,2,12,1,13,0

%N Square array A(n,k) giving the length of the least significant run of 0-bits in binary expansion of A000225(n)^k, or 0 if A000225(n)^k is a binary repunit.

%H Antti Karttunen, <a href="/A366370/b366370.txt">Table of n, a(n) for n = 1..22155</a>

%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>

%F A(n,k) = A285097(1+(A000225(n)^k)).

%F For all n >= 2, k >= 2, A(n,2k) = n+A007814(k), A(n,2k+1) = 1+A007814(k).

%e The top left corner of the square array:

%e n\k| 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17

%e -----+-------------------------------------------------------------------

%e 1 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

%e 2 | 0, 2, 1, 3, 2, 2, 1, 4, 3, 2, 1, 3, 2, 2, 1, 5, 4,

%e 3 | 0, 3, 1, 4, 2, 3, 1, 5, 3, 3, 1, 4, 2, 3, 1, 6, 4,

%e 4 | 0, 4, 1, 5, 2, 4, 1, 6, 3, 4, 1, 5, 2, 4, 1, 7, 4,

%e 5 | 0, 5, 1, 6, 2, 5, 1, 7, 3, 5, 1, 6, 2, 5, 1, 8, 4,

%e 6 | 0, 6, 1, 7, 2, 6, 1, 8, 3, 6, 1, 7, 2, 6, 1, 9, 4,

%e 7 | 0, 7, 1, 8, 2, 7, 1, 9, 3, 7, 1, 8, 2, 7, 1, 10, 4,

%e 8 | 0, 8, 1, 9, 2, 8, 1, 10, 3, 8, 1, 9, 2, 8, 1, 11, 4,

%e 9 | 0, 9, 1, 10, 2, 9, 1, 11, 3, 9, 1, 10, 2, 9, 1, 12, 4,

%e 10 | 0, 10, 1, 11, 2, 10, 1, 12, 3, 10, 1, 11, 2, 10, 1, 13, 4,

%e 11 | 0, 11, 1, 12, 2, 11, 1, 13, 3, 11, 1, 12, 2, 11, 1, 14, 4,

%e 12 | 0, 12, 1, 13, 2, 12, 1, 14, 3, 12, 1, 13, 2, 12, 1, 15, 4,

%e 13 | 0, 13, 1, 14, 2, 13, 1, 15, 3, 13, 1, 14, 2, 13, 1, 16, 4,

%e 14 | 0, 14, 1, 15, 2, 14, 1, 16, 3, 14, 1, 15, 2, 14, 1, 17, 4,

%e 15 | 0, 15, 1, 16, 2, 15, 1, 17, 3, 15, 1, 16, 2, 15, 1, 18, 4,

%e 16 | 0, 16, 1, 17, 2, 16, 1, 18, 3, 16, 1, 17, 2, 16, 1, 19, 4,

%e 17 | 0, 17, 1, 18, 2, 17, 1, 19, 3, 17, 1, 18, 2, 17, 1, 20, 4,

%e etc.

%e A000225(4)^4 = ((2^4)-1)^4 = 50625 and A007088(50625) = "1100010111000001", where the rightmost run of 0-bits has length 5, therefore A(4,4) = 5.

%e A000225(3)^5 = ((2^3)-1)^5 = 16807 and A007088(16807) = "100000110100111", where the rightmost run of 0-bits has length 2, therefore A(3,5) = 2.

%e A000225(5)^3 = ((2^5)-1)^3 = 29791 and A007088(29791) = "111010001011111", where the rightmost run of 0-bits is a singleton, therefore A(5,3) = 1.

%t A285097[n_]:=If[DigitCount[n,2,1]<2,0,IntegerExponent[BitAnd[n-1,n],2]-IntegerExponent[n,2]];A366370[n_,k_]:=A285097[1+(2^n-1)^k];

%t Table[A366370[k,n-k+1],{n,20},{k,n}] (* _Paolo Xausa_, Dec 02 2023 *)

%o (PARI)

%o up_to = 105;

%o A285097(n) = if(!n || !bitand(n,n-1), 0, valuation((n>>valuation(n,2))-1, 2));

%o A366370sq(n,k) = A285097(1+(((2^n)-1)^k));

%o \\ Or more directly as:

%o A366370sq(n,k) = if(1==n||1==k, 0, if(!(k%2), n, 1)+valuation(k>>1,2));

%o A366370list(up_to) = { my(v = vector(up_to), i=0); for(a=1,oo, for(col=1,a, i++; if(i > up_to, return(v)); v[i] = A366370sq(col,(a-(col-1))))); (v); };

%o v366370 = A366370list(up_to);

%o A366370(n) = v366370[n];

%Y Cf. A000225, A001511, A007088, A007814, A285097.

%K nonn,tabl

%O 1,5

%A _Antti Karttunen_, Oct 14 2023

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 September 15 14:12 EDT 2024. Contains 375938 sequences. (Running on oeis4.)