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.

Previous Showing 11-20 of 33 results. Next

A348450 Partial sums of A307730.

Original entry on oeis.org

1, 3, 5, 8, 11, 14, 20, 24, 28, 32, 36, 42, 48, 54, 60, 66, 75, 84, 93, 102, 111, 120, 129, 138, 147, 159, 167, 175, 183, 191, 199, 207, 215, 223, 235, 247, 259, 271, 283, 295, 307, 319, 331, 343, 355, 370, 375, 380, 385, 390, 395, 402, 409, 416, 423, 430, 437, 444, 458, 468, 478, 488, 498, 508, 518, 528, 538
Offset: 1

Views

Author

N. J. A. Sloane, Oct 25 2021

Keywords

Crossrefs

A307720 Lexicographically earliest sequence of positive integers in which, for all positive k, there are exactly k pairs of consecutive terms whose product is k.

Original entry on oeis.org

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

Views

Author

Eric Angelini and Jean-Marc Falcoz, Apr 24 2019

Keywords

Comments

All natural integers will appear sooner or later in the sequence (from the definition) - but mostly "later"! Indeed, the sequence increases very slowly: after 100000 terms the smallest term not yet present is 32.
Here is, in the same range, a sample of the count {term, occurrences} so far:
{1,192},{2,396},{3,618},{4,796},{5,1160},{6,1296},{7,2294},{8,2080},{9,2489},{10,2826},{11,3487},{12,1596},{13,2295},{14,1960},{15,2370},{16,2640},{17,4097},{18,2214},{19,4598},{20,2770},{21,3759},{22,4477},{23,5612},{24,4884},{25,5825},{26,6006},{27,6359},{28,4676},{29,5481},{30,3060},{31,1411},{32,0},{33,182},{34,0},{35,315},{36,0},{37,1221},{38,0},{39,214},{40,0},{41,1353},{42,0},{43,1183},{44,0},{45,0},{46,0},{47,1058},{48,0},{49,172},{50,0},{51,0},{52,0},{53,580},...
After 100000 terms, the first products that are not yet present are (the primes): 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, ... and (the composites) 118, 122, 134, ...
Here is again a sample so far (100000 terms computed) of {product, number of occurrences of the product}:
{1,1},{2,2},{3,3},{4,4},{5,5},{6,6},{7,7},{8,8},{9,9},{10,10},{11,11},{12,12},{13,13},{14,14},{15,15},{16,16},{17,17},{18,18},{19,19},{20,20},{21,21},{22,22},{23,23},{24,24},{25,25},{26,26},{27,27},{28,28},{29,29},{30,30},{31,31},{32,32},{33,33},{34,34},{35,35},{36,36},{37,37},{38,38},{39,39},{40,40},{41,41},{42,42},{43,43},{44,44},{45,45},{46,46},{47,47},{48,48},{49,49},{50,50},{51,51},{52,52},{53,53},{54,54},{55,55},{56,56},{57,57},{58,58},{59,0},{60,60},{61,0},{62,62},{63,63},{64,64},{65,65},{66,66},{67,0},{68,68},{69,69},{70,70},{71,0},{72,72},{73,0},{74,74},{75,75},{76,76},{77,77},{78,78},{79,0},{80,80},{81,81},{82,82},{83,0},{84,84},{85,85},{86,86},{87,87},{88,88},{89,0},{90,90},{91,91},{92,92},{93,93},{94,94},{95,95},{96,96},{97,0},{98,98},{99,99},{100,100},{101,0},{102,102},{103,0},{104,104},{105,105},{106,106},{107,0},{108,108},{109,0},{110,110},{111,111},{112,112},{113,0},{114,114},{115,115},{116,116},{117,117},{118,0},{119,119},{120,120},{121,121},{122,0},{123,123},{124,124},{125,125},{126,126},{127,0},{128,128},{129,129},{130,130},{131,0},{132,132},{133,133},{134,0},{135,135},{136,136},{137,0},{138,138},{139,0},{140,140},{141,141},{142,0},...
Comment from N. J. A. Sloane, Oct 19 2021: (Start)
Theorem. This sequence can also be defined by a greedy algorithm. That is, let b(1)=1, and for n >= 1, let b(n+1) be the smallest positive integer k such that m = k*b(n) has appeared at most n-1 times in the list [b(i)*b(i+1): i=1..n-1]. Then b(n) = a(n) for all n >= 1.
(Note that for n=1 the list is empty, and so we take k = b(1) = 1.)
Remark: The theorem is not obvious and requires a proof, given in a link below. "Lexicographically earliest" sequences often require some backtracking, but the point of the theorem is that no backtracking is needed here.
The proof also shows that there are infinitely many 1's in the sequence, and that each k appears k times in the sequence of products a(i)*a(i+1). (End)

