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: Charlie Neder

Charlie Neder's wiki page.

Charlie Neder has authored 15 sequences. Here are the ten most recent ones:

A324213 Number of k with 0 <= k <= sigma(n) such that n-k and 2n-sigma(n) are relatively prime.

Original entry on oeis.org

2, 4, 3, 8, 4, 2, 4, 16, 12, 9, 6, 14, 6, 12, 8, 32, 10, 26, 8, 21, 14, 18, 12, 20, 30, 16, 18, 2, 14, 24, 10, 64, 16, 24, 22, 88, 14, 30, 26, 36, 18, 32, 14, 42, 26, 28, 24, 54, 56, 80, 20, 32, 26, 40, 36, 60, 38, 42, 30, 56, 18, 42, 48, 128, 42, 48, 22, 50, 28, 72, 26, 122, 26, 54, 58, 46, 48, 56, 26, 86, 120, 60, 42, 96, 54
Offset: 1

Author

Antti Karttunen and David A. Corneth, May 26 2019, with better name from Charlie Neder, Jun 02 2019

Keywords

Comments

Number of ways to form the sum sigma(n) = x+y so that n-x and n-y are coprime, with x and y in range 0..sigma(n).
From Antti Karttunen, May 28 - Jun 08 2019: (Start)
Empirically, it seems that a(n) >= A034444(n) and also that a(n) >= A034444(A000203(n)) unless n is in A000396.
Specifically, if it could be proved that a(n) >= A034444(n)/2 for n >= 2, which in turn would imply that a(n) >= A001221(n) for all n, then we would know that no odd perfect numbers could exist. Note that a(n) must be 2 on all perfect numbers, whether even or odd. See also A325819.
(End)

Examples

			For n=1, sigma(1) = 1, both gcd(1-0, 1-(1-0)) = gcd(1,0) = 1 and gcd(1-1, 1-(1-1)) = gcd(0,1) = 1, thus a(1) = 2.
--
For n=3, sigma(3) = 4, we have 5 cases to consider:
  gcd(3-0, 3-(4-0)) = 1 = gcd(3-4, 3-(4-4)),
  gcd(3-1, 3-(4-1)) = 2 = gcd(3-3, 3-(4-3)),
  gcd(3-2, 3-(4-2)) = 1,
of which three cases give 1 as a result, thus a(3) = 3.
--
For n=6, sigma(6) = 12, we have 13 cases to consider:
  gcd(6-0, 6-(12-0)) = 6 = gcd(6-12, 6-(12-12)),
  gcd(6-1, 6-(12-1)) = 5 = gcd(6-11, 6-(12-11)),
  gcd(6-2, 6-(12-2)) = 4 = gcd(6-10, 6-(12-10)),
  gcd(6-3, 6-(12-3)) = 3 = gcd(6-9, 6-(12-9)),
  gcd(6-4, 6-(12-4)) = 2 = gcd(6-8, 6-(12-8))
  gcd(6-5, 6-(12-5)) = 1 = gcd(6-7, 6-(12-7)),
  gcd(6-6, 6-(12-6)) = 0,
of which only two give 1 as a result, thus a(6) = 2.
--
For n=10, sigma(10) = 18, we have 19 cases to consider:
  gcd(10-0, 10-(18-0)) = 2 = gcd(10-18, 10-(18-18)),
  gcd(10-1, 10-(18-1)) = 1 = gcd(10-17, 10-(18-17)),
  gcd(10-2, 10-(18-2)) = 2 = gcd(10-16, 10-(18-16)),
  gcd(10-3, 10-(18-3)) = 1 = gcd(10-15, 10-(18-15)),
  gcd(10-4, 10-(18-4)) = 2 = gcd(10-14, 10-(18-14)),
  gcd(10-5, 10-(18-5)) = 1 = gcd(10-13, 10-(18-13)),
  gcd(10-6, 10-(18-6)) = 2 = gcd(10-12, 10-(18-12)),
  gcd(10-7, 10-(18-7)) = 1 = gcd(10-11, 10-(18-11)),
  gcd(10-8, 10-(18-8)) = 2 = gcd(10-10, 10-(18-10)),
  gcd(10-9, 10-(18-9)) = 1,
