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.
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
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.
Links
- Jean-Marc Falcoz, Table of n, a(n) for n = 1..28446
- William Cheswick, Colored plot of first 200 terms of A307720 (See Comments in A348248 for explanation of colors in these pictures)
- William Cheswick, Colored plot of first 1000 terms of A307720
- William Cheswick, Colored plot of first 10000 terms of A307720
- William Cheswick, Colored plot of first 10^5 terms of A307720
- William Cheswick, Colored plot of first 10^6 terms of A307720
- Robert Dougherty-Bliss, Graph of first 10^6 terms with successive points joined. [This effectively fills the region between the trajectories of the left and right hands with black ink.]
- Rémy Sigrist, Scatterplot of the first 10000000 terms
- Rémy Sigrist, PARI program for A307720
- N. J. A. Sloane, Table of n, a(n) for n = 1..1000000 [Computed using Rémy Sigrist's PARI program]
- N. J. A. Sloane, Proof of theorem that every number appears
- N. J. A. Sloane, "A Handbook of Integer Sequences" Fifty Years Later, arXiv:2301.03149 [math.NT], 2023, p. 9.
- Chai Wah Wu, Scatterplot of the first 100 million terms of A348446 [shows how the lead changes between the left and right hands]
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
Comments