OFFSET
1,1
EXAMPLE
k = 54 is a term as the number of steps required to compute the Euclidean algorithm gcd(k, m) is smaller than A034883(m) for all m > k.
k = 27 is not a term as the number of steps required to compute the Euclidean algorithm gcd(k, m) is equal to A034883(m) for m = 35 (steps = 5), 44 (steps = 6) and 46 (steps = 6).
PROG
(Ruby)
def gcdsteps(k, m)
k.zero? ? 0 : 1 + gcdsteps(m % k, k)
end
flags = [nil, *1..5000]
(1..flags.length).each do |m|
scores = []
(1..m).each do |k|
scores << [gcdsteps(k, m), k]
end
scores.sort_by! { |n| n[0] }
scores.select { |n| n[0] == scores.last[0] }.each do |n|
flags[n[1]] = nil
end
end
print flags[1..flags.length / 2].compact
CROSSREFS
KEYWORD
nonn
AUTHOR
John Metcalf, Aug 29 2023
STATUS
approved