Jennifer Buckley has authored 4 sequences.
A372297
Limit of the recursion B(k) = T[k](B(k-1)), where B(1) = (1,2,3,4,5,...) and T[k] is the transformation that permutes the entries k(2i-1) and k(2i) for all positive integers i, if k is prime.
Original entry on oeis.org
1, 4, 8, 2, 12, 3, 16, 6, 10, 5, 24, 9, 28, 7, 18, 14, 36, 15, 40, 20, 26, 11, 48, 21, 27, 13, 32, 22, 60, 25, 64, 30, 42, 17, 39, 33, 76, 19, 50, 35, 84, 38, 88, 34, 52, 23, 96, 45, 54, 46, 66, 44, 108, 51, 63, 49, 74, 29, 120, 55, 124, 31, 65, 62, 75
Offset: 1
B(1) = 1,2,3,4, 5,6,7,8, 9,10,11,12,13,14,...
B(2) = 1,4,3,2, 5,8,7,6, 9,12,11,10,13,16,...
B(3) = 1,4,8,2, 5,3,7,6,10,12,11, 9,13,16,...
B(4) = 1,4,8,2, 5,3,7,6,10,12,11, 9,13,16,... (No change)
B(5) = 1,4,8,2,12,3,7,6,10, 5,11, 9,13,16,...
-
max = 66; b[1, j_] := j; b[k_, j_] := b[k, j] = b[k-1, j]; Do[If[PrimeQ[k],b[k, 2j*k-k] = b[k-1, 2j*k]; b[k, 2j*k] = b[k-1, 2j*k-k],b[k,j ]=b[k-1,j]], {k, 2, max}, {j, 1, max}]; a[n_] := b[max, n]; Table[a[n], {n, 1, max}]
Original entry on oeis.org
1, 2, 4, 3, 6, 10, 8, 5, 7, 16, 12, 28, 14, 22, 9, 11, 18, 15, 20, 26, 13, 34, 24, 82, 46, 40, 36, 19, 30, 23, 32, 21, 64, 52, 17, 50, 38, 58, 76, 27, 42, 244, 44, 56, 31, 70, 48, 25, 29, 100, 66, 35, 54, 39, 136, 43, 106, 88, 60, 118, 62, 94, 37, 51, 78, 47, 68, 86
Offset: 0
-
a(n) = { my (d=0); while (n, d = select(t -> t>d, divisors(n))[1]; my (k=n/d); if (k%2, n-=d, n+=d)); return (d+1) } \\ Rémy Sigrist, 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
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
Comments