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.

User: \n" if ((62*$

\n" if ((62*$'s wiki page.

\n" if ((62*$ has authored 1068 sequences. Here are the ten most recent ones:

A386485 a(0) = 1; thereafter a(n) = 5*n^2 - 5*n + 2.

Original entry on oeis.org

1, 2, 12, 32, 62, 102, 152, 212, 282, 362, 452, 552, 662, 782, 912, 1052, 1202, 1362, 1532, 1712, 1902, 2102, 2312, 2532, 2762, 3002, 3252, 3512, 3782, 4062, 4352, 4652, 4962, 5282, 5612, 5952, 6302, 6662, 7032, 7412, 7802, 8202, 8612, 9032, 9462, 9902, 10352, 10812, 11282, 11762, 12252, 12752, 13262, 13782, 14312
Offset: 0

Author

N. J. A. Sloane, Aug 18 2025

Keywords

Comments

Maximum number of regions that can be formed in the plane by drawing n regular pentagons (of any size). Differs from A062786 and A124080 by a small constant shift, but is included here because of its geometrical applications.

Crossrefs

Programs

  • Mathematica
    A386485[n_] := If[n == 0, 1, 5*n*(n - 1) + 2]; Array[A386485, 60, 0] (* or *)
    LinearRecurrence[{3, -3, 1}, {1, 2, 12, 32}, 60] (* Paolo Xausa, Aug 18 2025 *)

Formula

G.f.: -(x^3+9*x^2-x+1)/(x-1)^3.

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

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

A383445 Index of n in A377090, or -1 if n does not appear there.

Original entry on oeis.org

0, 3, 1, 5, 9, 15, 10, 16, 14, 17, 23, 21, 24, 22, 28, 31, 29, 36, 30, 35, 37, 43, 41, 47, 42, 48, 54, 49, 55, 61, 56, 62, 67, 63, 68, 66, 71, 75, 80, 76, 81, 79, 82, 89, 91, 88, 90, 92, 99, 93, 98, 100, 105, 111, 106, 112, 110, 113, 124, 122, 125, 123, 126, 128, 121, 127, 133, 138, 134, 139, 137, 147, 150, 148, 146, 149, 153
Offset: 0

Author

N. J. A. Sloane, Apr 30 2025

Keywords

Comments

It is conjectured (see A377090) that every positive integer appears exactly once either here or in A383446.

Crossrefs

A382715 The term in A377091 that immediately precedes n, or 0 if n does not appear in A377091.

Original entry on oeis.org

0, 1, -1, 3, 4, -3, 6, 7, 13, 9, 10, 11, -12, 18, 14, 15, 16, -18, 20, 21, 25, 23, 19, 28, -24, 22, 26, 27, 30, 31, 32, -32, 29, 33, 34, 35, 36, 37, 38, 39, 40, -39, 42, 43, 44, 45, 46, 47, 48, 49, -49, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, -59, 62, 63, 64, 65
Offset: 1

Author

N. J. A. Sloane, Apr 09 2025

Keywords

Comments

It is a strong conjecture that every integer appears in A377091, so it is unlikely there will be a second 0 term.

Examples

			A377091(9) = -3 is followed by A377091(10) = 6, so a(6) = -3.
		

A382155 a(n) = (n+1)! if n <= 2; thereafter a(n) = 4*n if n even or 2*n if n odd.

Original entry on oeis.org

1, 2, 6, 6, 16, 10, 24, 14, 32, 18, 40, 22, 48, 26, 56, 30, 64, 34, 72, 38, 80, 42, 88, 46, 96, 50, 104, 54, 112, 58, 120, 62, 128, 66, 136, 70, 144, 74, 152, 78, 160, 82, 168, 86, 176, 90, 184, 94, 192, 98, 200, 102, 208, 106, 216, 110, 224, 114, 232, 118, 240, 122, 248, 126, 256, 130, 264, 134, 272, 138, 280, 142, 288, 146, 296
Offset: 0

Author

N. J. A. Sloane, Mar 23 2025

Keywords

Comments

Let G denote the 2-dimensional grid obtained from the square grid Z X Z by deleting the vertices with both coordinates odd and the four edges at each of those vertices (see link). G has vertices with valency either 2 (one coordinate even and one odd, indicated by X) or 4 (both coordinates even, indicated by O). The present sequence is the coordination sequence of G with respect to a vertex of valency 2.
See A382154 for further information.

Crossrefs

Partial sums give A382156.

