Original entry on oeis.org
3, 3, 9, 11, 1, 3, 33, 43, 1, 3, 1, 11, 1, 3, 129, 171, 1, 3, 1, 11, 1, 3, 1, 43, 1, 3, 1, 11, 1, 3, 513, 683, 1, 3, 1, 11, 1, 3, 1, 43, 1, 3, 1, 11, 1, 3, 1, 171, 1, 3, 1, 11, 1, 3, 1, 43, 1, 3, 1, 11, 1, 3, 2049, 2731, 1, 3, 1, 11, 1, 3, 1, 43, 1, 3, 1, 11, 1, 3, 1, 171, 1, 3, 1, 11, 1, 3, 1, 43, 1
Offset: 0
A212591
a(n) is the smallest value of k for which A020986(k) = n.
Original entry on oeis.org
0, 1, 2, 5, 8, 9, 10, 21, 32, 33, 34, 37, 40, 41, 42, 85, 128, 129, 130, 133, 136, 137, 138, 149, 160, 161, 162, 165, 168, 169, 170, 341, 512, 513, 514, 517, 520, 521, 522, 533, 544, 545, 546, 549, 552, 553, 554, 597, 640, 641, 642, 645, 648, 649, 650, 661
Offset: 1
-
NB. J function on a vector
NB. Beware round-off errors on large arguments
NB. ok up to ~ 1e8
alphav =: 3 : 0
n =. <: y
if.+/ ntlo=. n > 0 do.
n =. ntlo#n
m =. >.-: n
r =. <.2^.m
f =. <.3%~2+2^2*>:i.>./>:r
z =. 0
mi =. m
for_i. i.#f do.
z =. z + (i{f) * <.0.5 + mi =. mi%2
end.
nzer=. (+/ @: (0=>./\)@:|.)"1 @: #: m
ntlo #^:_1 z - (2|n) * <.-:nzer{f
else.
ntlo
end.
)
NB. eg alphav 1 3 5 100 2 8 33
-
alpha(n)={
if(n<2, return(max(0,n-1)));
local(nm1=n-1,
mi=m=ceil(nm1/2),
r=floor(log(m)/log(2)),
i,fi,alpha=0,a);
forstep(i=1, 2*r+1, 2,
mi/=2;
fi=(1+2^i)\3;
alpha+=fi*floor(0.5+mi);
);
alpha*=2;
if(nm1%2, \\ adjust for even n
a=factor(2*m)[1,2]-1;
alpha-= (1+2^(1+2*a))\3;
);
return(alpha);
}
A093573
Triangle read by rows: row n gives positions where n occurs in the Golay-Rudin-Shapiro related sequence A020986.
Original entry on oeis.org
0, 1, 3, 2, 4, 6, 5, 7, 13, 15, 8, 12, 14, 16, 26, 9, 11, 17, 19, 25, 27, 10, 18, 20, 22, 24, 28, 30, 21, 23, 29, 31, 53, 55, 61, 63, 32, 50, 52, 54, 56, 60, 62, 64, 106, 33, 35, 49, 51, 57, 59, 65, 67, 105, 107, 34, 36, 38, 48, 58, 66, 68, 70, 104, 108, 110, 37, 39, 45, 47, 69, 71, 77, 79, 101, 103, 109, 111
Offset: 1
A020986(n) for n = 0, 1, ... is 1, 2, 3, 2, 3, 4, 3, 4, 5, 6, ..., so the positions of 1, 2, 3, 4, ... are 0; 1, 3; 2, 4, 6; 5, 7, 13, 15; ...
From _Seiichi Manyama_, Apr 23 2017: (Start)
Triangle begins:
0,
1, 3,
2, 4, 6,
5, 7, 13, 15,
8, 12, 14, 16, 26,
9, 11, 17, 19, 25, 27,
10, 18, 20, 22, 24, 28, 30,
21, 23, 29, 31, 53, 55, 61, 63,
32, 50, 52, 54, 56, 60, 62, 64, 106,
33, 35, 49, 51, 57, 59, 65, 67, 105, 107,
34, 36, 38, 48, 58, 66, 68, 70, 104, 108, 110,
... (End)
-
a093573 n k = a093573_row n !! (k-1)
a093573_row n = take n $ elemIndices n a020986_list
a093573_tabl = map a093573_row [1..]
-- Reinhard Zumkeller, Jun 06 2012
-
With[{n = 16}, TakeWhile[#, Length@ #2 == #1 & @@ # &][[All, -1]] &@ Transpose@ {Keys@ #, Lookup[#, Keys@ #]} &[PositionIndex@ Accumulate@ Array[1 - 2 Mod[Length[FixedPointList[BitAnd[#, # - 1] &, BitAnd[#, Quotient[#, 2]]]], 2] &, n^2, 0] - 1]] // Flatten (* Michael De Vlieger, Jan 25 2020 *)
Showing 1-3 of 3 results.
Comments