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
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
-
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)))
A327093
Sequence obtained by swapping each (k*(2n))-th element of the positive integers with the (k*(2n-1))-th element, for all k > 0, in ascending order.
Original entry on oeis.org
2, 3, 7, 5, 11, 13, 15, 10, 17, 19, 23, 25, 27, 21, 40, 16, 35, 36, 39, 37, 58, 33, 47, 50, 52, 43, 45, 34, 59, 78, 63, 31, 76, 55, 82, 67, 75, 57, 99, 56, 83, 112, 87, 61, 126, 69, 95, 92, 97, 96, 133, 71, 107, 81, 142, 79, 139, 91, 119, 155, 123, 93, 122, 51, 151, 146, 135
Offset: 1
-
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
}
-
def a(n):
for k in srange(n, 0, -1):
if k.divides(n):
n += k if is_odd(n//k) else -k
return n
print([a(n) for n in (1..67)]) # Peter Luschny, 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
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
Showing 1-4 of 4 results.
Comments