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.

User: Bartlomiej Pawlik

Bartlomiej Pawlik's wiki page.

Bartlomiej Pawlik has authored 16 sequences. Here are the ten most recent ones:

A384728 The number of different shuffle square roots of the prefix of length 2n of the infinte word 00110011001100...

Original entry on oeis.org

1, 1, 1, 2, 3, 4, 6, 9, 13, 19, 28, 42, 62, 91, 135, 204, 304, 450, 674, 1016, 1519, 2267, 3408, 5138, 7718, 11574, 17431, 26325, 39653, 59637, 89962, 136038, 205288, 309398, 467365, 707419, 1069043, 1613776, 2440562, 3697006, 5593116, 8454010, 12797766, 19398770, 29374186, 44446508
Offset: 1

Author

Bartlomiej Pawlik, Jun 08 2025

Keywords

Comments

A shuffle square is a word obtained by self-shuffle (by mixing two copies of the same word called a root, and keeping the order of letters from each copy). For example, the shuffle square "ikilikli" can be obtained by self-shuffling the root word "ikli" (ik-i-li-kli). The word 0011 is a shuffle square (with root 01), while 0110 is not.
The even-length prefixes of the word 001100110011... have a relatively large number of shuffle square roots among all binary words of the same length.
Conjecture: There are infinitely many natural numbers n such that, among all shuffle squares of length 2n, the prefix of the word 001100110011... has the greatest number of distinct shuffle square roots.

Examples

			a(4) = 2 since the only shuffle square roots of 00110011 are 0011, 0101.
a(6) = 4 since the only shuffle square roots of 001100110011 are 001101, 011001, 010011, 010101.
		

Crossrefs

Cf. A191755 (number of all binary shuffle squares with length 2n).

Programs

  • Python
    from functools import cache
    def a(n):
        @cache
        def shuffle_roots(w, s1, s2):
            if len(s1) >= len(s2) and len(s1) <= n and s1[:len(s2)] == s2:
                if len(w) > 0:
                    shuffle_roots(w[1:], s1 + w[0], s2)
                    if w[0] in s1[len(s2):]:
                        shuffle_roots(w[1:], s1, s2 + w[0])
                if len(w) == 0 and s1 not in R:
                    R.add(s1)
        R, target = set(), "".join(["11", "00"][i&1] for i in range(1, n+1))
        shuffle_roots(target, "", "")
        return len(R)
    print([a(n) for n in range(1, 31)]) # Michael S. Branicky, Jun 18 2025

Extensions

a(24)-a(46) from Michael S. Branicky, Jun 19 2025

A384705 Number of binary shuffle squares of length 2n with prefix 0, that can be obtained from a unique binary word of length n.

Original entry on oeis.org

1, 3, 11, 38, 135, 475, 1681, 5875, 20641, 71956, 250448, 869332, 3015496, 10440429
Offset: 1

Author

Bartlomiej Pawlik, Jun 07 2025

Keywords

Comments

A shuffle square is a word obtained by self-shuffle (i.e. by mixing two copies of the same word, keeping the order of letters from each copy). For example, the shuffle square "tuteurer" can be obtained by self-shuffling the word "tuer" (tu-t-e-u-r-er). The word 0011 is a shuffle square, while 0110 is not.

Examples

			a(4) = 38 since there are exactly 41 binary shuffle squares of length 8 starting with 0, however three of them can be obtained from more than one binary word:
00100100 can be obtained from 0010 (e.g., 001-001-0-0) and from 0100 (e.g., 0-0-100-100);
00101011 from 0011 (001-0-1-011) and from 0101 (0-0-10-101-1);
00110011 from 0011 (e.g., 0011-0011) and form 0101 (e.g., 0-0-1-1-0-0-1-1).
		

Crossrefs

Cf. A191755 (number of all binary shuffle squares with length 2n).

