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-5 of 5 results.

A302395 a(n) is the number of ways of writing the binary expansion of n as a concatenation of distinct nonempty substrings.

Original entry on oeis.org

1, 1, 2, 1, 3, 3, 3, 3, 6, 6, 6, 5, 5, 5, 6, 3, 9, 10, 10, 9, 9, 8, 10, 9, 9, 9, 9, 7, 9, 9, 9, 5, 14, 19, 19, 17, 17, 16, 18, 17, 19, 16, 17, 16, 17, 16, 19, 13, 15, 17, 17, 14, 15, 16, 17, 12, 18, 17, 19, 12, 15, 13, 14, 11, 25, 31, 30, 29, 27, 29, 31, 30
Offset: 0

Views

Author

Rémy Sigrist, Apr 07 2018

Keywords

Comments

Leading zeros in the binary expansion of n are ignored.
The value a(0) = 1 corresponds to the empty concatenation.
See A301453 for similar sequences.

Examples

			For n = 7: the binary expansion of 7, "111", can be split in 3 ways into distinct nonempty substrings:
- (111),
- (11)(1),
- (1)(11).
Hence a(7) = 3.
For n = 42: the binary expansion of 42, "101010", can be split in 17 ways into distinct nonempty substrings:
- (101010),
- (10101)(0),
- (1010)(10),
- (1010)(1)(0),
- (101)(010),
- (101)(01)(0),
- (101)(0)(10),
- (10)(1010),
- (10)(101)(0),
- (10)(1)(010),
- (10)(1)(01)(0),
- (1)(01010),
- (1)(0101)(0),
- (1)(010)(10),
- (1)(01)(010),
- (1)(01)(0)(10),
- (1)(0)(1010).
Hence a(42) = 17.
		

Crossrefs

Programs

  • PARI
    a(n{, s=Set()}) = if (n==0, return (1), my (v=0, p=1); while (n, p=(p*2) + (n%2); n\=2; if (!setsearch(s, p), v+=a(n, setunion(s, Set(p))))); return (v))

Formula

a(2^n - 1) = A032020(n) for any n >= 0.

A302436 a(n) is the number of ways of writing the binary expansion of n as a concatenation of nonempty substrings with Hamming weight at most 1.

Original entry on oeis.org

1, 1, 2, 1, 4, 3, 2, 1, 8, 7, 6, 3, 4, 3, 2, 1, 16, 15, 14, 7, 12, 9, 6, 3, 8, 7, 6, 3, 4, 3, 2, 1, 32, 31, 30, 15, 28, 21, 14, 7, 24, 21, 18, 9, 12, 9, 6, 3, 16, 15, 14, 7, 12, 9, 6, 3, 8, 7, 6, 3, 4, 3, 2, 1, 64, 63, 62, 31, 60, 45, 30, 15, 56, 49, 42, 21
Offset: 0

Views

Author

Rémy Sigrist, Apr 08 2018

Keywords

Comments

Leading zeros in the binary expansion of n are ignored.
The value a(0) = 1 corresponds to the empty concatenation.
See A301453 for similar sequences.

Examples

			For n = 9: the binary expansion of 9, "1001", can be split in 7 ways into nonempty substrings with Hamming weight at most 1:
- (100)(1),
- (10)(01),
- (10)(0)(1),
- (1)(001),
- (1)(00)(1),
- (1)(0)(01),
- (1)(0)(0)(1).
Hence a(9) = 7.
		

Crossrefs

Cf. A301453.

Programs

  • PARI
    a(n) = if (n==0, return (1), my (v=0, h=0); while (n, h += n%2; n\=2; if (h>1, break, v+=a(n))); return (v))

Formula

a(2^n - 1) = 1 for any n >= 0.
a(2^n) = 2^n for any n >= 0.
a(2*n) = 2*a(n) for any n > 0.

A302437 a(n) is the number of ways of writing the binary expansion of n as a concatenation of nonempty substrings with Hamming weight at most 2.