of which 9 cases give 1 as a result, thus a(10) = 9.
--
For n=15, sigma(15) = 24, we have 25 cases to consider:
  gcd(15-0, 15-(24-0)) = 3 = gcd(15-24, 15-(24-24)),
  gcd(15-1, 15-(24-1)) = 2 = gcd(15-23, 15-(24-23)),
  gcd(15-2, 15-(24-2)) = 1 = gcd(15-22, 15-(24-22)),
  gcd(15-3, 15-(24-3)) = 6 = gcd(15-21, 15-(24-21)),
  gcd(15-4, 15-(24-4)) = 1 = gcd(15-20, 15-(24-20)),
  gcd(15-5, 15-(24-5)) = 2 = gcd(15-19, 15-(24-19)),
  gcd(15-6, 15-(24-6)) = 3 = gcd(15-18, 15-(24-18)),
  gcd(15-7, 15-(24-7)) = 2 = gcd(15-17, 15-(24-17)),
  gcd(15-8, 15-(24-8)) = 1 = gcd(15-16, 15-(24-16)),
  gcd(15-9, 15-(24-9)) = 6 = gcd(15-15, 15-(24-15)),
  gcd(15-10, 15-(24-10)) = 1 = gcd(15-14, 15-(24-14)),
  gcd(15-11, 15-(24-11)) = 2 = gcd(15-13, 15-(24-13)),
  gcd(15-12, 15-(24-12)) = 3,
of which 2*4 = 8 cases give 1 as a result, thus a(15) = 8.
		

