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.

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

Views

Author

Jennifer Buckley, Apr 25 2024

Keywords

Comments

Sequence contains all positive integers.
a(2p) = p for all prime numbers p.

Examples

			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,...
		

Crossrefs

Cf. A064494.

Programs

  • Mathematica
    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}]