OFFSET
1,3
COMMENTS
Definition of GCQ_B: The greatest common non-divisor of type B (GCQ_B) of two positive integers a and b (a<=b) is the largest positive non-divisor q of numbers a and b such that 1<=q<=b common to a and b; GCQ_B(a, b) = 0 if no such c exists.
For b>=5 holds: GCQ_B(a, b) = b - 1 if a = b or a<= b-2, GCQ_B(a, b) = b - 2 if a = b-1.
FORMULA
a(n) = n*(n-1) - 1 for n>= 5.
EXAMPLE
For n = 4, a(4) = 9 because GCQ_B(4, 1) = 3, GCQ_B(4, 2) = 3, GCQ_B(4, 3) = 0, GCQ_B(4, 4) = 3 and sum of results is 9.
For n = 5, a(4) = 19 because GCQ_B(5, 1) = 4, GCQ_B(5, 2) = 4, GCQ_B(5, 3) = 4, GCQ_B(5, 4) = 3, GCQ_B(5, 5) = 4 and sum of results is 19.
CROSSREFS
KEYWORD
nonn
AUTHOR
Jaroslav Krizek, Nov 26 2011
STATUS
approved