"be consistent" PerlMonks

### Comment on

 Need Help??

You are correct: the formula in the first link does not produce the series listed for it (I noticed that, too). At the time I wrote it off as something to do with the different OFFSET value (1,2 in the first link vs 0,1 in the second) and didn't pursue it further. I just investigated the meaning of OFFSET, and found that while it may account for the discrepancy in the number of terms at the start of the series (e.g., before '83' is reached), it does not account for the difference in values (1,2,6 vs 2,3,7). I included the first link because, as you noted, the description of the problem is much better than in the second.

There is additional discussion of this issue here, where the author of the reference in the first link (Michiel de Bondt) weighs in.

Good poll idea! ++

Update following tye's post:
6 bananas are required to go 3 miles

```Eat a banana, carry one 0.5 miles, drop it, and return.  Repeat.
Total bananas: 4

0       1       2       3
|---.-:-|-------|-------|
Bananas     2
Camel   C

Eat a banana, carry one 0.75 miles, drop it, and walk back to the 0.5
+mile mark
Total bananas: 6

0       1       2       3
|---.-:-|-------|-------|
Bananas     2 1
Camel       C

Eat a banana, carry one 0.5 miles and drop it at 1.0, and return to th
+e 0.75 mile mark (with 0.25 bananas left in the stomach)

0       1       2       3
|---.-:-|-------|-------|
Bananas       1 1
Camel         C

0       1       2       3
|---.-:-|-------|-------|
Bananas         2
Camel           C

Eat one banana, carry the other one to the 2 mile mark

Eat the last banana, walk to the 3 mile mark, and hope the location of
+ the oasis on your map is correct
Update: tye beat me to the answer, of course. :-)

In reply to Re^3: 2, 2, 2, 3, 7, 22, 83, ... by bobf
in thread 2, 2, 2, 3, 7, 22, 83, ... by davido

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

• Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
• Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
• Read Where should I post X? if you're not absolutely sure you're posting in the right place.
• Posts may use any of the Perl Monks Approved HTML tags:
a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
• You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
 For: Use: & & < < > > [ [ ] ]
• Link using PerlMonks shortcuts! What shortcuts can I use for linking?

Create A New User
Chatterbox?
 [1nickt]: perl -e 'print 1.0' ... output '1'. [Lady_Aleena]: You could quote it. perl -e 'print "1.0"'>/c> returns 1.0 [Lady_Aleena]: perl -e 'my \$var = "1.0"; print \$var;' if it is in a variable also returns 1.0, though perl -e 'my \$var = 1.0; print \$var;' returns 1. [1nickt]: In my case I can simply pass sprintf '%.1f', 1.0 (to Types::Standard:: Int), but what if you didn;t know the precision of the number you were working with? Seems I must be missing something. Oh well, my test list is complete, mooving on ...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (11)
As of 2017-05-24 18:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
My favorite model of computation is ...

Results (186 votes). Check out past polls.