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

A357432 a(1) = 1; a(2) = 2; for n > 2, a(n) is the smallest positive number not occurring earlier such that a(n) plus the sum of all previous terms appears in the string concatenation of a(1)..a(n-1).

Original entry on oeis.org

1, 2, 9, 17, 62, 38, 47, 115, 93, 87, 122, 30, 88, 51, 85, 4, 3, 31, 32, 21, 221, 64, 68, 302, 53, 116, 92, 268, 42, 48, 18, 78, 76, 97, 50, 153, 233, 108, 63, 20, 8, 16, 89, 12, 77, 537, 24, 377, 83, 46, 306, 28, 107, 197, 170, 126, 61, 566, 218, 82, 43, 25, 14, 148, 147, 6, 209, 145, 37, 103
Offset: 1

Views

Author

Scott R. Shannon, Sep 28 2022

Keywords

Comments

The sequence is conjectured to be a permutation of the positive integers. In the first 20000 terms the fixed points are 393, 514, 1546, and 7854, although more likely exist.

Examples

			a(4) = 17 as a(1) + a(2) + a(3) + 17 = 1 + 2 + 9 + 17 = 29, and "29" appears in the string concatenation of a(1)..a(3) = "129".
		

Crossrefs

A352245 a(0) = 1; for n >= 1, a(n) = the decimal value of the binary number of the index of where n first appears in the concatenation of all previous binary terms. If the binary value of n has not previously appeared then a(n) = 0.

Original entry on oeis.org

1, 1, 0, 1, 0, 2, 1, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0, 8, 0, 0, 6, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 20, 0, 8, 0, 0, 0, 0, 0, 6, 0, 2, 0, 0, 0, 0, 0, 0, 0, 56, 0, 26, 1, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 47, 20, 0, 71, 8, 84, 0, 110, 57, 0, 0, 0, 0, 0, 0, 0, 27, 6, 79, 155, 4, 2, 0, 0, 0, 0, 0, 0, 134
Offset: 0

Views

Author

Scott R. Shannon, Mar 09 2022

Keywords

Comments

In the first 250000 terms the longest run of consecutive 0 terms is seven, the first occurrence of which starts at a(43). It is unknown if longer runs exists. See the companion sequence A352246 for the indices where a(n) = 0.

Examples

			a(1) = 1 as the binary string concatenation up to a(0) = '1', and the binary value of 1 is '1' which appears at index 1 in the string.
a(2) = 0 as the binary string concatenation up to a(1) = '11', while the binary value of 2 is '10' which does not appear in the string.
a(3) = 1 as the binary string concatenation up to a(2) = '110', and the binary value of 3 is '11' which appears at index 1 in the string.
a(5) = 2 as the binary string concatenation up to a(4) = '11010', and the binary value of 5 is '101' which appears at index 2 in the string.
a(17) = 8 as the binary string concatenation up to a(16) = '1101010100010001000', and the binary value of 17 is '10001' which appears at index 8 in the string.
		

Crossrefs

Cf. A352246, A342303 (from end), A351753, A341766.

Programs

  • Python
    from itertools import count, islice
    def agen():
        b = "1"
        yield 1
        for k in count(1):
            bk = bin(k)[2:]
            idx = b.find(bk) + 1
            yield idx
            b += bin(idx)[2:]
    print(list(islice(agen(), 93))) # Michael S. Branicky, Mar 18 2022

A352246 Indices k where A352245(k) = 0.

Original entry on oeis.org

2, 4, 7, 8, 9, 11, 12, 14, 15, 16, 18, 19, 22, 23, 24, 25, 27, 28, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 45, 46, 47, 48, 49, 51, 54, 55, 57, 58, 59, 60, 61, 62, 63, 66, 70, 73, 74, 75, 76, 77, 78, 79, 86, 87, 88, 89, 90, 91, 96, 99, 101, 103, 107, 117, 118, 123, 126, 127, 140, 147, 151
Offset: 0

Views

Author

Scott R. Shannon, Mar 09 2022

Keywords

Comments

See A352245 for further details and examples.

Crossrefs

Programs

  • Python
    from itertools import count, islice
    def agen():
        b = "1"
        for k in count(1):
            bk = bin(k)[2:]
            idx = b.find(bk) + 1
            if idx == 0: yield k
            b += bin(idx)[2:]
    print(list(islice(agen(), 73))) # Michael S. Branicky, Mar 18 2022

A357930 a(0) = 0; for n > 0, let S = concatenation of a(0)..a(n-1); a(n) is the number of times the digit at a(n-1) digits back from the end of S appears in S.

Original entry on oeis.org

0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 7, 7, 8, 8, 7, 7, 8, 8, 7, 13, 7, 14, 7, 13, 13, 15, 15, 13, 15, 15, 6, 17, 16, 19, 8, 10, 10, 22, 10, 23
Offset: 0

Views

Author

Scott R. Shannon, Oct 21 2022

Keywords

Examples

			a(7) = 3 as a(6) = 3 and the string concatenation of a(0)..a(6) = "0112223", and the digit 3 digits back from the end of the string concatenation is 2, and 2 has appeared three times in the string.
		