Programs

  • Mathematica
    Array[Sum[Boole[1 == GCD[#1 - i, #1 - (#2 - i)]], {i, 0, #2}] & @@ {#, DivisorSigma[1, #]} &, 85] (* Michael De Vlieger, Jun 09 2019 *)
  • PARI
    A324213(n) = { my(s=sigma(n)); sum(i=0,s,(1==gcd(n-i,n-(s-i)))); };

Formula

a(n) = Sum_{i=0..sigma(n)} [1 == gcd(n-i,n-(sigma(n)-i))], where [ ] is the Iverson bracket and sigma(n) is A000203(n).
a(A000396(n)) = 2.
a(n) = A325815(n) + A034444(n).
a(n) = 1+A000203(n) - A325816(n).
a(A228058(n)) = A325819(n).

A308563 Langton's ant on a three-dimensional grid: iterations where the ant passes through the origin.

Original entry on oeis.org

0, 4, 8, 18, 130, 2206, 4326, 4650, 16344, 16814, 47942, 48000, 49928
Offset: 1

Author

Felix Fröhlich and Charlie Neder, Jun 07 2019

Keywords

Comments

For the rules applying to this ant, see A325953.
The sequence is finite, with 49928 being the last term. The ant never reaches the origin again after that, since it starts building a highway pattern at iteration 93475.

Crossrefs

A308628 A Van Eck-type sequence on the triangular lattice.

Original entry on oeis.org

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

Author

Charlie Neder, Jun 11 2019

Keywords

Comments

For a given lattice, the Van Eck sequence over that lattice is the unique sequence of nonnegative integers such that, if all equal terms are connected by "bridges" that travel between adjacent faces, then each term is the length of the bridge connecting the previous term to a term with lower index, or 0 if no such bridge exists. Generally, the Van Eck sequence of a given lattice is not unique since it depends on the path that the sequence takes through the lattice. This sequence uses a spiral, as in A308625 and A308626, and appears as follows, starting at the cell in parentheses facing upward and traveling clockwise:
--------------------------------
\ / \ / \ 3 / \ 1 / \ / \
.\ / \ / 3 \ / 1 \ / 1 \ / \
--------------------------------
./ \ / \ 2 / \ 1 / \ 1 / \ /
/ \ / 0 \ / 0 \ / 0 \ / 1 \ /
--------------------------------
\ / \ 3 / \(0)/ \ 2 / \ 1 / \
.\ / \ / 2 \ / 0 \ / 1 \ / \
--------------------------------
./ \ / \ 0 / \ 1 / \ 1 / \ /
/ \ / \ / 4 \ / 1 \ / \ /
--------------------------------
Note: This sequence uses the definition that two cells are adjacent if they share an edge. Allowing vertex adjacency makes a very boring sequence: 0, 0, 1, and 0, followed by an infinite string of 1's.
a(n) = 1 for all n >= 17, since the previous 1 will always be adjacent to another 1. The Van Eck-type sequences for the square and hexagonal lattices end similarly.

Examples

			a(7) = 1, and the only other 1 to appear so far is 4 cells away (not 2, since we only consider edge adjacency), so a(8) = 4.
		

Crossrefs

Cf. A181391, A308625, and A308626 for Van Eck-type sequences over the 1D "lattice" and the 2D hexagonal and square lattices, respectively.

Formula

G.f.: x^3*(1 - x + 2*x^2 - 2*x^3 + x^4 + 3*x^5 - 4*x^6 + 2*x^7 + x^8 - 3*x^9 + 2*x^10 + x^11 - 2*x^13)/(1 - x). - Elmo R. Oliveira, Aug 03 2024

A306582 a(n) is the least integer k such that the remainder of k modulo p is strictly increasing over the first n primes.

Original entry on oeis.org

0, 2, 4, 34, 52, 194, 502, 1138, 4042, 5794, 5794, 62488, 798298, 5314448, 41592688, 483815692, 483815692, 5037219688, 18517814158, 18517814158, 19566774820732, 55249201504132, 1257253598786974, 6743244322196288, 24165921989926702, 24165921989926702, 5346711077171356252, 47449991406350138602, 278545375679341352084, 5604477496256287791854
Offset: 1

Author

Charlie Neder, Jun 03 2019

Keywords

Comments

If "strictly increasing" is replaced with "nondecreasing", this sequence becomes A000004.
Trivially, a(n) <= A002110(n)-2. Equality only holds for n = 0.

Examples

			  a(n) modulo 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, ...
  ==== ==================================================
     0        0, 0, 0, 0,  0,  0,  0,  0,  0,  0,  0, ...
     2        0, 2, 2, 2,  2,  2,  2,  2,  2,  2,  2, ...
     4        0, 1, 4, 4,  4,  4,  4,  4,  4,  4,  4, ...
    34        0, 1, 4, 6,  1,  8,  0, 15, 11,  5,  3, ...
    52        0, 1, 2, 3,  8,  0,  1, 14,  6, 23, 21, ...
   194        0, 2, 4, 5,  7, 12,  7,  4, 10, 20,  8, ...
   502        0, 1, 2, 5,  7,  8,  9,  8, 19,  9,  6, ...
  1138        0, 1, 3, 4,  5,  7, 16, 17, 11,  7, 22, ...
  4042        0, 1, 2, 3,  5, 12, 13, 14, 17, 11, 12, ...
  5794        0, 1, 4, 5,  8,  9, 14, 18, 21, 23, 28, ...
		

Crossrefs

Programs

  • PARI
    isok(k, n) = {my(last = -1, cur); for (i=1, n, cur = k % prime(i); if (cur <= last, return (0)); last = cur;); return (1);}
    a(n) = {my(k=0); while(!isok(k, n), k++); k;} \\ Michel Marcus, Jun 04 2019
    
  • Python
    from sympy import prime
    def A306582(n):
        plist, rlist, x = [prime(i) for i in range(1,n+1)], [0]*n, 0
        while True:
            for i in range(n-1):
                if rlist[i] >= rlist[i+1]:
                    break
            else:
                return x
            for i in range(n):
                rlist[i] = (rlist[i] + 1) % plist[i]
            x += 1 # Chai Wah Wu, Jun 15 2019

Extensions

a(16)-a(20) from Daniel Suteu, Jun 03 2019
a(21)-a(23) from Giovanni Resta, Jun 16 2019
a(24)-a(27) from Bert Dobbelaere, Jun 22 2019
a(28)-a(30) from Bert Dobbelaere, Sep 05 2019

A306612 a(n) is the least integer k > 2 such that the remainder of -k modulo p is strictly increasing over the first n primes.

Original entry on oeis.org

3, 4, 7, 8, 16, 16, 157, 157, 16957, 19231, 80942, 82372, 82372, 9624266, 19607227, 118867612, 4968215191, 31090893772, 118903377091, 187341482252, 1784664085208, 12330789708022, 68016245854132, 68016245854132, 10065964847743822, 74887595879692807, 1825207861455319267, 98403562254816509476, 283462437415903129597, 2126598918934702375802
Offset: 1

Author

Charlie Neder, Jun 03 2019

Keywords

Comments

0, 1, and 2 satisfy this condition for all p, so this sequence starts at 3. The growth of this sequence is much more irregular than that of the companion sequence A306582.

Examples

			   a(n) modulo 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, ...
  ===== ==================================================
      3        1, 0, 2, 4,  8, 10, 14, 16, 20, 26, 28, ...
      4        0, 2, 1, 3,  7,  9, 13, 15, 19, 25, 27, ...
      7        1, 2, 3, 0,  4,  6, 10, 12, 16, 22, 24, ...
      8        0, 1, 2, 6,  3,  5,  9, 11, 15, 21, 23, ...
     16        0, 2, 4, 5,  6, 10,  1,  3,  7, 13, 15, ...
    157        1, 2, 3, 4,  8, 12, 13, 14,  4, 17, 29, ...
  16957        1, 2, 3, 4,  5,  8,  9, 10, 17,  8,  0, ...
  19231        1, 2, 4, 5,  8,  9, 13, 16, 20, 25, 20, ...
  80942        0, 1, 3, 6,  7,  9, 12, 17, 18, 26, 30, ...
		

Crossrefs

Cf. A306582.

Programs

  • PARI
    isok(k, n) = {my(last = -1, cur); for (i=1, n, cur = -k % prime(i); if (cur <= last, return (0)); last = cur;); return (1);}
    a(n) = {my(k=3); while(!isok(k, n), k++); k;} \\ Michel Marcus, Jun 04 2019
    
  • Python
    from sympy import prime
    def A306612(n):
        plist, x = [prime(i) for i in range(1,n+1)], 3
        rlist = [-x % p for p in plist]
        while True:
            for i in range(n-1):
                if rlist[i] >= rlist[i+1]:
                    break
            else:
                return x
            for i in range(n):
                rlist[i] = (rlist[i] - 1) % plist[i]
            x += 1 # Chai Wah Wu, Jun 15 2019

Extensions

a(16)-a(19) from Daniel Suteu, Jun 04 2019
a(20)-a(25) from Giovanni Resta, Jun 16 2019
a(26)-a(27) from Bert Dobbelaere, Jun 22 2019
a(28)-a(30) from Bert Dobbelaere, Sep 04 2019

A308471 Lowest outliers for A057660.

Original entry on oeis.org

1, 4, 6, 12, 24, 30, 60, 120, 180, 210, 360, 420, 840, 1260, 2520, 4620, 9240, 13860, 27720, 55440, 60060, 120120, 180180, 360360, 720720, 1441440, 1801800, 2042040, 3063060, 6126120, 12252240, 24504480, 30630600, 36756720, 38798760
Offset: 1

Author

Charlie Neder, May 29 2019

Keywords

Comments

A057660(n) is a multiplicative function bounded above by n*(n-1)+1, which is reached whenever n is 1 or prime. These numbers are the n such that the ratio between A057660(n) and the upper bound reaches a record low.
Motivated by Daniel Forgues's conjecture that this sequence consists of 4 and A051451.
A subsequence of A025487.

Examples

			A057660(60060)/(60060*60059+1) = 1211716737/3607143541 ~ 0.3359214, and every number less than 60060 has a ratio > 0.34, so 60060 is in this sequence.
		

Crossrefs

A307314 Number of divisors d of 2n such that adding d to 2n in binary requires no carries.

Original entry on oeis.org

1, 2, 1, 3, 2, 3, 1, 4, 2, 3, 1, 5, 1, 2, 1, 5, 2, 5, 1, 5, 2, 2, 1, 7, 2, 2, 2, 4, 1, 3, 1, 6, 2, 4, 1, 7, 2, 3, 1, 7, 2, 4, 1, 3, 2, 2, 1, 9, 1, 4, 2, 3, 1, 4, 1, 6, 1, 2, 1, 6, 1, 2, 1, 7, 4, 6, 1, 6, 2, 3, 1, 10, 2, 3, 1, 4, 1, 3, 1, 9
Offset: 1

Author

Charlie Neder, Apr 02 2019

Keywords

Comments

Equivalently, number of numbers d such that d|2n and d AND 2n = 0.
First differences of either bisection of A325123.

Crossrefs

Programs

  • Mathematica
    a[n_] := DivisorSum[2*n, 1 &, BitAnd[#, 2*n] == 0 &]; Array[a, 100] (* Amiram Eldar, Feb 08 2025 *)
  • PARI
    a(n) = sumdiv(2*n, d, bitand(d, 2*n) == 0); \\ Michel Marcus, Apr 02 2019

Formula

A001511(n) <= a(n) <= A000005(n).
a(p) = 1 + [p is in A247068] for p prime, where [] is the Iverson bracket.

A306640 Array read by antidiagonals: A(n,k) (n,k >= 2) is the base-n state complexity of the partitioned finite deterministic automaton (PFDA) for the periodic sequence (123..k)*.

Original entry on oeis.org

3, 6, 2, 7, 4, 3, 20, 8, 3, 2, 13, 20, 5, 6, 3, 21, 7, 10, 4, 4, 2, 15, 42, 7, 6, 9, 3, 3, 54, 16, 21, 12, 5, 8, 6, 2, 41, 13, 13, 42, 7, 20, 5, 4, 3, 110, 40, 27, 16, 14, 6, 20, 4, 3, 2, 27, 55, 21, 54, 23, 8, 13, 10, 9, 6, 3, 156, 25, 55, 11
Offset: 1

Author

Charlie Neder, Mar 02 2019

Keywords

Comments

Rows are ultimately periodic.

Examples

			Array begins:
   3   2   3   2   3
   6   4   3   6   4
   7   8   5   4   9  ...
  20  20  10   6   5
  13   7   7  12   7
          ...
		

Crossrefs

Columns: A217519-A217521 (n = 2-4), A247566-A247581 (n = 5-20).
Rows: A217515-A217518 (k = 3-6), A247387-A247391 (k = 7-11), A247434-A247442 (k = 12-20).

Formula

A(n,n^k) = Sum_{i=0..k} n^i.
A(n+1,n) = n.
It also appears that A(n-1,n) = 2n.

A306564 Record values in A216476.

Original entry on oeis.org

1, 2, 4, 6, 10, 12, 18, 20, 28, 36, 48, 84, 132, 393, 657, 744, 1140, 1580, 2704, 3244, 8700, 12250, 17395, 17860, 19505, 36785, 59100, 67805, 97440
Offset: 1

Author

Charlie Neder, Feb 26 2019

Keywords

Examples

			If we repeatedly apply the "Oware" operation to 11, we get the period-4 cycle - denoting the pivot digit with parentheses - (1)1 -> 0(2) -> 1(1) -> (2)0 -> (1)1 , and no number less than 11 has a cycle of this length or longer.
		

Crossrefs

Cf. A216476, A216502 (positions of records).

Formula

a(n) = A216476(A216502(n)).

A306332 Records in A181159.

Original entry on oeis.org

1, 2, 6, 16, 36, 82, 166, 262, 382, 670, 766, 1066, 1492, 2050, 2470, 2710, 3370, 4192, 4432, 5050, 6274, 7354, 8050, 8590, 10270, 11256, 12250, 15190, 15670, 18910, 22666, 26026, 26110, 32146, 32230, 47806, 48250, 56026, 66652, 72766, 82630, 84706
Offset: 1

Author

Charlie Neder, Feb 07 2019

Keywords

Comments

A181160 gives the indices of these terms.

Crossrefs