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 ((20*$

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

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

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

A384515 Unitary s-Zumkeller numbers.

Original entry on oeis.org

60, 140, 420, 660, 1224, 1820, 2660, 2820, 4620, 5460, 7140, 7980, 8580, 9660, 11220, 12180, 12540, 13020, 13260, 13580, 13860, 14140, 14420, 14820, 15180, 15540, 16380, 17220, 17940, 18060, 18200, 19140, 19380, 19740, 20020, 20460, 22260, 22620, 23460, 24180, 24420
Offset: 1

Author

Ivan N. Ianakiev, Jun 01 2025

Keywords

Comments

A positive integer k is called a unitary s-Zumkeller number if the set D of proper positive unitary divisors of k can be partitioned as {A,B}, such that the sum of the squares of the elements of A equals the sum of the squares of the elements of B equals (sigma2U(k) - k^2)/2, where sigma2U(k) is the sum of the squares of the unitary divisors of k.
All terms are even numbers.

Examples

			The set of proper unitary divisors of 60 is A = {1,3,4,5,12,15,20}. The set of their squares is B= {1,9,16,25,144,225,400} and the sum of its elements is 820. B = {1,9,400} union {16,25,144,225}, which makes 60 a term of the present sequence.
		

Crossrefs

Programs

  • Mathematica
    (* Naive code to illustrate the terms found by Kalita and Saikia *)
    uDiv[n_]:=Block[{d=Divisors[n]},Select[d,GCD[#,n/#]==1&]];
    sigma2UDiv[n_]:=Total[uDiv[n]^2]; propUDiv[n_]:=uDiv[n]//Most;
    subsetsPropUDivQ[1]:=False; subsetsPropUDivQ[n_]:=
    Select[Subsets[propUDiv[n]],Total[Flatten[#]^2]==(sigma2UDiv[n]-n^2)/2&]!={};
    Select[Range[1820],subsetsPropUDivQ[#]&]
    (* or *)
    q[n_] := Module[{d = Select[Divisors[n], # < n && CoprimeQ[#, n/#] &]^2, sum, x}, sum = Total[d]; EvenQ[sum] && CoefficientList[Product[1 + x^i, {i, d}], x][[1 + sum/2]] > 0]; Select[Range[2, 1000], q] (* Amiram Eldar, Jun 01 2025 *)
  • PARI
    \\ See Corneth link

Extensions

a(7)-a(16) from Amiram Eldar, Jun 01 2025
More terms from David A. Corneth, Jun 01 2025

A384493 Composite integers k such that sigma(k) | (k + 1)*tau(k) where tau is number of divisors of k.

Original entry on oeis.org

20, 35, 104, 207, 399, 464, 650, 1519, 1952, 2015, 2774, 2915, 2975, 4454, 11339, 22847, 32318, 63503, 97019, 122499, 130304, 352835, 522752, 924482, 1949375, 7366463, 8382464, 9486399, 15857855, 30222023, 39992975, 49280399, 63483104, 65094623, 69291935, 95309054
Offset: 1

Author

Keywords

Examples

			104 is in the sequence as tau(104) = 8, sigma(104) = 210 and sigma(104) = 210 | 840 = (104 + 1) * 8 = (104 + 1) * tau(104).
		

Crossrefs

Composites in A384354.

Programs

  • Mathematica
    Select[Range[4, 2^20], And[CompositeQ[#1], Divisible[(#1 + 1)*#2, #3]] & @@ Prepend[DivisorSigma[{0, 1}, #], #] &] (* Michael De Vlieger, May 31 2025 *)
  • PARI
    is(n) = my(f = factor(n), nd = numdiv(f)); nd > 2 && ((n+1)*nd) % sigma(f) == 0
    
  • Python
    from sympy import divisors, isprime
    def ok(n): return n > 3 and not isprime(n) and (n+1)*len(d:=divisors(n))%sum(d) == 0
    print([k for k in range(10**6) if ok(k)]) # Michael S. Branicky, May 31 2025

A384354 Numbers k such that the arithmetic mean of the divisors of k evenly divides k+1.

Original entry on oeis.org

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

Author

Ivan N. Ianakiev, May 27 2025

Keywords

Comments

A term k with a fractional arithmetic mean of divisors is allowed as long as that arithmetic mean evenly divides k+1.
There exist triples such as (19,20,21) and quadruples such as (1,2,3,4) of consecutive numbers where the arithmetic mean of the divisors of every earlier number evenly divides the immediately following number. Are there similar quintuples?
Contains every prime p since (1+p)/2 evenly divides 1+p. - Michael S. Branicky, May 29 2025

Examples

			2 is a term since (1+2)/2 = 3/2 and 3/2 evenly divides 3.
19 is a term since (1+19)/2 is 10 and 10 evenly divides 20.
20 is a term since (1+2+4+5+10+20)/6 = 7 and 7 evenly divides 21.
		

Crossrefs

Cf. A000005, A000040 (subsequence), A000203.

Programs

  • Mathematica
    fQ[n_]:=Divisible[n+1,Mean[Divisors[n]]]; Select[Range[300],fQ]
  • PARI
    isok(k) = my(f=factor(k)); denominator((k+1)/(sigma(f)/numdiv(f))) == 1; \\ Michel Marcus, May 31 2025
  • Python
    from sympy import divisors
    def ok(n): return n and (n+1)*len(d:=divisors(n))%sum(d) == 0
    print([k for k in range(300) if ok(k)]) # Michael S. Branicky, May 29 2025
    

A383442 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 triangular number; in case of a tie, preference is given to the positive value.

Original entry on oeis.org

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

Author

N. J. A. Sloane, May 03 2025

Keywords

Comments

Heraclitus (circa 500 BCE) observed that no man can step in the same river twice.
The Heraclitus transform H(S) of a sequence S is formed by starting at 0, and moving s steps to the left or right, where s is any element of S, never visiting any number twice, and moving as close to 0 as possible. In case of a tie, move to the positive term.
The present sequence is the Heraclitus transform of the triangular numbers A000217. For the squares, see A377091. Conjecture: both H(A000217) and H(A000290) contain every (positive or negative) integer. In fact it appears that this property holds whenever S is a monotonically strictly increasing sequence starting with 1. It does not hold for H(A000012), which is A001477.

Programs

  • Mathematica
    A383442list[nmax_] := Module[{s, a, u = 1}, s[_] := False; s[0] = True; NestList[(While[s[u] && s[-u], u++]; a = u; While[s[a] || !IntegerQ[Sqrt[8*Abs[# - a]+1]], a = Boole[a < 0] - a]; s[a] = True; a) &, 0, nmax]];
    A383442list[100] (* Paolo Xausa, May 05 2025 *)
  • Python
    from math import isqrt
    from itertools import count, islice
    def cond(n): return isqrt(m:=8*n+1)**2 == m
    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(), 80))) # Michael S. Branicky, May 03 2025

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

Original entry on oeis.org

0, 2, 4, 8, 6, 11, 7, 12, 18, 13, 19, 25, 20, 26, 32, 27, 33, 38, 34, 39, 44, 40, 45, 51, 46, 52, 50, 53, 59, 57, 60, 58, 65, 69, 64, 70, 74, 72, 78, 73, 77, 83, 86, 84, 87, 85, 95, 97, 94, 96, 101, 104, 102, 107, 103, 108, 114, 109, 115, 118, 116, 119, 117, 120, 129, 132, 130, 136, 131, 135, 140, 143, 141, 144, 142, 145, 156
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 A383445.

Crossrefs

A382723 Number of entries in the n-th row of Pascal's triangle not divisible by 4.

Original entry on oeis.org

1, 2, 3, 4, 3, 6, 6, 8, 3, 6, 8, 12, 6, 12, 12, 16, 3, 6, 8, 12, 8, 16, 16, 24, 6, 12, 16, 24, 12, 24, 24, 32, 3, 6, 8, 12, 8, 16, 16, 24, 8, 16, 20, 32, 16, 32, 32, 48, 6, 12, 16, 24, 16, 32, 32, 48, 12, 24, 32, 48, 24, 48, 48, 64, 3, 6, 8, 12, 8, 16, 16, 24, 8, 16, 20, 32, 16, 32, 32, 48, 8
Offset: 0

Author

N. J. A. Sloane, Apr 23 2025

Keywords

Programs

  • PARI
    a(n) = sum(k=0, n, (binomial(n, k) % 4) != 0); \\ Michel Marcus, Apr 23 2025
    
  • Python
    def A382723(n): return bin(n)[2:].count('10')+2<Chai Wah Wu, Aug 10 2025

Formula

a(n) = (A033264(n)+2)*2^(A000120(n)-1). - Chai Wah Wu, Aug 10 2025

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.
		

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.

A381117 Lengths of runs of consecutive primes in A381019.

Original entry on oeis.org

5, 5, 2, 6, 6, 5, 10, 7, 7, 14, 11, 8, 12, 9, 18, 6, 17, 10, 17, 4, 21, 11, 20, 2, 19, 10, 34, 4, 15, 17, 17, 22, 16, 19, 25, 16, 2, 41, 3, 6, 41, 21, 24, 33, 8, 7, 46, 5, 54, 7, 48, 6, 7, 5, 41, 13, 31, 18, 5, 50, 1, 49, 10, 26, 41, 24, 45, 53, 20, 21, 44, 3
Offset: 1

Author

N. J. A. Sloane, Feb 14 2025

Keywords

Comments

For n > 1, a(n) = A381116(n) - A381116(n-1) - 1. (This is a trivial consequence of the definitions.)

Crossrefs

Programs

  • Mathematica
    nn = 500; c[_] = False; i = 0; 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[i]; i = 0, i++];
        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 *)