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.

A327446 Numbers missing from A327093.

Original entry on oeis.org

1, 4, 6, 8, 9, 12, 14, 18, 20, 22, 24, 26, 28, 29, 30, 32, 38, 41, 42, 44, 46, 48, 49, 53, 54, 60, 62, 64, 65, 66, 68, 70, 72, 73, 74, 77, 80, 84, 85, 86, 90, 94, 98, 100, 102, 104, 106, 108, 109, 110, 111, 114, 116, 118, 120, 124, 125, 128, 130, 132, 136, 137, 138, 140, 149, 150
Offset: 1

Views

Author

N. J. A. Sloane, Sep 14 2019

Keywords

Comments

It would be nice to have an alternative characterization of these numbers.

Crossrefs

Programs

  • SageMath
    # Use with caution: search range must be adjusted as necessary!
    def A327446List(size):
        return sorted(Set([A327419(n) for n in (1..3*size)]))[0:size]
    print(A327446List(66)) # Peter Luschny, Sep 16 2019

A327419 Numbers, when duplicates removed and sorted, are A327446, the complement of A327093.

Original entry on oeis.org

1, 4, 1, 6, 4, 8, 1, 9, 6, 12, 4, 14, 8, 22, 1, 18, 9, 20, 6, 29, 12, 24, 4, 28, 14, 26, 8, 30, 22, 32, 1, 46, 18, 41, 9, 38, 20, 53, 6, 42, 29, 44, 12, 66, 24, 48, 4, 49, 28, 70, 14, 54, 26, 65, 8, 77, 30, 60, 22, 62, 32, 64, 1, 85, 46, 68, 18, 94, 41, 72
Offset: 1

Views

Author

Peter Luschny, Sep 14 2019

Keywords

Crossrefs

