A346268 a(n) is the smallest positive number not yet in a(0..n-1) such that the absolute differences of order k = 1 .. n-1 of a(0..n) contain a maximum of k-1 duplicate values. We define a(0) = 1.
1, 2, 4, 7, 12, 3, 9, 20, 40, 36, 5, 26, 18, 47, 115, 13, 6, 19, 44, 94, 193, 87, 60, 48, 84, 170, 355, 31, 14, 63, 25, 119, 71, 187, 444, 34, 8, 42, 98, 211, 450, 100, 10, 62, 132, 116, 274, 763, 50, 22, 73, 244, 792, 92, 1502, 5433, 27, 17, 41, 117, 77, 206, 540, 1315
Offset: 0
Keywords
Examples
a(0..9) = {1,2,4,7,12,3,9,20,40,36} no duplicates. k1(0..9) = {1,2,3,5,9,6,11,20,4,31} no duplicates. k2(0..9) = {1,1,2,4,3,5,9,16,27,10} one duplicate 1. k3(0..9) = {0,1,2,1,2,4,7,11,17,3} two duplicates 1 and 2.
Links
- Thomas Scheuerle, Log plot of a(0..200)(blue), k1(0..200)(yellow) and k2(0..200)(orange)
Programs
-
MATLAB
function a = A346268(max_n) a(1) = 1; t_min = 2; for n = 1:max_n t = t_min; while ~isok([a t]) t = t+1; end a = [a t]; if t == t_min+1 t_min = t+1; end end end function [ ok ] = isok( num ) ok = (length(num) == length(unique(num))); dnum = num; if ok for k = 1:(length(num)-1) dnum = abs(diff(dnum,1)); ok = ok && ((length(dnum) - length(unique(dnum))) < k); if ~ok break; end end end end
Comments