Post Reply 
2023 in Base 37
01-06-2023, 12:21 PM (This post was last modified: 01-06-2023 12:22 PM by Joe Horn.)
Post: #1
2023 in Base 37
New Year's trivia: 2023 in base 10 equals 1HP in base 37. Posted in the "Not Remotely" forum because no member here has only 1HP. Big Grin

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
01-06-2023, 12:58 PM (This post was last modified: 01-06-2023 07:52 PM by pier4r.)
Post: #2
RE: 2023 in Base 37
Nice bit of trivia!

An extension would be: find the decimal numbers (and the transforming base) in which one can write HP35, HP71, HP50G and so on. I believe the base 37 would suffice in most cases.

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
01-06-2023, 01:05 PM
Post: #3
RE: 2023 in Base 37
Hello!

(01-06-2023 12:21 PM)Joe Horn Wrote:  Posted in the "Not Remotely" forum because no member here has only 1HP.

Well, until not so long ago I had my own horse, so really 1HP ;-) (Now I am sharing one so I am down to 1/2HP, not sure how to translate that to Base 37)...

Regards
Max
Find all posts by this user
Quote this message in a reply
01-06-2023, 06:34 PM
Post: #4
RE: 2023 in Base 37
(01-06-2023 12:58 PM)pier4r Wrote:  Nice bit of trivia!

An extension would be: find the decimal numbers (and the transforming base) in which one can write HP35, HP71, HP50G and so on. I Believe the base 37 would suffice in most cases.

Actually base 36 is sufficient to encode the digits 0..9 and the letters A..Z, base 37 just happened to work for Joe's amusing example. Web sites often use base 64 to encode data in URL's in the form of alphanumeric strings.
Find all posts by this user
Quote this message in a reply
01-06-2023, 07:58 PM (This post was last modified: 01-06-2023 07:59 PM by pier4r.)
Post: #5
RE: 2023 in Base 37
True! As usual I left my brain off instead of thinking for a moment that 10+26 would cover all the needed letters.

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
01-06-2023, 08:07 PM (This post was last modified: 01-06-2023 08:08 PM by toml_12953.)
Post: #6
RE: 2023 in Base 37
(01-06-2023 01:05 PM)Maximilian Hohmann Wrote:  Hello!

(01-06-2023 12:21 PM)Joe Horn Wrote:  Posted in the "Not Remotely" forum because no member here has only 1HP.

Well, until not so long ago I had my own horse, so really 1HP ;-) (Now I am sharing one so I am down to 1/2HP, not sure how to translate that to Base 37)...

Regards
Max

But even a real horse has up to about 14-15 HP, so we owners are allowed to have more!

How much horsepower does a horse have?

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
01-06-2023, 08:25 PM
Post: #7
RE: 2023 in Base 37
Just for fun, here are two programs for converting integers to and from strings representing the integers in any base up to base 62. The programs are for the HP49/50 with the ListExt Library.
In the strings:

The numbers 0..9 map to themselves
The numbers 10..35 map to A..Z
The numbers 36..61 map to a..z

The first program I→STR take an integer n on level 2 and an integer b on level 1 and returns a string representing n in base b.

Code:

\<< I\->BL NL\->S
    { 36. 61. 61. } CHR+
    { 10. 35. 55. } CHR+
    { 0. 9. 48. } CHR+
\>>

The next program STR→I does the inverse, taking a string on level 2 and b on level 1.

Code:

\<< SWAP
    { 48. 57. -48. } CHR+
    { 65. 90. -55. } CHR+
    { 97. 122. -61. } CHR+
    S\->NL SWAP BL\->I
\>>

For example, the input

257175174
62
I→STR

returns "HP50g"
Find all posts by this user
Quote this message in a reply
01-07-2023, 04:06 AM
Post: #8
RE: 2023 in Base 37
This programme

https://www.hpmuseum.org/forum/thread-40...light=XdYB

for input

2023
2
37

returns

