OFFSET
2,1
COMMENTS
See links for definition. Specifically, the terms of this sequence are the first several terms of tcW(r,r-1,r), where r=2,3,4,.... Informally, the function tcW is like the multi-color Van der Waerden function W, except that the second parameter determines the number of colors found in the target subsequence. If W(r,k) is the standard multi-color Van der Waerden function with r colors and a required monochrome arithmetic subsequence of length k, then tcW(r,1,k) = W(r,k). In tcW(r,1,k), the 1 would indicate a monochrome subsequence. For tcW(r,2,k) an arithmetic subsequence of length k in 1 OR 2 colors would match the criteria. For tcW(r,3,k) an arithmetic subsequence of length k in 1, 2, or 3 colors suffices.
a(r) = tcW(r,r-1,r).
LINKS
FORMULA
a(n) = (n-1)*(smallest prime factor of n) + 1.
EXAMPLE
a(2) = tcW(2,1,2) = W(2,2) = 3. If {1,2,3} is colored in 2 colors, then a 2 term arithmetic subsequence exists in 1 color (monochrome).
a(3) = tcW(3,2,3) = 7. If {1,...,7} is colored in 3 colors, then a 3 term arithmetic subsequence exists that is colored in at most 2 colors.
a(2) = (2-1)(2) + 1 = 3 a(15) = (15-1)(3) + 1 = 43.
MATHEMATICA
Table[(x - 1) * (FactorInteger[x])[[1]][[1]] + 1, {x, 2, 100}]
PROG
(Other) A C++ program is available from the links. It is not the best program, but it is relatively fast. To get the terms of the above sequence, you have to compile the program and choose parameters such as: find_vdw 10000 5 4 5 for tcW(5, 4, 5) and find_vdw 10000 6 5 6 for tcW(6, 5, 6).
CROSSREFS
KEYWORD
nonn
AUTHOR
Reed Kelly, Feb 22 2009, Feb 25 2009
STATUS
approved