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.

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.

This page as a plain text file.
%I A366370 #19 Dec 02 2023 16:07:48
%S A366370 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 A366370 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 A366370 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 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.
%H A366370 Antti Karttunen, <a href="/A366370/b366370.txt">Table of n, a(n) for n = 1..22155</a>
%H A366370 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%F A366370 A(n,k) = A285097(1+(A000225(n)^k)).
%F A366370 For all n >= 2, k >= 2,  A(n,2k) = n+A007814(k), A(n,2k+1) = 1+A007814(k).
%e A366370 The top left corner of the square array:
%e A366370   n\k| 1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17
%e A366370 -----+-------------------------------------------------------------------
%e A366370    1 | 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
%e A366370    2 | 0,  2,  1,  3,  2,  2,  1,  4,  3,  2,  1,  3,  2,  2,  1,  5,  4,
%e A366370    3 | 0,  3,  1,  4,  2,  3,  1,  5,  3,  3,  1,  4,  2,  3,  1,  6,  4,
%e A366370    4 | 0,  4,  1,  5,  2,  4,  1,  6,  3,  4,  1,  5,  2,  4,  1,  7,  4,
%e A366370    5 | 0,  5,  1,  6,  2,  5,  1,  7,  3,  5,  1,  6,  2,  5,  1,  8,  4,
%e A366370    6 | 0,  6,  1,  7,  2,  6,  1,  8,  3,  6,  1,  7,  2,  6,  1,  9,  4,
%e A366370    7 | 0,  7,  1,  8,  2,  7,  1,  9,  3,  7,  1,  8,  2,  7,  1, 10,  4,
%e A366370    8 | 0,  8,  1,  9,  2,  8,  1, 10,  3,  8,  1,  9,  2,  8,  1, 11,  4,
%e A366370    9 | 0,  9,  1, 10,  2,  9,  1, 11,  3,  9,  1, 10,  2,  9,  1, 12,  4,
%e A366370   10 | 0, 10,  1, 11,  2, 10,  1, 12,  3, 10,  1, 11,  2, 10,  1, 13,  4,
%e A366370   11 | 0, 11,  1, 12,  2, 11,  1, 13,  3, 11,  1, 12,  2, 11,  1, 14,  4,
%e A366370   12 | 0, 12,  1, 13,  2, 12,  1, 14,  3, 12,  1, 13,  2, 12,  1, 15,  4,
%e A366370   13 | 0, 13,  1, 14,  2, 13,  1, 15,  3, 13,  1, 14,  2, 13,  1, 16,  4,
%e A366370   14 | 0, 14,  1, 15,  2, 14,  1, 16,  3, 14,  1, 15,  2, 14,  1, 17,  4,
%e A366370   15 | 0, 15,  1, 16,  2, 15,  1, 17,  3, 15,  1, 16,  2, 15,  1, 18,  4,
%e A366370   16 | 0, 16,  1, 17,  2, 16,  1, 18,  3, 16,  1, 17,  2, 16,  1, 19,  4,
%e A366370   17 | 0, 17,  1, 18,  2, 17,  1, 19,  3, 17,  1, 18,  2, 17,  1, 20,  4,
%e A366370 etc.
%e A366370 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 A366370 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 A366370 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 A366370 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 A366370 Table[A366370[k,n-k+1],{n,20},{k,n}] (* _Paolo Xausa_, Dec 02 2023 *)
%o A366370 (PARI)
%o A366370 up_to = 105;
%o A366370 A285097(n) = if(!n || !bitand(n,n-1), 0, valuation((n>>valuation(n,2))-1, 2));
%o A366370 A366370sq(n,k) = A285097(1+(((2^n)-1)^k));
%o A366370 \\ Or more directly as:
%o A366370 A366370sq(n,k) = if(1==n||1==k, 0, if(!(k%2), n, 1)+valuation(k>>1,2));
%o A366370 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 A366370 v366370 = A366370list(up_to);
%o A366370 A366370(n) = v366370[n];
%Y A366370 Cf. A000225, A001511, A007088, A007814, A285097.
%K A366370 nonn,tabl
%O A366370 1,5
%A A366370 _Antti Karttunen_, Oct 14 2023