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.

Showing 1-3 of 3 results.

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.

A331469 a(n) is the greatest value of the form p_1 + ... + p_k where p_1, ..., p_k are powers of primes and such that the concatenation of the binary representations of p_1, ..., p_k equals the binary representation of n.

Original entry on oeis.org

1, 2, 3, 4, 5, 3, 7, 8, 9, 4, 11, 5, 13, 5, 8, 16, 17, 6, 19, 6, 7, 7, 23, 9, 25, 5, 27, 7, 29, 9, 31, 32, 17, 10, 18, 8, 37, 11, 20, 10, 41, 6, 43, 9, 15, 13, 47, 17, 49, 7, 26, 7, 53, 15, 28, 11, 26, 7, 59, 11, 61, 10, 32, 64, 33, 18, 67, 12, 13, 19, 71, 12
Offset: 1

Views

Author

Rémy Sigrist, Jan 17 2020

Keywords

Comments

We can always split the binary representation of a number into powers of 2, so the sequence is well defined.

Examples

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

Crossrefs

Programs

  • PARI
    See Links section.

Formula

a(n) >= A162439(n).
a(n) <= n with equality iff n is a power of a prime.

A331470 a(n) is the greatest value of the form s_1^2 + ... + s_k^2 such that the concatenation of the binary representations of s_1^2, ..., s_k^2 equals the binary representation of n.

Original entry on oeis.org

0, 1, 1, 2, 4, 2, 2, 3, 4, 9, 2, 3, 5, 3, 3, 4, 16, 5, 9, 10, 5, 3, 3, 4, 5, 25, 3, 4, 6, 4, 4, 5, 16, 17, 5, 6, 36, 10, 10, 11, 5, 10, 3, 4, 6, 4, 4, 5, 17, 49, 25, 26, 6, 4, 4, 5, 6, 26, 4, 5, 7, 5, 5, 6, 64, 17, 17, 18, 8, 6, 6, 7, 36, 37, 10, 11, 13, 11
Offset: 0

Views

Author

Rémy Sigrist, Jan 17 2020

Keywords

Comments

This sequence is a variant of A331362.

Examples

			For n = 12:
- the binary representation of 12 is "1100",
- we can split it into "1" and "1" and "0" and "0" (1^2 and 1^2 and 0^2 and 0^2),
- or into "1" and "100" (1^2 and 2^2),
- hence a(12) = max(2, 5) = 5.
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

a(n) >= A000120(n) with equality iff n belongs to A003754.
a(n^2) = n^2.
Showing 1-3 of 3 results.