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

A386482 a(1)=1, a(2)=2; thereafter a(n) is either the greatest number k < a(n-1) not already used such that gcd(k, a(n-1)) > 1, or if no such k exists then a(n) is the smallest number k > a(n-1) not already used such that gcd(k, a(n-1)) > 1.

Original entry on oeis.org

1, 2, 4, 6, 3, 9, 12, 10, 8, 14, 7, 21, 18, 16, 20, 15, 5, 25, 30, 28, 26, 24, 22, 11, 33, 27, 36, 34, 32, 38, 19, 57, 54, 52, 50, 48, 46, 44, 42, 40, 35, 45, 39, 13, 65, 60, 58, 56, 49, 63, 51, 17, 68, 66, 64, 62, 31, 93, 90, 88, 86, 84, 82, 80, 78, 76, 74, 72, 70, 55, 75, 69, 23, 92, 94, 47, 141, 138, 136, 134, 132, 130, 128
Offset: 1

Views

Author

N. J. A. Sloane, Aug 15 2025, based on email messages from Geoffrey Caveney

Keywords

Comments

Similar to the EKG sequence A064413, but whereas in that sequence a(n) is chosen to be as small as possible, here the primary goal is to choose a(n) to be less than a(n-1) and as close to it as possible. This sequence first differs from the EKG sequence at n = 8, where a(8) = k = 10 is closer to a(7) = 12 than A064413(8) = 8 is.
A significant difference from the EKG sequence is that the primes do not appear in their natural order. Also, it is not always true that a prime p is preceded by 2*p when it first appears. 4k+3 primes appear to be preceded by smaller multiples than 4k+1 primes.
It is conjectured that every positive number appears.
It is interesting to study what happens if the first two terms are taken to be 1,s, with s >= 2, or if the first s terms are taken to be 1,2,3,...,s, with s >= 2. Call two such sequences equivalent if they eventually merge. The 1,3 and 1,2,3 sequences merge with each other after half-a-dozen terms. But at present we do not know if they merge with the 1,2 sequence.
It appears that many sequences that start 1,s and 1,2,3,...,s with small s merge with one of the sequences 1,2 or 1,2,3 or 1,2,3,...,11.
[The preceding comments are from Geoffrey Caveney's emails.]
From Michael De Vlieger, Aug 15 2025: (Start)
There are long runs of terms with the same parity in this sequence. For example, beginning at a(481) = 948, there are 100 consecutive even terms. Starting with a(730076) = 1026330, there are 100869 consecutive even terms, followed by 36709 consecutive odd terms. Runs of even terms tend to be longer than those of odd.
There are long runs of first differences of -2 and -6 in this sequence, and that there appear to be three phases. The predominant (A) phase has a(n) = a(n-1)-2, the second (B) phase has a(n) = a(n-1)-6, and then there is a turbulent (C) phase [C] with varied differences.
Generally the even runs correspond to differences a(n)-a(n-1) = 2 and feature square-free terms separated by an odd number of terms in A126706. Phase [C] tends to be largely odd squarefree semiprimes and includes prime powers. (End)

References

  • Geoffrey Caveney, Emails to N. J. A. Sloane, Aug 13 2025 - Aug 15 2025.

Crossrefs

Cf. A064413 (EKG), A387072 (inverse), A387073 (record high points), A387074 (indices of record high points), A387075 (first differences), A387076 (primes in order of appearance), A387077 (indices of primes), A387078 (run lengths of consecutive odd and even terms), A387080 (variant that begins with 1,3).

Programs

  • Mathematica
    aList[n_] := Module[{an = 2, aset = <|2 -> True|>, m}, Reap[Sow[1]; Sow[an];
    Do[m = SelectFirst[Range[an - 1, 2, -1], ! KeyExistsQ[aset, #] && GCD[#, an] > 1 & ];
    If[MissingQ[m], m = NestWhile[# + 1 &, an + 1, !(! KeyExistsQ[aset, #] && GCD[#, an] > 1) & ]];
    aset[m] = True; an = m; Sow[an], {n - 2}]][[2, 1]]]; aList[83]  (* Peter Luschny, Aug 15 2025 *)
  • PARI
    \\ See Links section.
    
  • Python
    from math import gcd
    from itertools import count, islice
    def A386482_gen(): # generator of terms
        yield 1
        an, aset = 2, {2}
        while True:
            yield an
            m = next((k for k in range(an-1, 1, -1) if k not in aset and gcd(k, an) > 1), False)
            if not m: m = next(k for k in count(an+1) if k not in aset and gcd(k, an) > 1)
            an = m
            aset.add(an)
    print(list(islice(A386482_gen(), 83))) # Michael S. Branicky, Aug 15 2025

A386484 a(n) is the index where A387090(n) appears in A386482.

Original entry on oeis.org

1, 2, 5, 17, 24, 44, 52, 73, 126, 809, 821, 1016, 2020, 2026, 2637, 3017, 3541, 3544, 4876, 12680, 12803, 12808, 12898, 12901, 12907, 13279, 17729, 17734, 27224, 33351, 35295, 35310, 44605, 44609, 44925, 44930, 44935, 44939, 45176, 45279, 45703, 45723, 46125, 46138, 46154, 46157, 62957, 63713, 63720, 63869, 63872, 63877, 115110, 115116
Offset: 1

Views

Author

N. J. A. Sloane, Aug 16 2025

Keywords

Comments

A387090 lists the numbers that are the slowest to appear in A386482, and the present sequence tells when they do appear. This is of interest because we do not know if every number appears in A386482.

Crossrefs

A387522 Index of first term in A386482 that is divisible by the n-th prime.

Original entry on oeis.org

2, 4, 8, 10, 23, 21, 28, 30, 37, 47, 56, 67, 63, 61, 75, 94, 88, 86, 80, 119, 117, 135, 131, 174, 166, 162, 160, 156, 154, 150, 200, 235, 229, 227, 217, 215, 209, 270, 266, 260, 254, 252, 242, 240, 297, 295, 314, 354, 350, 348, 344, 338, 336, 326, 428, 422, 416, 414, 408, 404, 402, 392, 378, 374, 372, 478, 464, 458, 608, 606, 602
Offset: 1

Views

Author

N. J. A. Sloane, Sep 01 2025.

Keywords

Crossrefs

Programs

  • Mathematica
    Block[{p, s}, p[A386482/b386482.txt%22,%20%22Data%22%5D%5B%5BAll,%20-1%5D%5D;%20Do%5BMap%5BIf%5Bp%5B%23%5D%20==%200,%20Set%5Bp%5B%23%5D,%20n%5D%5D%20&,%20FactorInteger%5Bs%5B%5Bn%5D%5D%5D%5B%5B;;%20,%201%5D%5D%5D,%20%7Bn,%20Length%5Bs%5D%7D%5D;%20TakeWhile%5BArray%5Bp%5BPrime%5B%23%5D%5D%20&,%20120%5D,%20%23%20%3E%200%20&%5D%20%5D%20(*%20_Michael%20De%20Vlieger">] := 0; s = Import["https://oeis.org/A386482/b386482.txt", "Data"][[All, -1]]; Do[Map[If[p[#] == 0, Set[p[#], n]] &, FactorInteger[s[[n]]][[;; , 1]]], {n, Length[s]}]; TakeWhile[Array[p[Prime[#]] &, 120], # > 0 &] ] (* _Michael De Vlieger, Sep 03 2025 *)

A387523 Primes in the order in which they first divide a term of A386482.

Original entry on oeis.org

2, 3, 5, 7, 13, 11, 17, 19, 23, 29, 31, 43, 41, 37, 47, 67, 61, 59, 53, 73, 71, 83, 79, 113, 109, 107, 103, 101, 97, 89, 127, 157, 151, 149, 139, 137, 131, 193, 191, 181, 179, 173, 167, 163, 199, 197, 211, 251, 241, 239, 233, 229, 227, 223, 313, 311, 307, 293, 283, 281, 277, 271, 269, 263, 257, 337, 331, 317, 467, 463, 461, 457
Offset: 1

Views

Author

N. J. A. Sloane, Sep 03 2025

Keywords

Comments

Conjecture: if c is the first term in A386482 that is divisible by a prime p > 2, then c = 2*p.

Examples

			11 first divides A386482(23), but 13 first divides A386482(21), so 13 precedes 11 in this sequence.
		

Crossrefs

Programs

  • Mathematica
    Block[{p, s}, p[A386482/b386482.txt%22,%20%22Data%22%5D%5B%5BAll,%20-1%5D%5D;%20Rest@%20Reap%5BDo%5BMap%5BIf%5Bp%5B%23%5D%20==%200,%20Set%5Bp%5B%23%5D,%20n%5D;%20Sow%5B%23%5D%5D%20&,%20FactorInteger%5Bs%5B%5Bn%5D%5D%20%5D%5B%5B;;%20,%201%5D%5D%5D,%20%7Bn,%20Length%5Bs%5D%7D%5D%20%5D%5B%5B-1,%201%5D%5D%20%5D%20(*%20_Michael%20De%20Vlieger">] := 0; s = Import["https://oeis.org/A386482/b386482.txt", "Data"][[All, -1]]; Rest@ Reap[Do[Map[If[p[#] == 0, Set[p[#], n]; Sow[#]] &, FactorInteger[s[[n]] ][[;; , 1]]], {n, Length[s]}] ][[-1, 1]] ] (* _Michael De Vlieger, Sep 03 2025 *)

A387524 Primes p with property that in A386482 they are immediately preceded by 2*p and immediately followed by 3*p.

Original entry on oeis.org

3, 7, 11, 19, 31, 47, 131, 317, 947, 4327, 48091, 77237, 158489, 237733, 1973087, 3398221, 4409519
Offset: 1

Views

Author

N. J. A. Sloane, Sep 03 2025

Keywords

Comments

This is in marked contrast to the EKG sequence A064413, where all primes > 2 have this property.

Crossrefs

Extensions

More terms from Michael De Vlieger, Sep 03 2025

A387634 Indices k such that s(k) is a prime p, s(k-1) = 2*p, and s(k+1) = 3*p, where s = A386482.

Original entry on oeis.org

5, 11, 24, 31, 57, 76, 236, 479, 1532, 7652, 82123, 129791, 274542, 419569, 3367328, 7002435, 7690249
Offset: 1

Views

Author

Michael De Vlieger, Sep 04 2025

Keywords

Examples

			Table of n, a(n), with a(n) = k, listing s(k) and its immediate neighbors:
 n  a(n) = k     s(k-1)      s(k)     s(k+1)
--------------------------------------------
 1         5         6         3          9
 2        11        14         7         21
 3        24        22        11         33
 4        31        38        19         57
 5        57        62        31         93
 6        76        94        47        141
 7       236       262       131        393
 8       479       634       317        951
 9      1532      1894       947       2841
10      7652      8654      4327      12981
11     82123     96182     48091     144273
12    129791    154474     77237     231711
13    274542    316978    158489     475467
14    419569    475466    237733     713199
15   3367328   3946174   1973087    5919261
16   7002435   6796442   3398221   10194663
17   7690249   8819038   4409519   13228557
		

Crossrefs

Programs

  • Mathematica
    s = Import["https://oeis.org/A386482/b386482.txt", "Data"][[All, -1]]; m = Length[s]; t = TakeWhile[Import["https://oeis.org/A387077/b387077.txt", "Data"][[All, -1]], # <= m &]; Select[t, #1 == 2 #2 && #3 == 3 #2 & @@ s[[# - 1 ;; # + 1]] &] ]
Showing 1-6 of 6 results.