:37: { 27 12 "." "°" 18 }
Find all posts by this user
Quote this message in a reply
01-07-2023, 06:23 AM (This post was last modified: 01-07-2023 06:24 AM by brouhaha.)
Post: #9
RE: 2023 in Base 37
(01-06-2023 12:21 PM)Joe Horn Wrote:  New Year's trivia: 2023 in base 10 equals 1HP in base 37. Posted in the "Not Remotely" forum because no member here has only 1HP. Big Grin

Someone recently pointed out to me that 2023 isn't prime. I already knew that, but I had hoped that it would be choice, or at least select.

Looking forward to 2027 and 2029.
Find all posts by this user
Quote this message in a reply
01-07-2023, 11:17 AM (This post was last modified: 01-07-2023 11:35 AM by C.Ret.)
Post: #10
RE: 2023 in Base 37 for the 28's users
Hello every one,


(01-06-2023 08:25 PM)John Keith Wrote:  In the strings:
The numbers 0..9 map to themselves
The numbers 10..35 map to A..Z
The numbers 36..61 map to a..z[/code]

Thanks for the clarification, I was wondering what to put in the conversion table after the 36th symbol, aka the Big Z character.


For the one who only have \(102474081_{37}\) (and only one):

First store the character conversion table as a string into the 'CC' variable:

"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" 'CC' STO

Note how easy is this entry to key-in since all these characters are ordered on the two keyboards and didn't need any shift-key, except for one press on the lc key to switch into lower-case entry mode.

Second enter one or both of the conversion code depending in which direction you need to convert. Both code take two arguments from the stack and return one result

« → b « "" OVER LOG b LOG / FLOOR 0 FOR k
         SWAP b k ^ MOD LAST / IP ROT CC ROT 1 + DUP SUB +
       -1 STEP 
       SWAP DROP » »                                   ‘→BSTR’ STO

n b →BSTR convert decimal-based integer n into b-base string Str.
For example, 2023 37 →BSTR display "1HP"


« → s b « 0 
        1 s SIZE FOR k 
                b * CC s k k SUB POS 1 - 
                IF DUP 0 < OVER b ≥ OR 
                   THEN "’" s k k SUB + "’ Bad Char" + KILL 
                   ELSE + END 
        NEXT » »                                     ‘BSTR→’ STO

Str b BSTR→ convert b-based character string Str into real integer n (or display error message when an illegal character is found anywhere in the string Str).
For example, "HP50g" 62 BSTR→ return 257175174.

Have had a lot of fun thanks !


Since it is the season, I wish you all \(77490_{50}\) \(81179749_{51}\) \( 80140568_{52}\) \(2G7_{28}\) !
Find all posts by this user
Quote this message in a reply
01-07-2023, 11:39 AM
Post: #11
RE: 2023 in Base 37
(01-07-2023 11:17 AM)C.Ret Wrote:  Since it is the season, I wish you all \(77490_{50}\) \(81179749_{51}\) \( 80140568_{52}\) \(2G7_{28}\) !

Yes that is a better variant of what I had in mind, finding the equivalent value for words. Also this reminds me that mathjax is active here, I totally forgot.

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
01-07-2023, 09:59 PM (This post was last modified: 01-08-2023 01:34 AM by mfleming.)
Post: #12
RE: 2023 in Base 37
Another approach, using Albert's base conversion function and indexing, we could have

Code:

      base←⊥⍣¯1
      digits←'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'

      37 base 2023
1 17 25
      digits[1+37 base 2023]
1HP

Extending the range of digits and encapsulating the operation as a function gives

Code:

      +digits←digits,'abcdefghijklmnopqrstuvwxyz'
0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
      digits[1+62 base 257175174]
HP50g

      tochar←{digits[1+⍺ base ⍵]}
      37 tochar 2023
1HP
      62 tochar 257175174
HP50g

Now just need the reverse conversion to see a season's greeting!

~Mark

[edit] Oops! Function base corrected per Albert Smile [/edit]

Remember kids, "In a democracy, you get the government you deserve."
Find all posts by this user
Quote this message in a reply
01-20-2023, 07:41 PM
Post: #13
RE: 2023 in Base 37
Inspired by a new sequence A359840 I noticed that while 2023 is not prime in base 10, it is prime in many (perhaps infinitely many?) other bases. A quick check counted 819 bases < 10,000 in which 2023 is prime.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 3 Guest(s)