This week's book giveaway is in the Kotlin forum.We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
programming forums Java Java JSRs Mobile Certification Databases Caching Books Engineering Languages Frameworks Products This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Sheriffs:
Saloon Keepers:
Bartenders:

# Sequence

Arjun Shastry
Ranch Hand
Posts: 1906
1
This one is quite easy.
Give the sequence of numbers such that any two adjacent numbers are coprime(relatively prime) and when bigger divided by smaller ,remainder is number adjacent to smaller one.(means smaller number is between 'bigger one' and remainder)

Sonny Pondrom
Ranch Hand
Posts: 128
Is this correct looking at "b" and "c"
a b c d

a = remainder
b = small #
c = large #

Arjun Shastry
Ranch Hand
Posts: 1906
1
Yes

Ryan Smith
Ranch Hand
Posts: 40
1, 2, 3, 5, 13, 31, 74....ad infinitum

Arjun Shastry
Ranch Hand
Posts: 1906
1
{
13, 31, 74
}
74%31 = 12
Actually the sequence consists of Fibonacci numbers.

Ryan Smith
Ranch Hand
Posts: 40
Haha I skipped some didn't I! Sorry that's what I meant

 It is sorta covered in the JavaRanch Style Guide.