A367408 a(n) = n for n a power of 2; otherwise let 2^r be the greatest power of 2 which does not exceed n, then a(n) = the least novel m*a(k) where k = n - 2^r, and m is not a prior term.
1, 2, 3, 4, 5, 12, 18, 8, 6, 14, 21, 28, 35, 84, 126, 16, 7, 20, 27, 36, 45, 108, 162, 72, 54, 140, 189, 252, 315, 756, 1134, 32, 9, 22, 30, 40, 50, 120, 180, 80, 60, 154, 210, 280, 350, 840, 1260, 160, 70, 200, 270, 360, 450, 1080, 1620, 720, 540, 1400, 1890, 2520, 3150, 7560, 11340, 64, 10
Offset: 1
Keywords
Examples
a(3) = 3 since k = 1, a(1) = 1, and 3 is the smallest number which has not already occurred. a(7) = 18, since k = 3, a(3) = 3, m = 6 is the least unused number and 18 has not already occurred. For n = 18, k = 2, a(2) = 2, m = 9 is the least unused number, so we should expect a(18) = 2*9 = 18, but 18 has already occurred at a(7). Therefore we increment to m = 10, the next smallest unused number, and find a(18) = 20 (which has not occurred previously).
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..16384
- Michael De Vlieger, Plot prime(i)^m | a(n) at (x,y) = (n,i), 64X vertical exaggeration, with a color function showing m = 1 in black, m = 2 in red, m = 3 in orange, ..., m = 16 in magenta.
Programs
-
Mathematica
Block[{a, c, k, m, t, nn}, nn = 128; c[] := False; c[1] = True; m[] := 1; a[1] = 1; Do[If[IntegerQ[#], Set[k, i], While[Or[c[m[#]], c[Set[k, # m[#]]]], m[#]++] &[ a[i - 2^Floor[#]]]] &@ Log2[i]; Set[{a[i], c[k]}, {k, True}], {i, nn}]; Array[a, nn] ] (* Michael De Vlieger, Jul 01 2025 *)
-
PARI
lista(nn) = my(va=vector(nn)); for (n=1, nn, my(p=2^logint(n, 2)); if (p == n, va[n] = n, my(k=n-p, m=1); while (#select(x->(x==m), va) || #select(x->(x==m*va[k]), va), m++); va[n] = m*va[k];);); va; \\ Michel Marcus, Dec 17 2023
Formula
a(2^k) = 2^k for all k >= 0.
a(2^k + 1) = m, the least unused term up to a(2^k), where multiples (other than 1) of m have been used to generate terms between a(2^(k-1)) and a(2^k) except for those which have occurred earlier; see Example.
Comments