Crossrefs

Programs

  • MATLAB
    function a = A357930( max_n )
        a = 0; s = '0'; c = zeros(1,10); c(1) = 1;
        for n = 2:max_n
            k = c(s(end-a(n-1))-47); sk = num2str(k);
            c(sk-47) = c(sk-47)+1; s = [s sk]; a(n) = k;
        end
    end % Thomas Scheuerle, Oct 21 2022

A355715 a(0) = 0; for n > 0, a(n) is the total number of binary bits that n has in common with all previous terms.

Original entry on oeis.org

0, 0, 2, 1, 3, 2, 7, 8, 8, 9, 16, 15, 17, 17, 18, 19, 32, 35, 39, 42, 33, 36, 40, 40, 50, 50, 57, 57, 50, 49, 53, 54, 92, 91, 94, 93, 85, 87, 89, 90, 101, 105, 106, 113, 103, 109, 108, 116, 143, 146, 144, 149, 145, 151, 146, 153, 161, 169, 161, 170, 159, 169, 158, 170, 184, 192, 187, 194, 181
Offset: 0

Views

Author

Scott R. Shannon, Jul 15 2022

Keywords

Crossrefs

Formula

a(1) = 0 as a(0) = 0, and 0 shares no bits in common with 1.
a(2) = 2 as a(0) = 0, a(1) = 0, and 2 = 10_2 has the 0-bit in common with both previous terms.
a(3) = 1 as a(2) = 2 = 10_2 and 3 = 11_2 shares a 1-bit in common with 2.
a(6) = 7 as a(0) = 0, a(1) = 0, a(2) = a(5) = 2 = 10_2, a(4) = 3 = 11_2 and 6 = 110_2 shares four 0-bits and three 1-bits, seven bits in all, with these previous terms.

A357880 a(1) = a(2) = 1; for n > 2, a(n) is the smallest positive number such that a(n) plus the sum of all previous terms appears in the string concatenation of a(1)..a(n-1).

Original entry on oeis.org

1, 1, 9, 8, 79, 21, 79, 19, 574, 1, 87, 40, 2, 36, 30, 211, 593, 83, 83, 30, 128, 64, 184, 501, 148, 9, 280, 329, 203, 5, 185, 161, 3, 314, 391, 119, 150, 24, 556, 197, 195, 64, 105, 108, 8, 777, 207, 16, 302, 52, 147, 2, 111, 298, 53, 67, 66, 20, 105, 99, 37, 15, 85, 51, 183, 39, 45, 8, 14
Offset: 1

Views

Author

Scott R. Shannon, Oct 18 2022

Keywords

Comments

It is conjectured that all numbers eventually appear. In the first 100000 terms the only fixed point is 210; it is likely no more exist.

Examples

			a(6) = 21 as a(1) + ... + a(5) + 21 = 98 + 21 = 119, and "119" appears in the string concatenation of a(1)..a(5) = "119879".
		

Crossrefs

Programs

  • Mathematica
    nn = 120; a[1] = a[2] = 1; s = 2; w = "11"; Do[k = 1; While[! StringContainsQ[w, ToString[k + s]], k++]; a[n] = k; s += k; w = StringJoin[w, ToString[k]], {n, 3, nn}]; Array[a, nn] (* Michael De Vlieger, Oct 20 2022 *)

A356537 Numbers k whose binary expansion is a substring of the binary expansion of binomial(k,2).

Original entry on oeis.org

3, 5, 9, 11, 17, 33, 44, 50, 58, 65, 129, 257, 396, 452, 513, 581, 864, 971, 1025, 1139, 1843, 1881, 1914, 2049, 2541, 2676, 2929, 3130, 4097, 4596, 5254, 6621, 7010, 7111, 8193, 10771, 11140, 12655, 16385, 17090, 19135, 19371, 19580, 20985, 27117, 27845, 32769, 35272, 44278, 46779, 56069
Offset: 1

Views

Author

Scott R. Shannon, Aug 11 2022

Keywords

Comments

All numbers of the form 2^m+1, m>=1, are in the sequence. There are 152 terms below 100 million.

Examples

			9 is a term as 9 = 1001_2 and binomial(9,2) = 9!/(2!7!) = 36 = 100100_2 and "100100" contains "1001" as a substring.
		

Crossrefs

Programs

  • Mathematica
    kmax=56100; a={}; For[k=1, k<=kmax, k++, If[StringContainsQ[ToString[FromDigits[IntegerDigits[Binomial[k, 2], 2]]], ToString[FromDigits[IntegerDigits[k,2]]]], AppendTo[a, k]]]; a (* Stefano Spezia, Aug 11 2022 *)
  • PARI
    str(k) = Str(fromdigits(binary(k)));
    isok(k) = #strsplit(str(binomial(k,2)), str(k)) > 1; \\ Michel Marcus, Aug 11 2022
    
  • Python
    from math import comb
    def ok(n): return n > 0 and str(bin(n)[2:]) in str(bin(comb(n, 2))[2:])
    print([k for k in range(10**5) if ok(k)]) # Michael S. Branicky, Aug 11 2022
Showing 1-7 of 7 results.