A341679 a(1) = 1; for n > 1, a(n) = n divided by the most recently appearing divisor of n in all previous terms.
1, 2, 3, 2, 5, 3, 7, 4, 3, 2, 11, 6, 13, 7, 5, 8, 17, 3, 19, 4, 7, 2, 23, 12, 5, 13, 9, 14, 29, 6, 31, 16, 11, 17, 7, 6, 37, 19, 3, 8, 41, 14, 43, 4, 15, 2, 47, 24, 7, 25, 17, 26, 53, 27, 5, 8, 19, 29, 59, 12, 61, 31, 9, 8, 13, 33, 67, 4, 23, 14, 71, 18, 73, 37, 15, 19, 11, 6, 79, 20, 9, 41, 83
Offset: 1
Keywords
Examples
a(4) = 2 as a(2) = 2 is the most recently occurring divisor of 4, thus a(4) = 4/2 = 2. a(5) = 5 as the only divisor of 5 in the sequence is 1, thus a(5) = 5/1 = 5. a(10) = 2 as a(5) = 5 is the most recently occurring divisor of 10, thus a(10) = 10/5 = 2.
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..10000
- Michael De Vlieger, Annotated plot of n at (x,y) = (a(n), n/a(n)) for 1 <= x <= 139 and 1 <= y <= 99, showing noncomposite d = n/a(n) in red and composite d in blue, with n such that both a(n) and d noncomposite in black.
- Michael De Vlieger, Plot of n at (x,y) = (a(n), n/a(n)) for 1 <= x <= 960 and 1 <= y <= 960.
- Michael De Vlieger, Log-log plot of a(n) for 1 <= n <= 2^20.
- Scott R. Shannon, Image for n=1..1000000.
Programs
-
Mathematica
Block[{a = {1}, k}, Do[k = 1; While[Mod[i, a[[-k]]] != 0, k++]; AppendTo[a, i/a[[-k]] ], {i, 2, 83}]; a] (* Michael De Vlieger, Feb 17 2021 *) (* Second, faster program with memoized last indices of d | n *) Block[{a = {1}, c, k}, c[1] = 1; Monitor[Do[AppendTo[a, Set[k, i/MaximalBy[Map[If[! IntegerQ@ c[#], {#, 0}, {#, c[#]}] &, Divisors[i]], Last][[1, 1]] ]]; c[k] = i , {i, 2, 10^4}], i]; a] (* Michael De Vlieger, Mar 03 2021 *)
Formula
a(n) = n if n is prime.
Comments