Examples

			The sequence starts with 1,1,2,1,3,1,3,2,2,2,2,2,3,...
The product a(n)*a(n+1) = 1 is true exactly once [this is the product a(1) * a(2) = 1 * 1 = 1];
The product a(n)*a(n+1) = 2 is true exactly twice [these are the products a(2) * a(3) = 1 * 2 = 2 and a(3) * a(4) = 2 * 1 = 2];
The product a(n)*a(n+1) = 3 is true exactly three times [these are the products a(4) * a(5) = 1 * 3 = 3 ; a(5) * a(6) = 3 * 1 = 3, and a(6) * a(7) = 1 * 3 = 3];
...
The product a(n)*a(n+1) = 4 is true exactly four times [these are the products a(8) * a(9) = 2 * 2 = 4 ; a(9) * a(10) = 2 * 2 = 4 ; a(10) * a(11) = 2 * 2 = 4 ; a(11) * a(12) = 2 * 2 = 4] ; and so on.
		

Crossrefs

Cf. A307707 (same idea, but with the sum of contiguous terms instead of the product), A307730 (the products), A307630 (when n appears), A307631 (indices of records), A307632 (indices of primes), A348241 and A348242 (bisections), A307633 and A307634 (RUNS transforms of bisections), A348446 (bisection differences), A348458 (partial sums).
See also A307747.

