
×InformationFix Windows 10 Update Issues
Resolve Windows 10 related issues for your HP computers or printers by HP Windows 10 Support Center

×InformationFix Windows 10 Update Issues
Resolve Windows 10 related issues for your HP computers or printers by HP Windows 10 Support Center
 HP Community
 >
 Other Products
 >
 Calculators
 >
 [HP Prime] Sequence App: end condition, maximum (at index?),...
 Mark Topic as New
 Mark Topic as Read
 Float this Topic for Current User
 Bookmark
 Subscribe
 Mute
 Printer Friendly Page
Create an account on the HP Community to personalize your profile and ask a question
Solved!
[HP Prime] Sequence App: end condition, maximum (at index?), path length?
02052018 08:43 AM
Do you guys know the Collatz Conjecture, sometimes known as the Ulam numbers or (thanks to Brian Hayes) the hailstone numbers?
It‘s an easily sted problem but mathematics doesn‘t seem to be ready for such kinds of problems (I think it was Paul Erdös who said that). It‘s still unsolved, however.
Take a start number n. If it‘s odd, the next number shall be 3*n+1. If it‘s even the next number shall be n/2.
We stop when we reach 1, because otherwise we‘re in an endless loop, 4>2>1>4>2>1>...
Nobody knows whether any start number reaches 1. It seems so because mathematicians have tested a HUGE amount of start numbers. But it‘s not proven.
I love to play with this and write programs and scribble on (huge) paper regarding this problem.
Very cool: the HP Prime‘s Sequence App can be used to explore this sequence!
Just define U1(1) as your start number (try 27! ;)), leave U1(2) empty.
Define U1(N) as a piecewise defined function:
Now you can play with your plot settings. Try N Rng and X Rng 0..112, Y Rng 0..9232
However, I was wondering:
 How can I let the Prime determine the maximum value that occured in the sequence before it hit 1?
 And at what position (index) was that?
 And how long was the path from the start number until we reached the 1?
Solved! Go to Solution.
02072018 12:08 PM
Hello Stefan,
A nice thing is that we can also get the elements of our sequence in Home view.
Let us take as an example that U1(1)=10023.
When we enter in Home view: U1(4), we get 45106, which is the 4th element of the sequence.
Now we can also put these elements into a list.
We can dispose of many list commands via the menu: ToolboxMathList.
We put the first 1000 elements into L1 by:
L1:=MAKELIST(U1(N),N,1,1000)
We can find the position of 1 by:
POS(L1,1) which returns: 66
If we want we can now shorten the list a little by:
L2:=SUB(L1,1,66)
Now we sort the list:
L3:=SORT(L2)
and take its last element, which is its maximum:
L3(66) returns 76120
We get the position of the maximum in our original list by:
POS(L1,76120) which gives: 11.
Didn't find what you were looking for? Ask the community