Programs

  • Python
    from collections import Counter
    from itertools import combinations, combinations_with_replacement as cwr
    from sympy.utilities.iterables import multiset_permutations as mp
    def self_shuffles(w):
        sswset, n = set(), len(w)
        set2n, ssw = set(range(2*n)), [0 for i in range(2*n)]
        for s in combinations(list(range(2*n)), n):
            nots = sorted(set2n-set(s))
            for i, c in enumerate(w): ssw[s[i]] = ssw[nots[i]] = c
            sswset.add("".join(ssw))
        return sswset
    def a(n):
        if n == 0: return 1
        u = 0
        for w in cwr("10", n-1):          # "base" or "sorted" roots
            c = Counter()
            for pw in mp(w):              # iterate over permutations of these
                pw = "0" + "".join(pw)    # enforce prefix 0
                sspw = self_shuffles(pw)  # build self_shuffles from these roots
                c.update(sspw)
            u += sum(1 for x in c if c[x] == 1)  # count results w/unique roots
        return u
    print([a(n) for n in range(1, 10)]) # Michael S. Branicky, Jun 17 2025

Extensions

a(10)-a(12) corrected by Michael S. Branicky, Jun 15 2025
a(13) from Michael S. Branicky, Jun 17 2025
a(14) from Sean A. Irvine, Jun 24 2025

A369152 Total number of digits in row n of Pascal's triangle.

Original entry on oeis.org

1, 2, 3, 4, 5, 8, 10, 12, 14, 18, 25, 28, 31, 38, 44, 50, 57, 64, 69, 76, 88, 96, 102, 114, 125, 134, 142, 154, 166, 178, 191, 202, 215, 230, 244, 256, 268, 288, 303, 316, 334, 356, 372, 388, 411, 428, 447, 470, 490, 506, 529, 554, 573, 590, 618, 642, 660, 686
Offset: 0

Author