Programs

  • Mathematica
    nmax = 1000; time = {0}; v = 1;
    A307720 = Reap[For[n = 1, n <= nmax, n++, Sow[v]; For[o = 1, True, o++, While[Length[time] < o*v, time = Join[time, Table[0, {Length[time]}]]]; If[time[[o*v]]+1 <= o*v, time[[o*v]]++; v = o; Break[]]]]][[2, 1]] (* Jean-François Alcover, Oct 23 2021, after Rémy Sigrist's PARI program *)
  • PARI
    \\ See Links section.
    
  • Python
    from itertools import islice
    from collections import Counter
    def A307720(): # generator of terms. Greedy algorithm
        yield 1
        c, b = Counter(), 1
        while True:
            k, kb = 1, b
            while c[kb] >= kb:
                k += 1
                kb += b
            c[kb] += 1
            b = k
            yield k
    A307720_list = list(islice(A307720(),100)) # Chai Wah Wu, Oct 21 2021

Extensions

Definition revised slightly by Allan C. Wechsler, Apr 24 2019
Example clarified by Rémy Sigrist, Oct 24 2021

A088177 a(1)=1, a(2)=1; for n>2, a(n) is the smallest positive integer such that the products a(i)*a(i+1), i=1..n-1, are all distinct.

Original entry on oeis.org

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

Views

Author

John W. Layman, Sep 22 2003

Keywords

Comments

A088178 is the sequence of distinct products a(i)a(i+1), i=1,2,3,... and appears to be a permutation of the natural numbers.
It appears that for k>2 the k-th occurrence of 1 lies between the first occurrences of primes p(2*k-4) and p(2*k-3). For instance, the 5th occurrence of 1 lies between the first occurrences of 13 and 17, the 6th and 7th primes, respectively. - John W. Layman, Nov 16 2011
Note that a(n) = 1 for infinitely many n, because the sequence a(n) is not bounded and beside every new prime number must be the number 1. - Thomas Ordowski, Sep 04 2014. [This seems a rather sketchy argument, but I have a more complete proof using arguments similar to those we used in A098550. - N. J. A. Sloane, Oct 18 2021]
Example: ..., 5, 13, 1, 17, 2, 13, 3, 17, 4; ...
General: ..., k, p, 1, q, 2, p, 3, q, ..., k-1; ...
- Thomas Ordowski, Sep 08 2014

Examples

			Given that the sequence begins 1,1,2,2,... then a(5)=3, since either of the choices a(5)=1 or a(5)=2 would lead to a repetition of one of the previous products 1,2,4 of adjacent pairs of terms.
		

Crossrefs

Programs

  • Maple
    A[1]:= 1: A[2]:= 1: S:= {1}:
    for n from 3 to 100 do
      Sp:= select(type,map(s -> s/A[n-1],S),integer);
      if nops(Sp) = Sp[-1] then A[n]:= Sp[-1]+1
      else A[n]:= min({$1..Sp[-1]} minus Sp)
      fi;
      S:= S union {A[n-1]*A[n]};
    od:
    seq(A[n],n=1..100); # Robert Israel, Aug 28 2014
  • Mathematica
    t = {1, 1}; Do[AppendTo[t, 1]; While[Length[Union[Most[t]*Rest[t]]] < n - 1, t[[-1]]++], {n, 3, 100}]; t (* T. D. Noe, Nov 16 2011 *)
  • Python
    from itertools import islice
    def A088177(): # generator of terms
        yield 1
        yield 1
        p, a = {1}, 1
        while True:
            n = 1
            while n*a in p:
                n += 1
            p.add(n*a)
            a = n
            yield n
    A088177_list = list(islice(A088177(),20)) # Chai Wah Wu, Oct 21 2021

Formula

a(n)*gcd(a(n-1),a(n+1)) = gcd(A088178(n-1),A088178(n)). - Thomas Ordowski, Jun 29 2015

A348249 a(n) = A348409(n) - A348246(n) + 1.

Original entry on oeis.org

1, 2, 3, 4, 5, 10, 7, 8, 9, 10, 11, 20, 13, 24, 52, 16, 17, 18, 19, 20, 53, 22, 23, 40, 25, 48, 27, 28, 29, 30, 31, 32, 33, 34, 35, 116, 37, 72, 172, 40, 41, 42, 43, 44, 371, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 144, 2662, 104, 59, 60, 61, 62, 161, 64, 155, 66, 67, 68, 69, 70, 71, 136, 73, 136
Offset: 1

Views

Author

Rémy Sigrist and N. J. A. Sloane, Oct 20 2021

Keywords

Comments

This is the length of time from when A307720 produces the first n to when it produces the final (n-th) n. Cf. A307730. By definition, a(n) >= n.

Crossrefs

A348248 Let d = A307720(n) - A307720(n-1); a(n) = 0 if d = 0; a(n) = 1 if d > 0; a(n) = 2 if d < 0.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Oct 20 2021

Keywords

Comments

If one looks at the graph of A307720 (that entry has a number of versions of this graph besides the one that appears when the "graph" button is clicked), one sees that initially A307720(n) is usually greater than A307720(n-1) if n is odd.
Think of A307720 as a piano score in which normally the right hand (n = 2*i+1) is to the right of the left hand (n = 2*i).
However, as can be seen in William Cheswick's colored plots, sometimes the right and left hands swap. In these plots, the right-hand points (n odd) are blue and the left-points (n even) are red.
A run of terms 121212... in the present sequence is a normal sequence of notes left, right, left, right, ..., where blue is on top.
A run 212121... indicates that the hands have been swapped (red is on top).
A run 000000... indicates that both hands are playing the same note (red and blue are at the same level).
The purpose of the present sequence and related sequences is to study when the hands swap. At present there is no explanation for when this happens.
The sequence of pictures suggests that there will be infinitely many occasions when the hands swap. The upper color in the picture will alternate infinitely often between red and blue, with longer and longer runs before the upper color changes.

Crossrefs

A348252 Records in A348246.

Original entry on oeis.org

1, 2, 4, 8, 47, 52, 60, 1374, 1385, 3738, 3755, 6680, 6703, 84626, 84657, 89480, 89521, 91832, 91879, 173092, 173151, 192882, 192949, 524587, 524660, 865301, 865384, 876543, 876640, 890479, 890582, 904273, 904382, 918859, 918986, 1628979, 1629116, 1647107, 1647256, 1666775, 1666932, 1687763, 1687930
Offset: 1

Views

Author

N. J. A. Sloane, Oct 21 2021

Keywords

Crossrefs

Programs

  • C
    // See Links section.

A348256 Indices of records in A348249.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 11, 12, 14, 15, 21, 36, 39, 45, 57, 87, 203, 319, 429, 435, 517, 530, 710, 790, 1310, 1730, 2290, 3370, 3830, 4210, 7430, 7570, 9530, 9710, 13010, 44810, 70270
Offset: 1

Views

Author

N. J. A. Sloane, Oct 21 2021

Keywords

Crossrefs

Programs

  • C
    See Links section.

Extensions

a(35)-a(37) from Rémy Sigrist, Oct 22 2021

A307630 Index at which n first appears in A307720.

Original entry on oeis.org

1, 3, 5, 27, 47, 99, 53, 137, 177, 1024, 1374, 2474, 1386, 3326, 3662, 5274, 3738, 6290, 3756, 8954, 9374, 12878, 6680, 9682, 9850, 10324, 11010, 14578, 6704, 78506, 84626, 106968, 88474, 127682, 86802, 143544, 84658, 160664, 97850, 274079, 89480, 326195
Offset: 1

Views

Author

N. J. A. Sloane, Apr 25 2019

Keywords

Crossrefs

Extensions

More terms from Hans Havermann, Apr 25 2019

A348446 a(n) = A307720(2*n-1) - A307220(2*n).

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Oct 22 2021

Keywords

Comments

My guess is that this changes signs infinitely often, but is more likely to be positive than negative. Perhaps the behavior is akin to that of A066520, which shows the "great prime race" between primes congruent to 3 mod 4 and primes congruent to 1 mod 4.
See also the graphs in A307720 and A348248.

Crossrefs

Programs

  • Python
    from itertools import islice
    from collections import Counter
    def A348446(): # generator of terms. Greedy algorithm
        a = 1
        c, b = Counter(), 1
        while True:
            k, kb = 1, b
            while c[kb] >= kb:
                k += 1
                kb += b
            c[kb] += 1
            b = k
            a2 = k
            yield a-a2
            k, kb = 1, b
            while c[kb] >= kb:
                k += 1
                kb += b
            c[kb] += 1
            b = k
            a = k
    A348446_list = list(islice(A348446(),100)) # Chai Wah Wu, Oct 23 2021

A348773 First differences of A307632.

Original entry on oeis.org

2, 42, 6, 1321, 12, 2352, 18, 2924, 24, 77922, 32, 4822, 42, 2310, 48, 81212, 60, 19730, 68, 331637, 74, 340640, 84, 11158, 98, 13838, 104, 13690, 110, 14476, 128, 709992, 138, 17990, 150, 19518, 158, 20830, 168, 2277394, 180, 62350, 192, 82484, 198, 76962, 212, 84852, 228, 15407670, 234, 87388, 242, 90636
Offset: 1

Views

Author

N. J. A. Sloane, Nov 06 2021

Keywords

Crossrefs

Bisections: A348774, A348775.
Previous Showing 11-20 of 33 results. Next