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.

Previous Showing 11-13 of 13 results.

A220654 Smallest number that can be written in binary representation in exactly n ways as concatenation of palindromes.

Original entry on oeis.org

0, 3, 9, 7, 17, 23, 34, 15, 33, 39, 55, 47, 66, 88, 72, 31, 65, 71, 103, 79, 133, 111, 152, 95, 130, 136, 215, 176, 277, 144, 273, 63, 129, 135, 199, 143, 443, 207, 284, 159, 261, 280, 239, 223, 588, 260, 264, 191, 258, 376, 272, 336, 627, 431, 529, 352, 532
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 17 2012

Keywords

Comments

A215244(a(n)) = n and A215244(m) < n for m < a(n).

Programs

  • Haskell
    import Data.List (elemIndex)
    import Data.Maybe (fromJust)
    a220654 = fromJust . (`elemIndex` a215244_list)

A331471 Consider the different ways to split the binary representation of n into palindromic parts; a(n) is the greatest possible sum of the parts of such a split.

Original entry on oeis.org

0, 1, 1, 3, 1, 5, 3, 7, 1, 9, 5, 6, 3, 6, 7, 15, 1, 17, 9, 10, 5, 21, 7, 8, 3, 10, 6, 27, 7, 8, 15, 31, 1, 33, 17, 18, 9, 10, 10, 12, 5, 10, 21, 22, 7, 45, 15, 16, 3, 18, 10, 51, 6, 22, 27, 28, 7, 12, 9, 28, 15, 16, 31, 63, 1, 65, 33, 34, 17, 18, 18, 20, 9, 73
Offset: 0

Views

Author

Rémy Sigrist, Jan 17 2020

Keywords

Comments

Leading zeros are forbidden in the binary representation of n; however we allow leading zeros in the palindromic parts.

Examples

			For n = 10:
- the binary representation of 10 is "1010",
- we can split it into "1" and "0" and "1" and "0" (1 and 0 and 1 and 0),
- or into "101" and "0" (5 and 0),
- or into "1" and "010" (1 and 2),
- hence a(n) = max(2, 5, 3) = 5.
		

Crossrefs

Programs

  • Mathematica
    palQ[w_] := w == Reverse@w; ric[tg_, cr_] := Block[{m = Length@tg, t}, If[m == 0, Sow@ Total[ FromDigits[#, 2] & /@ cr], Do[ If[ palQ[t = Take[tg, k]], ric[Drop[tg, k], Join[cr, {t}]]], {k, m}]]]; a[n_] := Max[ Reap[ ric[ IntegerDigits[n, 2], {}]][[2, 1]]]; a /@ Range[0, 73] (* Giovanni Resta, Jan 19 2020 *)
  • PARI
    See Links section.

Formula

a(n) >= A000120(n) with equality iff n = 0 or n is a power of 2.
a(n) <= n with equality iff n belongs to A006995.

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

Original entry on oeis.org

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, 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, 3, 5, 5, 3, 3, 4, 4, 4, 4, 5, 5, 2, 2, 5, 4, 4, 4, 0, 4
Offset: 0

Views

Author

Rémy Sigrist, Dec 28 2019

Keywords

Comments

This sequence is a variant of A215244.

Examples

			For n = 41:
- the binary expansion of 41 is "101001",
- the possible products of nonpalindromes are "101001", "1010"."01", and "10"."10"."01",
- hence a(41) = 3.
		

Crossrefs

Programs

  • Maple
    ispali:= proc(L) L = ListTools:-Reverse(L) end proc:
    g:= proc(L) option remember; local m;
        add(procname(L[m+1..-1]), m= remove(t -> ispali(L[1..t]),[$1..nops(L)]))
    end proc:
    g([]):= 1:
    seq(g(convert(n,base,2)),n=0..100); # Robert Israel, Dec 29 2019
  • 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

Formula

a(2^k-1) = 0 for any k >= 0.
a(A020988(k+1)) = 2^k for any k >= 0.
Previous Showing 11-13 of 13 results.