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.
%I A185333 #41 May 08 2021 06:29:48 %S A185333 2,2,4,3,8,6,16,9,32,20,64,34,128,72,256,129,512,272,1024,516,2048, %T A185333 1056,4096,2050,8192,4160,16384,8200,32768,16512,65536,32769,131072, %U A185333 65792,262144,131088,524288,262656,1048576,524292,2097152 %N A185333 Number of binary necklaces of n beads for which a cut exists producing a palindrome. %C A185333 For odd n, this corresponds to A029744, necklaces of n beads that are the same when turned over. For even n, consider the necklace "01", which satisfies A029744 but cannot be cut to produce a palindrome. %H A185333 Hugo Pfoertner and Robert G. Wilson v, <a href="/A185333/b185333.txt">Table of n, a(n) for n = 1..1000</a> %t A185333 f[n_] := If[OddQ@ n, 2^(n/2 + 1/2), Block[{k = IntegerExponent[n, 2] - 1}, 2^(n/2 - 1) + 2^((n/2 - 2^k)/(2^(k + 1)))]]; Array[f, 41] (* _Robert G. Wilson v_, Aug 08 2011 *) %o A185333 (Python) %o A185333 def a(n): %o A185333 if n%2: return 2**((n + 1)//2) %o A185333 k=bin(n - 1)[2:].count('1') - bin(n)[2:].count('1') %o A185333 return 2**(n//2 - 1) + 2**((n//2 - 2**k)//(2**(k + 1))) %o A185333 print([a(n) for n in range(1, 101)]) # _Indranil Ghosh_, Jun 29 2017 %Y A185333 Cf. A185376, A025480. - _Hugo Pfoertner_, Jul 30 2011 %K A185333 nonn %O A185333 1,1 %A A185333 _Tony Bartoletti_, Feb 20 2011