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

A272729 a(n) is the number of repetitions of 2n-1 in A272727.

Original entry on oeis.org

1, 2, 1, 3, 2, 1, 1, 4, 1, 3, 2, 2, 1, 1, 1, 5, 2, 1, 1, 4, 1, 3, 1, 3, 2, 2, 2, 1, 1, 1, 1, 6, 1, 3, 2, 2, 1, 1, 1, 5, 2, 1, 1, 4, 2, 1, 1, 4, 1, 3, 1, 3, 1, 3, 2, 2, 2, 2, 1, 1, 1, 1, 1, 7, 2, 1, 1, 4, 1, 3, 1, 3, 2, 2, 2, 1, 1, 1, 1, 6, 1, 3, 2, 2, 1, 1, 1, 5, 1, 3, 2, 2, 1, 1, 1, 5
Offset: 1

Views

Author

Ivan Neretin, May 05 2016

Keywords

Comments

Also, value of A272728 at the n-th local maximum.
Also, the trajectory of 1 under the morphism n->[1,1..1,n+1] (the number of 1's is n-1).
Average value tends to 2.
Number n makes its first appearance at the position 2^(n-1) and has frequency 1/2^n.
Conjectured first differences of A037988 (true for at least 8192 terms). - Sean A. Irvine, Jun 26 2022

Examples

			The morphism acts as follows:
1->2; 2->1,3; 3->1,1,4; 4->1,1,1,5; etc.
The trajectory starts as:
1 ->
2 ->
1,3 ->
2,1,1,4 ->
1,3,2,2,1,1,1,5 -> ...
The result of k iterations is a series with 2^(k-1) terms; their sum is 2^k.
If A001511 is laid out in a similar irregular triangle, each row
would contain the same terms, albeit in a different order:
1,
2,
1,3,
1,2,1,4,
1,2,1,3,1,2,1,5...
		

Crossrefs

Programs

  • Mathematica
    Flatten@NestList[Flatten[Append[ConstantArray[1, # - 1], # + 1] & /@ #] &, {1}, 7]

A272728 a(n) = A272727(2n-1) - n.

Original entry on oeis.org

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

Views

Author

Ivan Neretin, May 05 2016

Keywords

Comments

a(n)>=0.
|a(n+1)-a(n)|=1.
All local minima occur where a(n)=0. Values at the local maxima are listed in A272729.
Empirically: The least n such that a(n) = k - 1 is n = 2^k - k. - Danny Rorabaugh, May 12 2016

Crossrefs

Programs

  • Mathematica
    nn = 120; s = Nest[Append[#, Count[# - Reverse[#], x_ /; x == 0]] &, {0}, 2 nn - 1]; Table[s[[2 n]] - n, {n, nn}] (* Michael De Vlieger, May 05 2016, after Ivan Neretin at A272727 *)

A379266 a(n) is the number of coincidences of the first n terms of this sequence and the first n terms of A379265 in reverse order, i.e., the number of equalities a(k) = A379265(n-1-k) for 0 <= k < n.

Original entry on oeis.org

0, 1, 0, 2, 0, 1, 1, 2, 1, 0, 3, 1, 0, 2, 0, 2, 2, 2, 2, 3, 3, 3, 1, 0, 3, 2, 3, 3, 4, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 3, 6, 6, 6, 6, 8, 7, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 3, 4, 2, 1, 0, 5, 4, 4, 5, 6, 7, 8, 7, 9, 10, 11, 12, 12, 13, 16, 16, 16, 16, 14, 12
Offset: 0

Views

Author

Pontus von Brömssen, Dec 19 2024

Keywords

Comments

a(n) appears to grow roughly like sqrt(n).

Crossrefs

Programs

  • Python
    def A379266_list(nterms):
        A = []
        A379265 = []
        for n in range(nterms):
            a = sum(1 for x, y in zip(A, reversed(A379265)) if x==y)
            if n != 0:
                b += (b==A[-1])
            else:
                b = 0
            A.append(a)
            A379265.append(b)
        return A

A379265 a(n) is the number of coincidences of the first n terms of this sequence and A379266, i.e., the number of equalities a(k) = A379266(k) for 0 <= k < n.

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 10, 11, 12, 13, 13, 14, 14, 14, 14, 14, 15
Offset: 0

Views

Author

Pontus von Brömssen, Dec 19 2024

Keywords

Comments

a(n) appears to grow roughly like sqrt(n).

Crossrefs

Programs

  • Python
    def A379265_list(nterms):
        A = []
        A379266 = []
        for n in range(nterms):
            if n != 0:
                a += (a==A379266[-1])
            else:
                a = 0
            b = sum(1 for x,y in zip(A,reversed(A379266)) if x==y)
            A.append(a)
            A379266.append(b)
        return A

Formula

For n >= 1, a(n) = a(n-1)+1 if a(n-1) = A379266(n-1), otherwise a(n) = a(n-1).

A276638 a(0)=0; thereafter a(n) is the number of matches between the first n terms circularly shifted by s and the reverse of the first n terms, maximized over s.

Original entry on oeis.org

0, 1, 2, 1, 4, 3, 4, 3, 6, 3, 6, 3, 8, 5, 8, 5, 6, 5, 6, 7, 8, 7, 10, 7, 8, 7, 12, 7, 12, 7, 12, 7, 12, 7, 14, 9, 14, 9, 14, 9, 14, 9, 14, 9, 14, 11, 16, 11, 14, 11, 16, 11, 18, 11, 16, 11, 16, 11, 16, 11, 20, 13, 16, 13, 18, 13, 16, 13, 18, 13, 18, 13, 18
Offset: 0

Views

Author

Andrey Zabolotskiy, Sep 08 2016

Keywords

Comments

a(n) is the number of matches between (a(s), ..., a(n-1), a(0), ..., a(s-1)) and (a(n-1), ..., a(0)), maximized over s.
The odd bisection of the sequence (i. e., the subsequence a(2k+1)) appears to be bound both above and below by n^0.63 asymptotically. It includes odd terms only and grows monotonically with many plateaus.
The even bisection of the sequence (i. e., the subsequence a(2k)) appears to be bound both above and below asymptotically by the same power function as the odd bisection with larger coefficients. However, its behavior differs in other aspects: it includes even terms only and exhibits stochastic oscillations with increasing amplitude.

Examples

			The first 6 terms (0, 1, 2, 1, 4, 3) shifted by 5 to the left yield (3, 0, 1, 2, 1, 4), which coincides with the first 6 terms reversed (3, 4, 1, 2, 1, 0) at 4 positions, and no shift produces more matches than 4, thus a(6)=4.
		

Crossrefs

Cf. A272727.

Programs

  • Mathematica
    a = {0}; Do[AppendTo[a, Max@ Map[Count[Transpose@ #, w_ /; Equal @@ w] &, Array[{RotateLeft[a, #], Reverse@ a} &, n]]], {n, 72}]; a (* Michael De Vlieger, Sep 13 2016 *)
  • Python
    a = [0]
    for n in range(1, 100):
        a.append(max(sum(a[(i+s)%n]==a[-i-1] for i in range(n)) for s in range(n)))

A359807 a(1) = 0; thereafter a(n) is the largest a(i) + i which is < n among i = 1..n-1.

Original entry on oeis.org

0, 1, 1, 3, 4, 4, 4, 7, 7, 9, 10, 11, 11, 11, 11, 15, 16, 16, 16, 19, 19, 21, 21, 23, 24, 25, 26, 26, 26, 26, 26, 31, 31, 33, 34, 35, 35, 35, 35, 39, 40, 40, 40, 43, 44, 44, 44, 47, 47, 49, 49, 51, 51, 53, 54, 55, 56, 57, 57, 57, 57, 57, 57, 63, 64, 64, 64, 67, 67, 69, 69, 71, 72, 73, 74, 74, 74, 74, 74
Offset: 1

Views

Author

Neal Gersh Tolunsky, Jan 13 2023

Keywords

Comments

Critical values of Conway's game of one-dimensional phutball (A037988), except for the initial zero.
Conjectured run lengths are A272729, and the terms which occur here are partial sums of A272729.
The next distinct term here occurs at index a(i)+i+1 for every index i.

Examples

			For n=3, we see that for i=1 and 2, a(i)+i = 1 and 3, of which only 1 is < n=3, so that a(3)=1.
For n=5, i=1..4 have a(i)+i = 1,3,4,7 and the largest < n=5 is 4 so that a(5)=4.
		

Crossrefs

Programs

  • PARI
    lista(nn) = my(va = vector(nn)); va[1] = 0; for (n=2, nn, va[n] = vecmax(select(x->(xMichel Marcus, Jan 31 2023
    
  • PARI
    { my (v = 0, m = 0); for (n = 1, 79, if (bittest(m, n-1), v = n-1); print1 (v", "); m = bitor(m, 2^(v+n))) } \\ Rémy Sigrist, Feb 08 2023

A335060 a(n) is the number of values of k < n for which 4*(a(k) + a(n-k)) < n.

Original entry on oeis.org

0, 1, 0, 2, 2, 1, 2, 0, 4, 4, 2, 5, 6, 4, 2, 3, 10, 8, 6, 2, 6, 9, 6, 4, 8, 8, 8, 4, 12, 9, 10, 7, 10, 14, 10, 6, 8, 14, 14, 11, 12, 8, 16, 10, 14, 10, 16, 15, 14, 14, 16, 14, 12, 10, 16, 11, 18, 16, 14, 22, 20, 12, 12, 17, 24, 18, 22, 18, 22, 16, 10, 19, 26, 23, 18, 22, 24
Offset: 1

Views

Author

Samuel B. Reid, May 21 2020

Keywords

Examples

			a(6) is 1 because, if (a(k) + a(6-k)) * 4 is less than 6, k can only be 3.
a(9) is 4 because k must be 1, 3, 6, or 8 in order for (a(k) + a(9-k)) * 4 to be less than 9.
		

Crossrefs

Programs

  • C
    See Links section.
    
  • PARI
    lista(nn) = {my(va=vector(nn)); for (n=2, nn, va[n] = sum(k=1, n-1, 4*(va[k] + va[n-k]) < n);); va;} \\ Michel Marcus, May 22 2020

A380188 a(n) is the maximum number of coincidences of the first n terms of this sequence and a cyclic shift of the first n terms of A380189, i.e., the number of equalities a(k) = A380189((s+k) mod n) for 0 <= k < n, maximized over s.

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 6, 6, 6, 7, 7, 7, 7, 8, 8, 9, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12
Offset: 0

Views

Author

Pontus von Brömssen, Jan 15 2025

Keywords

Comments

Is a(n+1)-a(n) always 0 or 1?
Consider a pair of sequences b and c defined in the following manner:
- b(n) is the number of coincidences of the first n terms of sequences b and c,
- c(n) is the number of coincidences of the first n terms of sequence b and the first n terms of sequence c in reverse order.
(The sequences are "self-starting" with no initial values required, because for n = 0 there are obviously no coincidences, so b(0) = c(0) = 0.) For each of b and c, we may or may not allow circular shifts and maximize the number of coincidences over all such shifts, so there are four versions:
- No shifts: (b,c) = (A379265,A379266).
- Shifts in b but not in c: (b,c) = (A380188,A380189).
- Shifts in c and either shifts or no shifts in b: In both these cases, b and c are the following sequences, which are constant from n = 5 and n = 7, respectively:
b: 0, 1, 2, 3, 3, 4, 4, 4, 4, 4, ...
c: 0, 1, 2, 1, 3, 2, 2, 3, 3, 3, ...

Examples

			The first time the shift comes into play is for n = 21. The first 21 terms of this sequence and of A380189 are:
  0, 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
  0, 1, 0, 2, 0, 1, 1, 2, 1, 0, 3, 1, 0, 2, 0, 2, 2, 2, 2, 3, 3
  ^  ^     ^                    ^
with only 4 coincidences. But if the second row is shifted 7 steps to the right, we get:
  0, 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
  0, 2, 2, 2, 2, 3, 3, 0, 1, 0, 2, 0, 1, 1, 2, 1, 0, 3, 1, 0, 2
  ^     ^  ^     ^  ^
with 5 coincidences. This is the best possible, so a(21) = 5.
		

Crossrefs

A380189 a(n) is the number of coincidences of the first n terms of this sequence and the first n terms of A380188 in reverse order, i.e., the number of equalities a(k) = A380188(n-1-k) for 0 <= k < n.

Original entry on oeis.org

0, 1, 0, 2, 0, 1, 1, 2, 1, 0, 3, 1, 0, 2, 0, 2, 2, 2, 2, 3, 3, 3, 1, 0, 3, 2, 3, 3, 4, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 3, 6, 6, 6, 6, 8, 7, 6, 5, 5, 5, 4, 4, 2, 1, 0, 3, 1, 0, 2, 0, 2, 2, 3, 5, 7, 7, 6, 5, 4, 5, 5, 6, 3, 2, 2, 1, 1, 4, 3, 1, 2, 3, 2, 4, 3, 4, 4
Offset: 0

Views

Author

Pontus von Brömssen, Jan 15 2025

Keywords

Examples

			For n = 7, the first 7 terms of this sequence and the first 7 terms of A380188 in reverse order are:
  0, 1, 0, 2, 0, 1, 1
  3, 3, 3, 2, 2, 1, 0
           ^     ^
with 2 coincidences, so a(7) = 2.
		

Crossrefs

A367315 a(1) = 1, and for any n > 0, a(2*n) is the number of k's among 1..n such that a(k) <= a(n), a(2*n+1) is the number of k's among 1..n such that a(k) >= a(n).

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 3, 4, 1, 5, 2, 6, 1, 7, 2, 8, 1, 4, 9, 10, 1, 7, 7, 12, 1, 5, 13, 14, 1, 9, 10, 16, 1, 6, 17, 14, 6, 19, 1, 20, 1, 7, 21, 19, 5, 20, 6, 24, 1, 8, 25, 18, 10, 27, 1, 28, 1, 9, 29, 26, 6, 28, 5, 32, 1, 10, 33, 22, 14, 35, 1, 34, 4, 23, 17, 38
Offset: 1

Views

Author

Rémy Sigrist, Nov 14 2023

Keywords

Comments

This sequence is unbounded: for any m > 0, a(4*m) + a(4*m+1) >= 2*m + 1, as both terms are positive, at least one of them must be >= m.
This sequence contains infinitely many 1's: if a(n) > a(k) for all k < n, then a(2*n + 1) = 1, and as the sequence is unbounded, we have infinitely many such n.
This sequence contains all positive integers: for any n > 0, if k is the index of the n-th 1, then a(2*k) = n.

Examples

			a(1) = 1 by definition.
a(1) <= a(1) hence a(2) = 1.
a(1) >= a(1) hence a(3) = 1.
a(1) and a(2) <= a(2) hence a(4) = 2.
a(1), a(2), a(3) and a(4) <= a(4) hence a(8) = 4.
a(1), a(2) and a(3) < a(4), a(4) >= a(4) hence a(9) = 1.
		

Crossrefs

Cf. A272727.

Programs

  • PARI
    { for (n = 1, #a = vector(76), print1 (a[n] = if (n==1, 1, sum (k=1, n\2, if (n%2==0, a[k] <= a[n\2], a[k] >= a[n\2])))", ")) }

Formula

a(2*n) + a(2*n+1) >= n + 1.
Showing 1-10 of 10 results.