Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sequence

 
Arjun Shastry
Ranch Hand
Posts: 1899
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this correct looking at "b" and "c"
a b c d

a = remainder
b = small #
c = large #
 
Arjun Shastry
Ranch Hand
Posts: 1899
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes
 
Ryan Smith
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1, 2, 3, 5, 13, 31, 74....ad infinitum
 
Arjun Shastry
Ranch Hand
Posts: 1899
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
{
13, 31, 74
}
74%31 = 12
Actually the sequence consists of Fibonacci numbers.
 
Ryan Smith
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Haha I skipped some didn't I! Sorry that's what I meant
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic