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.

A330720 a(n) is the number of ways of writing the binary expansion of n as a product (or concatenation) of nonpalindromes.

This page as a plain text file.
%I A330720 #16 Dec 31 2019 06:29:59
%S A330720 0,0,1,0,1,0,1,0,1,1,2,1,1,1,1,0,1,2,2,2,2,0,2,1,1,2,2,0,1,1,1,0,1,3,
%T A330720 3,3,3,3,3,2,2,3,4,2,2,2,3,1,1,3,2,1,2,2,3,1,1,2,2,1,1,1,1,0,1,4,4,4,
%U A330720 3,5,5,3,3,4,4,4,4,5,5,2,2,5,4,4,4,0,4
%N A330720 a(n) is the number of ways of writing the binary expansion of n as a product (or concatenation) of nonpalindromes.
%C A330720 This sequence is a variant of A215244.
%H A330720 Rémy Sigrist, <a href="/A330720/b330720.txt">Table of n, a(n) for n = 0..8192</a>
%H A330720 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%F A330720 a(2^k-1) = 0 for any k >= 0.
%F A330720 a(A020988(k+1)) = 2^k for any k >= 0.
%e A330720 For n = 41:
%e A330720 - the binary expansion of 41 is "101001",
%e A330720 - the possible products of nonpalindromes are "101001", "1010"."01", and "10"."10"."01",
%e A330720 - hence a(41) = 3.
%p A330720 ispali:= proc(L) L = ListTools:-Reverse(L) end proc:
%p A330720 g:= proc(L) option remember; local m;
%p A330720     add(procname(L[m+1..-1]), m= remove(t -> ispali(L[1..t]),[$1..nops(L)]))
%p A330720 end proc:
%p A330720 g([]):= 1:
%p A330720 seq(g(convert(n,base,2)),n=0..100); # _Robert Israel_, Dec 29 2019
%o A330720 (PARI) a(n) = my (b=binary(n), v=b!=Vecrev(b)); for (s=1, #b, my (z=b[s..#b]); if (z!=Vecrev(z), v+=a(fromdigits(b[1..s-1],2)))); v
%Y A330720 Cf. A020988, A154809, A215244, A301453.
%K A330720 nonn,base,look
%O A330720 0,11
%A A330720 _Rémy Sigrist_, Dec 28 2019