Original entry on oeis.org

1, 1, 2, 2, 4, 4, 4, 3, 8, 8, 8, 7, 8, 7, 6, 5, 16, 16, 16, 15, 16, 15, 14, 11, 16, 15, 14, 13, 12, 11, 10, 8, 32, 32, 32, 31, 32, 31, 30, 23, 32, 31, 30, 27, 28, 25, 22, 18, 32, 31, 30, 29, 28, 27, 26, 20, 24, 23, 22, 20, 20, 18, 16, 13, 64, 64, 64, 63, 64
Offset: 0

Views

Author

Rémy Sigrist, Apr 08 2018

Keywords

Comments

Leading zeros in the binary expansion of n are ignored.
The value a(0) = 1 corresponds to the empty concatenation.
See A301453 for similar sequences.

Examples

			For n = 14: the binary expansion of 14, "1110", can be split in 6 ways into substrings with Hamming weight at most 2:
- (11)(10),
- (11)(1)(0),
- (1)(110),
- (1)(11)(0),
- (1)(1)(10),
- (1)(1)(1)(0).
Hence a(14) = 6.
		

Crossrefs

Programs

  • PARI
    a(n) = if (n==0, return (1), my (v=0, h=0); while (n, h += n%2; n\=2; if (h>2, break, v += a(n))); return (v))

Formula

a(2^n - 1) = A000045(n + 1) for any n >= 0.
a(2^n) = 2^n for any n >= 0.
a(2*n) = 2*a(n) for any n > 0.
If 1 <= A000120(n) <= 2 then a(n) = A053644(n).

A302439 a(n) is the number of ways of writing the binary expansion of n as a concatenation of nonempty aperiodic substrings (i.e., substrings that are not the concatenation of 2 or more equal parts).

Original entry on oeis.org

1, 1, 2, 1, 3, 3, 3, 1, 4, 4, 6, 4, 5, 5, 4, 1, 5, 5, 10, 5, 10, 9, 11, 5, 7, 7, 10, 7, 7, 7, 5, 1, 6, 6, 14, 6, 16, 15, 16, 6, 14, 14, 19, 13, 18, 17, 16, 6, 9, 9, 17, 9, 16, 15, 17, 9, 10, 10, 14, 10, 9, 9, 6, 1, 7, 7, 18, 7, 24, 21, 21, 7, 23, 22, 32, 22
Offset: 0

Views

Author

Rémy Sigrist, Apr 08 2018

Keywords

Comments

Leading zeros in the binary expansion of n are ignored.
The value a(0) = 1 corresponds to the empty concatenation.
See A301453 for similar sequences.
For some odd o = 2*k + 1, is there some k such that for all e > k, a(o * 2^e) = a(o + 2^(e - 1)) + c for some c? - David A. Corneth, Apr 15 2018

Examples

			For n = 20: the binary expansion of 20, "10100", can be split in 10 ways into aperiodic substrings:
- (10100),
- (101)(0)(0),
- (10)(100),
- (10)(10)(0),
- (10)(1)(0)(0),
- (1)(0100),
- (1)(010)(0),
- (1)(0)(100),
- (1)(0)(10)(0),
- (1)(0)(1)(0)(0).
Hence a(20) = 10.
		

Crossrefs

Cf. A301453.

Programs

  • PARI
    a(n) = if (n==0, return (1), my (v=0); for (w=1, #binary(n), my (ok=1); fordiv (w, d, if (d
    				

Formula

a(2^n - 1) = 1 for any n >= 0.
a(2^n) = n + 1 for any n >= 0.
From David A. Corneth, Apr 15 2018: (Start)
Is a(2^n + i) >= a(2^n) for 0 <= i <= 2^n - 2?
What is the least k(n) such that
a(2^n + i) <= a(2^n + k(n)) for 1 <= i <= 2^n - 2? (End)

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.
Showing 1-5 of 5 results.