Programs

  • Mathematica
    Join[{1, 2, 6}, Riffle[4*# + 2, 8*(# + 1)]] & [Range[50]] (* Paolo Xausa, Mar 24 2025 *)
  • Python
    def A382155(n): return (1,2,6)[n] if n<3 else n<<(2>>(n&1)) # Chai Wah Wu, Mar 24 2025

Formula

G.f.: (-2*x^6+5*x^4+2*x^3+4*x^2+2*x+1)/(1-x^2)^2.

A382154 a(0) = 1; thereafter a(n) = 2*n if n even or 4*n if n odd.

Original entry on oeis.org

1, 4, 4, 12, 8, 20, 12, 28, 16, 36, 20, 44, 24, 52, 28, 60, 32, 68, 36, 76, 40, 84, 44, 92, 48, 100, 52, 108, 56, 116, 60, 124, 64, 132, 68, 140, 72, 148, 76, 156, 80, 164, 84, 172, 88, 180, 92, 188, 96, 196, 100, 204, 104, 212, 108, 220, 112, 228, 116, 236, 120, 244, 124, 252, 128, 260, 132, 268, 136, 276, 140, 284, 144, 292
Offset: 0

Author

N. J. A. Sloane, Mar 23 2025

Keywords

Comments

Let G denote the 2-dimensional grid obtained from the square grid Z X Z by deleting the vertices with both coordinates odd and the four edges at each of those vertices (see link). G has vertices with valency either 2 (one coordinate even and one odd, indicated by X) or 4 (both coordinates even, indicated by O). The present sequence is the coordination sequence of G with respect to a vertex of valency 4.
G arises in connection with the six-vertex lattice model of statistical mechanics (see Gorin-Nicoletti).

References

  • Gorin, Vadim, and Matthew Nicoletti. "Six-Vertex Model and Random Matrix Distributions," Bull. Amer. Math. Soc., 62:2 (2025), 175-234 (See Fig. 1.2).

Crossrefs

Partial sums give A319384.

Programs

  • Mathematica
    Join[{1}, Riffle[8*# - 4, 4*#]] & [Range[50]] (* Paolo Xausa, Mar 24 2025 *)
  • Python
    def A382154(n): return n<<(1<<(n&1)) if n else 1 # Chai Wah Wu, Mar 24 2025

Formula

G.f.: (1+x^2)*(1+4*x+x^2)/(1-x^2)^2.

A381115 Composite terms in A381019 in order of appearance.

Original entry on oeis.org

4, 9, 8, 6, 25, 12, 10, 49, 15, 16, 14, 27, 20, 21, 22, 18, 35, 24, 169, 28, 33, 26, 85, 32, 57, 77, 30, 34, 39, 55, 38, 51, 40, 91, 36, 121, 42, 65, 44, 45, 529, 48, 119, 46, 95, 81, 143, 50, 63, 52, 54, 115, 56, 841, 187, 69, 62, 125, 87, 64, 133, 75, 58, 221
Offset: 1

Author

N. J. A. Sloane, Feb 14 2025

Keywords

Crossrefs

Programs

  • Mathematica
    nn = 500; c[_] = False; u = v = 2; a[1] = 1;
    Monitor[Reap[
      Do[k = u;
        While[Or[c[k],
          ! CoprimeQ[k, Product[a[h], {h, n - Min[k, n - 1], n - 1}] ] ],
          If[k > n - 1, k = v, k++]];
        Set[{a[n], c[k]}, {k, True}];
        If[CompositeQ[k], Sow[k]];
        If[k == u, While[c[u], u++]];
    If[k == v, While[Or[c[v], CompositeQ[v]], v++]], {n, 2, nn}] ][[-1, 1]], n] (* Michael De Vlieger, Feb 14 2025 *)
  • Python
    from math import gcd
    from sympy import isprime
    from itertools import count, islice
    def agen(): # generator of terms
        alst, aset, an, m = [1], {1}, 1, 2
        for n in count(2):
            if an > 3 and not isprime(an):
                yield an
            an = next(k for k in count(m) if k not in aset and all(gcd(alst[-j], k) == 1 for j in range(1, min(k, n-1)+1)))
            alst.append(an)
            aset.add(an)
            while m in aset: m += 1
    print(list(islice(agen(), 64))) # Michael S. Branicky, Feb 14 2025

A379059 Index of n in A377091, or -1 if n does not appear there.

Original entry on oeis.org

0, 1, 2, 5, 6, 7, 10, 11, 12, 22, 23, 24, 25, 21, 33, 34, 35, 36, 32, 46, 45, 44, 48, 47, 52, 43, 49, 50, 51, 64, 63, 62, 61, 65, 66, 67, 68, 69, 70, 71, 72, 73, 82, 83, 84, 85, 86, 87, 88, 89, 90, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 188
Offset: 0

Author

N. J. A. Sloane, Dec 26 2024

Keywords

Comments

It is conjectured that every integer appears in A377091.
Conjecture 1: For n >= 10, |a(n) - 2*n| < 2*sqrt(n); for n >= 1000, |a(n) - 2*n| < 1.59*sqrt(n) (compare A379786). - N. J. A. Sloane, Jan 19 2025
Conjecture 2: lim sup |a(n) - 2*n|/sqrt(n) = sqrt(2) as n -> oo. - N. J. A. Sloane and Paolo Xausa, Feb 02 2025

Crossrefs

A379057 a(0) = 0; thereafter a(n) is the least integer (in absolute value) not yet in the sequence such that the absolute difference between a(n-1) and a(n) is a square > 1; in case of a tie, preference is given to the positive value.

Original entry on oeis.org

0, 4, -5, -1, 3, -6, -2, 2, 6, -3, 1, 5, -4, -8, 8, 12, -13, -9, 7, 11, -14, -10, 15, 19, 10, 14, -11, -7, 9, 13, -12, -16, 20, 16, -20, -24, -15, -19, 17, 21, 25, 29, 33, 24, -25, -21, -17, -26, -22, -18, 18, 22, 26, -23, -27, -31, -35, -39, -30, 34, 30, -34
Offset: 0

Author

N. J. A. Sloane, Dec 25 2024

Keywords

Comments

Inspired by A377091 and A277616.

Crossrefs

Cf. A277616, A377091, A379058 (first differences), A380313 (partial sums).

Programs

  • Mathematica
    A379057list[nmax_] := Module[{s, a, u = 1}, s[_] := False; s[0] = True; NestList[(While[s[u] && s[-u], u++]; a = u; While[s[a] || Abs[# - a] <= 1 || !IntegerQ[Sqrt[Abs[# - a]]], a = Boole[a < 0] - a]; s[a] = True; a) &, 0, nmax]];
    A379057list[100] (* Paolo Xausa, Mar 21 2025 *)
  • Python
    from math import isqrt
    from itertools import count, islice
    def cond(n): return n > 1 and isqrt(n)**2 == n
    def agen(): # generator of terms
        an, aset, m = 0, {0}, 1
        for n in count(0):
            yield an
            an = next(s for k in count(m) for s in [k, -k] if s not in aset and cond(abs(an-s)))
            aset.add(an)
            while m in aset and -m in aset: m += 1
    print(list(islice(agen(), 62))) # Michael S. Branicky, Dec 25 2024

Extensions

More terms from Michael S. Branicky, Dec 25 2024

A379053 Lexicographically earliest infinite sequence of distinct positive numbers with the property that n is a member of the sequence iff a(n) is not a prime.

Original entry on oeis.org

1, 3, 4, 6, 7, 8, 9, 10, 12, 14, 13, 15, 16, 18, 20, 21, 19, 22, 24, 25, 26, 27, 28, 30, 32, 33, 34, 35, 23, 36, 37, 38, 39, 40, 42, 44, 45, 46, 48, 49, 43, 50, 51, 52, 54, 55, 53, 56, 57, 58, 60, 62, 63, 64, 65, 66, 68, 69, 61, 70, 72, 74, 75, 76, 77, 78, 71
Offset: 1

Author

N. J. A. Sloane, Dec 17 2024

Keywords

Comments

The sequence tells you exactly which terms of the sequence are either 1 or composite.
See the Comments in A379051 for further information.

Programs

  • Mathematica
    nn = 120; u = 3; v = {}; w = {}; c = 4;
    {1}~Join~Reap[Do[
      If[MemberQ[w, n],
        k = c; w = DeleteCases[w, n],
        m = Min[{c, u, v}]; If[And[CompositeQ[m], n < m],
          AppendTo[v, n]];
          If[Length[v] > 0,
            If[v[[1]] == m,
            v = Rest[v]]]; k = m];
        AppendTo[w, k]; If[k == c, c++; While[PrimeQ[c], c++]]; Sow[k];
    If[n + 1 >= u, u++; While[CompositeQ[u], u++]], {n, 2, nn}] ][[-1, 1]] (* Michael De Vlieger, Dec 17 2024 *)

Formula

When sorted, this appears to be the complement of [2, 5, 11, 17, 29, and prime(2*t+1), t >= 35]. - Scott R. Shannon, Dec 18 2024

Extensions

More terms from Michael De Vlieger, Dec 17 2024