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.

A088952 Numbers that are squarefree words in ternary representation.

Original entry on oeis.org

0, 1, 2, 3, 5, 6, 7, 10, 11, 15, 16, 19, 20, 21, 23, 32, 33, 34, 46, 47, 48, 57, 59, 61, 64, 65, 69, 96, 97, 100, 102, 104, 138, 140, 142, 145, 146, 173, 177, 178, 183, 185, 194, 195, 196, 208, 209, 289, 290, 291, 300, 302, 307, 312, 416, 421, 426, 428, 437, 438
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 25 2003

Keywords

Comments

A088950(a(n)) = 0.

Crossrefs

Programs

  • Mathematica
    Select[Range[0, 500], MatchQ[IntegerDigits[#, 3], Except[{_, x__, x__, _}]] &] (* Vladimir Reshetnikov, May 17 2016 *)
  • PARI
    See Links section.

A333124 a(n) is the number of square-subwords in the binary representation of n.

Original entry on oeis.org

0, 0, 0, 1, 1, 0, 1, 2, 2, 1, 1, 1, 2, 1, 2, 4, 4, 2, 1, 2, 2, 2, 1, 2, 3, 2, 2, 2, 3, 2, 4, 6, 6, 4, 2, 3, 3, 2, 2, 3, 3, 2, 3, 3, 2, 2, 2, 4, 5, 3, 2, 3, 3, 3, 3, 3, 4, 3, 3, 3, 5, 4, 6, 9, 9, 6, 4, 5, 3, 3, 3, 4, 4, 4, 3, 3, 3, 2, 3, 5, 5, 3, 3, 3, 4, 4, 3
Offset: 0

Views

Author

Rémy Sigrist, Mar 08 2020

Keywords

Comments

A square-(sub)word consists of two nonempty identical adjacent subwords.
This sequence is a binary variant of A088950.
Square-subwords are counted with multiplicity.
A binary word of length 4 contains necessarily a square-subword, hence a(n) tends to infinity as n tends to infinity (a number whose binary representation has >= 4*k digits has >= k square-subwords).

Examples

			For n = 43:
- the binary representation of 43 is "101011",
- we have the following square-subwords: "1010", "0101", "11",
- hence a(43) = 3.
		

Crossrefs

Programs

  • PARI
    a(n, base=2) = { my (b=digits(n, base), v); for (w=1, #b\2, for (i=1, #b-2*w+1, if (b[i..i+w-1]==b[i+w..i+2*w-1], v++))); return (v) }

Formula

a(2^k) = a(2^k-1) = A002620(k) for any k >= 0.

A088951 Number of distinct square-subwords in ternary representation of n.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 2, 1, 1, 1, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1
Offset: 0

Views

Author

Reinhard Zumkeller, Oct 25 2003

Keywords

Comments

a(n) <= A088950(n).

Examples

			n=125: a(125)=2 because 125 -> '11122' has 3 square-subwords: 11, 11 and 22 (11---, -11-- and ---22) and two of them are distinct.
		

Crossrefs

Cf. A007089.
Showing 1-3 of 3 results.