Programs

  • SageMath
    def A327419(n):
        s = n + 1
        for k in srange(n, 0, -1):
            if k.divides(s):
                s += k if is_odd(s//k) else -k
        return s
    print([A327419(n) for n in (1..70)])

A327445 Terms of A327093, sorted.

Original entry on oeis.org

2, 3, 5, 7, 10, 11, 13, 15, 16, 17, 19, 21, 23, 25, 27, 31, 33, 34, 35, 36, 37, 39, 40, 43, 45, 47, 50, 51, 52, 55, 56, 57, 58, 59, 61, 63, 67, 69, 71, 75, 76, 78, 79, 81, 82, 83, 87, 88, 89, 91, 92, 93, 95, 96, 97, 99, 101, 103, 105, 107, 112, 113, 115, 117, 119, 121, 122, 123, 126
Offset: 1

Views

Author

N. J. A. Sloane, Sep 14 2019

Keywords

Comments

It would be nice to have an alternative characterization of these numbers.

Crossrefs

A327420 Building sums recursively with the divisibility properties of their partial sums.

Original entry on oeis.org

1, 0, 2, 3, 6, 5, 9, 7, 15, 4, 14, 11, 21, 13, 16, 8, 35, 17, 26, 19, 30, 12, 28, 23, 46, 18, 38, 10, 49, 29, 45, 31, 77, 20, 50, 27, 63, 37, 52, 24, 68, 41, 54, 43, 74, 25, 64, 47, 96, 34, 62, 32, 95, 53, 70, 42, 94, 36, 86, 59, 91, 61, 88, 33, 166, 51, 85
Offset: 0

Views

Author

Peter Luschny, Sep 14 2019

Keywords

Comments

Let R(n) = [k : n + 1 >= k >= 2] and divsign(s, k) = 0 if k does not divide s, else k if s/k is even and else -k. Compute s(k) = s(k+1) + divsign(s(k+1), k) with initial value s(n+2) = n + 1, k running down from n + 1 to 2. Then a(n) = s(2) if n > 0 and a(0) = s(n+2) = 0 + 1 = 1 as R(0) is empty in this case.
Examples: If n = 8 then R(8) = [9, 8, ..., 2] and the partial sums s are [0, 8, 8, 8, 8, 12, 15, 15] giving a(8) = 15. If p is prime, then the partial sums are [0, p, p, ..., p] since p is the only integer in R(p) diving p, i. e. the primes are the fixed points of this sequence. In the example section the computation of a(9) is traced.
Apparently the sequence is a permutation of the nonnegative integers.

Examples

			The computation of a(9) = 4:
[ k: s(k) = s(k+1) + divsign(s(k+1),k)]
[10:   0,    10,       -10]
[ 9:   9,     0,         9]
[ 8:   9,     9,         0]
[ 7:   9,     9,         0]
[ 6:   9,     9,         0]
[ 5:   9,     9,         0]
[ 4:   9,     9,         0]
[ 3:   6,     9,        -3]
[ 2:   4,     6,        -2]
		

Crossrefs

Programs

  • Julia
    divsign(s, k) = rem(s, k) == 0 ? (-1)^div(s, k)*k : 0
    function A327420(n)
        s = n + 1
        for k in n+1:-1:2 s += divsign(s, k) end
        s
    end
    [A327420(n) for n in 0:66] |> println
  • Maple
    divsign := (s, k) -> `if`(irem(s, k) <> 0, 0, (-1)^iquo(s,k)*k):
    A327420 := proc(n) local s, k; s := n + 1;
        for k from s by -1 to 2 do
            s := s + divsign(s, k) od;
    return s end:
    seq(A327420(n), n=0..66);
  • SageMath
    def A327420(n):
        s = n + 1
        r = srange(s, 1, -1)
        for k in r:
            if k.divides(s):
                s += (-1)^(s//k)*k
        return s
    print([A327420(n) for n in (0..66)])
    

Formula

For p prime, a(p) = p. - Bernard Schott, Sep 14 2019

A327119 Sequence obtained by swapping each (k*(2n))-th element of the nonnegative integers with the (k*(2n+1))-th element, for all k>0 in ascending order, omitting the first term.

Original entry on oeis.org

0, 1, 3, 2, 7, 4, 8, 6, 14, 5, 15, 10, 20, 12, 17, 9, 34, 16, 27, 18, 31, 13, 29, 22, 47, 19, 39, 11, 48, 28, 44, 30, 76, 21, 51, 26, 62, 36, 53, 25, 69, 40, 55, 42, 75, 24, 65, 46, 97, 35, 63, 33, 94, 52, 71, 43, 95, 37, 87, 58, 90, 60, 89, 32, 167, 50, 84
Offset: 1

Views

Author

Jennifer Buckley, Sep 13 2019

Keywords

Comments

The first term must be omitted because it does not converge.
Start with the sequence of nonnegative integers [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...].
Swap all pairs specified by k=1, resulting in [1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, ...], so the first term of the final sequence is 0 (No swaps for k>1 will affect this term).
Swap all pairs specified by k=2, resulting in [3, 0, 1, 2, 7, 4, 5, 6, 11, 8, 9, ...], so the second term of the final sequence is 1 (No swaps for k>2 will affect this term).
Swap all pairs specified by k=3, resulting in [2, 0, 1, 3, 7, 4, 8, 6, 11, 5, 9, ...], so the third term of the final sequence is 3 (No swaps for k>3 will affect this term).
Continue for all values of k.
a(n) is equivalent to -A327093(-n), if A327093 is extended to all integers.
It appears that n is an odd prime number iff a(n+1)=n-1. If true, is there a formal analogy with the Sieve of Eratosthenes (by swapping instead of marking terms), or is this another type of sieve? - Jon Maiga, May 31 2021

Crossrefs

Inverse: A327120.

Programs

  • Go
    func a(n int) int {
        for k := n; k > 0; k-- {
            if n%k == 0 {
                if (n/k)%2 == 0 {
                    n = n + k
                } else {
                    n = n - k
                }
            }
        }
        return n
    }

Formula

a(n) = A004442(A327420(n)) (conjectured). - Jon Maiga, May 31 2021

A327487 T(n, k) are the summands given by the generating function of A327420(n), triangle read by rows, T(n,k) for 0 <= k <= n.

Original entry on oeis.org

1, 2, -2, 3, -3, 2, 4, -4, 3, 0, 5, -5, 4, 0, 2, 6, -6, 5, 0, 0, 0, 7, -7, 6, 0, 0, 3, 0, 8, -8, 7, 0, 0, 0, 0, 0, 9, -9, 8, 0, 0, 0, 4, 3, 0, 10, -10, 9, 0, 0, 0, 0, 0, -3, -2, 11, -11, 10, 0, 0, 0, 0, 5, 0, -3, 2, 12, -12, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Peter Luschny, Sep 14 2019

Keywords

Examples

			Triangle starts (at the end of the line is the row sum (A327420)):
[ 0] [ 1] 1
[ 1] [ 2,  -2] 0
[ 2] [ 3,  -3,  2] 2
[ 3] [ 4,  -4,  3, 0] 3
[ 4] [ 5,  -5,  4, 0, 2] 6
[ 5] [ 6,  -6,  5, 0, 0, 0] 5
[ 6] [ 7,  -7,  6, 0, 0, 3, 0] 9
[ 7] [ 8,  -8,  7, 0, 0, 0, 0, 0] 7
[ 8] [ 9,  -9,  8, 0, 0, 0, 4, 3,  0] 15
[ 9] [10, -10,  9, 0, 0, 0, 0, 0, -3, -2] 4
[10] [11, -11, 10, 0, 0, 0, 0, 5,  0, -3, 2] 14
		

Crossrefs

Programs

  • SageMath
    def divsign(s, k):
        if not k.divides(s): return 0
        return (-1)^(s//k)*k
    def A327487row(n):
        s = n + 1
        r = srange(s, 1, -1)
        S = [-divsign(s, s)]
        for k in r:
            s += divsign(s, k)
            S.append(-divsign(s, k))
        return S
    # Prints the triangle like in the example section.
    for n in (0..10):
        print([n], A327487row(n), sum(A327487row(n)))

Formula

Sum_{k=0..n} T(n, k) = A327420(n).
Showing 1-6 of 6 results.