Bartlomiej Pawlik, Jan 14 2024

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> length(cat(seq(binomial(n,k), k=0..n))):
    seq(a(n), n=0..57);  # Alois P. Heinz, Jan 15 2024
  • Mathematica
    A369152[n_Integer] := Total[IntegerLength[Binomial[n, #]] & /@ Range[0, n]]
    First50Terms = Table[A369152[n], {n, 0, 49}]
  • PARI
    a(n) = #concat(vector(n+1, k, Str(binomial(n,k-1)))); \\ Michel Marcus, Jan 18 2024
    
  • Python
    from math import comb
    def A369152(n): return sum(len(str(comb(n,k))) for k in range(n+1)) # Chai Wah Wu, Feb 15 2024

Formula

a(n) = 1 + n + Sum_{k=0..n} floor(log_10(C(n,k))).
a(n) = A055642(A003590(n)). - Michel Marcus, Jan 15 2024

A365415 Number of decimal digits of e after its decimal point needed to contain all digit substrings of length n.

Original entry on oeis.org

20, 371, 8091, 102127, 1061612, 12108840, 198150340, 1929504533
Offset: 1

Author

Bartlomiej Pawlik, Sep 07 2023

Keywords

Comments

Length of the shortest prefix of the decimal expansion of e in which every possible digit string of length n occurs. We only consider the digits after the decimal point.
It is not known if every natural number appears in the decimal expansion of e. If this is the case, sequence a(n) contains a term for every n.

Examples

			a(1) = 20, since 20 is the smallest number of digits in decimal expansion of e in with every digit 0..9 (or, to be more precise, every digit string of length 1) appears: 2.71828182845904523536.
a(2) = 371, since the first appearance of the digit string "12" is at positions 370-371 of the decimal expansion of e and the remaining digit strings of length 2 appear at least once before that position.
a(3) = 8091, since the first appearance of the digit string "548" is at positions 8089-8091 of the decimal expansion of e and the remaining digit strings of length 3 appear at least once before that position.
a(4) = 102127, since the first appearance of the digit string "1769" is at positions 102124-102127 of the decimal expansion of e and the remaining digit strings of length 4 appear at least once before that position.
		

Crossrefs

Programs

  • Mathematica
    dok = 300000; an = {};
    For[li = 1, li <= 3, li++,
      p = ToString[N[E, dok]];
      cyf = {}; par = 0;
      For[i = 3, i <= dok, i++,
       If[par == 0,
        a = StringTake[p, {i, i + li - 1}];
        If[MemberQ[cyf, a] == False, cyf = Append[cyf, a];
         If[Length[cyf] == 10^li, an = Append[an, i + li - 3]; par = 1]],
        Break[]]
       ]];
    Print[an]

Formula

a(n) = A152182(n) + n - 2.

Extensions

a(6)-a(8) from Michael S. Branicky, Oct 04 2023

A364153 a(n) is the smallest positive integer such that from the set {1, 2, ..., a(n)} one can choose a sequence (s(1), s(2), ..., s(n)) in which every segment has a unique sum.

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 9, 10, 12, 13, 14, 17, 18
Offset: 1

Author

Bartlomiej Pawlik, Jul 11 2023

Keywords

Comments

A segment is a subsequence of consecutive elements.
Conjecture: There exists C such that a(n) < C*n for every sufficiently large n.

Examples

			a(6) = 7, because there exists a 6-element sequence on the set {1,2,...,7} with unique segment sums: (2,1,7,6,5,4) and 7 is the least positive integer with such property. The sums in the segments are: 2, 1, 7, 6, 5, 4 for 1-element segments; 3, 8, 13, 11, 9 for 2-element segments; 10, 14, 18, 15 for 3-element segments; 16, 19, 22 for 4-element segments; 21, 23 for 5-element segments; and 25 for the full set.
a(13) = 18 and the exemplary corresponding 13-element sequence is (1, 6, 15, 8, 11, 9, 16, 17, 18, 13, 14, 10, 2).
		

Crossrefs

Programs

  • PARI
    a(n, m=n+6) = my(k=1, s=vector(n, i, []), t, u=m, v=vector(n)); while(k, t=0; v[k]++; if(k==n, if(v[n]Jinyuan Wang, Jul 11 2023

Extensions

a(10)-a(13) from Jinyuan Wang, Jul 11 2023

A364132 a(n) is the smallest positive integer such that from the set {1, 2, ..., a(n)} one can choose an increasing sequence (s(1), s(2), ..., s(n)) in which every segment has a unique sum of elements.

Original entry on oeis.org

1, 2, 4, 5, 7, 10, 12, 13, 15, 18, 21, 24, 25, 29, 30, 33, 36, 38, 41, 47, 50, 52
Offset: 1

Author

Bartlomiej Pawlik, Jul 10 2023

Keywords

Comments

A segment is a subsequence of consecutive elements.

Examples

			a(6) = 10, because there exists a 6-element increasing sequence on {1,2,...,10} with unique segment sums, namely (1,2,4,5,8,10) and 10 is the least positive integer with that property. The sums in the segments are: 1, 2, 4, 5, 8, 10 for 1-element segments; 3, 6, 9, 13, 18 for 2-element segments; 7, 11, 17, 23 for 3-element segments; 12, 19, 27 for 4-element segments; 20, 29 for 5-element segments; and 30 for the full set.
a(13) = 25 and the corresponding 13-element subsequence is (1,2,11,15,16,17,18,19,20,21,22,24,25).
		

Crossrefs

Cf. A364153 (without monotonicity assumption).

Programs

  • PARI
    a(n, m=2*n) = my(k=1, s=vector(n, i, []), t, u=m, v=vector(n)); while(k>1||v[1]Jinyuan Wang, Jul 10 2023

Extensions

a(14)-a(22) from Jinyuan Wang, Jul 10 2023

A363446 Increasing sequence such that a(1) = 1 and a(n) is the least integer such that every segment of the sequence a(1),a(2),...,a(n) has a unique sum of elements.

Original entry on oeis.org

1, 2, 4, 5, 8, 10, 14, 21, 25, 26, 28, 31, 36, 38, 55, 56, 66, 68, 88, 91, 92, 94, 102, 125, 127, 136, 140, 158, 162, 164, 180, 182, 201, 217, 220, 226, 228, 240, 241, 259, 261, 275, 314, 331, 337, 342, 356, 366, 380, 391, 408, 432, 441, 444, 456, 469, 478, 548, 560, 565, 574, 577, 580, 586, 628, 639, 696, 701, 707, 730, 731, 732, 733, 752, 759, 773, 849, 877, 890, 922
Offset: 1

Author

Bartlomiej Pawlik, Jul 09 2023

Keywords

Comments

A segment is a subsequence given by consecutive elements.

Examples

			The smallest candidate for a(3) is 3, but the sequence (1,2,3) has two segments with equal sums, namely (1,2) and (3). The next candidate is 4 and every segment of the sequence (1,2,4) has a unique sum, so a(3) = 4.
		

Crossrefs

If we omit the condition that {a(n)} is increasing, we get A101274.
Cf. A276661.

A363459 Sum of the first n prime powers A246655.

Original entry on oeis.org

2, 5, 9, 14, 21, 29, 38, 49, 62, 78, 95, 114, 137, 162, 189, 218, 249, 281, 318, 359, 402, 449, 498, 551, 610, 671, 735, 802, 873, 946, 1025, 1106, 1189, 1278, 1375, 1476, 1579, 1686, 1795, 1908, 2029, 2154, 2281, 2409, 2540, 2677, 2816, 2965, 3116, 3273, 3436
Offset: 1

Author

Bartlomiej Pawlik, Jun 03 2023

Keywords

Comments

Partial sums of A246655.
If we consider 1 as a prime power, we get A024918.

Examples

			The first five terms of A246655 are 2,3,4,5,7, so a(5) = 2+3+4+5+7 = 21.
		

Crossrefs

Programs

  • Mathematica
    FoldList[Plus, Select[Range[150], PrimePowerQ]] (* Amiram Eldar, Jun 22 2025 *)

Formula

a(n) = A024918(n+1) - 1.

A362063 Number of 2-balanced binary words of length n with respect to the permutations of the symbols.

Original entry on oeis.org

1, 1, 2, 4, 8, 16, 31, 60, 111, 205, 364, 647, 1110, 1908, 3190, 5345, 8743, 14352, 23090, 37232, 59113, 94079, 147531, 232073, 360750, 561692, 865823, 1338269, 2047388, 3139690, 4781349, 7281656, 11021651, 16716751, 25178531, 37994309, 57046272
Offset: 0

Author

Dominika Datko, communicated by Bartlomiej Pawlik, Apr 07 2023

Keywords

Comments

2-balanced binary words are here defined as the binary words with such property that the sum of each subblock differs by at most 2 from every other subblock of the same length.
Can be interpreted as a number of 2-balanced binary words with the prefix "0".

Examples

			a(3) = 4 since 000, 001, 010 and 011 are 2-balanced.
a(6) = 31 since all words of form 0XXXXX are 2-balanced, except the word 000111.
		

Crossrefs

A274005 is the number of all binary 2-balanced words with given length.
A005598 is the number of all binary balanced (1-balanced) words with given length.

Formula

a(n) = A274005(n)/2 for n>0, since A274005 is the number of all binary 2-balanced words of given length.

A360412 Number of binary words of length 2n with an even number of 1's which are not shuffle squares.

Original entry on oeis.org

0, 0, 2, 10, 46, 192, 780, 3090, 12136, 47100, 181820, 697856, 2667642, 10157814, 38563342, 146002012, 551483230, 2078722874, 7821121318, 29378487188
Offset: 0

Author

Bartlomiej Pawlik, Feb 07 2023

Keywords

Comments

A shuffle square is a word obtained by self-shuffling, e.g., the French word "tuteurer" is a shuffle square as it can be obtained by self-shuffling the word "tuer".
Words with an odd number of 1's obviously are not shuffle squares.

Examples

			a(3)=10, since the binary words of length 6 with an even number of 1's which are not shuffle squares are 000110, 010001, 011000, 011101, 011110, 100001, 100010, 100111, 101110 and 111001.
		

Crossrefs

Cf. A191755.

Formula

a(n) = 2^(2n-1) - A191755(n), since the number of binary words of length 2n with an even number of 1's is 2^(2n-1).