Euler problem 12.2

primes :: [Integer]
primes = 2 : filter (null . tail . primeFactors) [3, 5 ..]

primeFactors :: Integer -> [Integer]
primeFactors n = factor n primes
    factor n (p : ps)
      | p * p > n = [n]
      | n `mod` p == 0 = p : factor (n `div` p) (p : ps)
      | otherwise = factor n ps

groupFactors :: [Integer] -> [[Integer]]
groupFactors = gf []
    gf acc lst
      | null lst = reverse acc
      | null acc = gf [[p,1]] ps
      | p == head (head acc) =
        gf ([p, head (tail (head acc)) + 1]:tail acc) ps
      | otherwise = gf ([p,1]:acc) ps
        p = head lst
        ps = tail lst
nDiv :: Integer -> Integer
nDiv n = product (map ((1+) . head . tail)
                  (groupFactors (primeFactors n)))

fm :: Integer -> Integer -> Integer
fm m n
  | triDiv n > m = n*(n+1) `div` 2
  | otherwise = fm m (n+1)
    triDiv n
      | even n = nDiv (n `div` 2)*nDiv (n+1)
      | otherwise = nDiv n*nDiv ((n+1) `div` 2)

λ> :set +s
λ> fm 500 1
(0.20 secs, 199,313,728 bytes)

— Me@2023-05-04 09:51:19 AM



2023.05.04 Thursday (c) All rights reserved by ACHK

Powermaster Optimus Prime


Diary: [W]hen I teach taught [E]rg maths, I have had new 
ideas[. B]ut I have no new ideas in research now. 


Yesterday, I went to Shatin [T]oys[R][U]s to buy a 
[robot] model for brother. But finally, I saw a 
[PowerMaster] Opimus [P]rime which I wanted to buy when 
I was small. 

Consider [whether to buy or not] for several some 
moment. [And then bought it.]


At home, we discovered that the small person-robot had 
been stolen. 

[So s]uddenly, I gave up my happiness. 

Luckily, after playing the robot with brother, instead 
of blaming me for not buying a model for him to 
construct, he loved the robot. I was very happy too as 
I discussed "the Transformers generation one" with him. 



2023.01.03 Tuesday (c) All rights reserved by ACHK

Constructicons, 2

For a combiner transformer, whose mind (of the component robots) is it?

~ Whose mind is a group of people, such as a company?

Not a fixed one, depending on what the consensus of that group (at that time) is, who the speaker (at that time) is, etc.


In reverse, one person is also a multi-mind.

— Me@2016-06-16 09:07:46 PM



2022.03.03 Thursday (c) All rights reserved by ACHK

Fall of Cybertron

Transformers: Fall of Cybertron is a third-person shooter video game based on the Transformers franchise, developed by High Moon Studios and published by Activision. It is the sequel to the 2010 video game Transformers: War for Cybertron, and directly follows the events of that game, as the Autobots struggle to defeat their Decepticon foes in a civil war for their home planet of Cybertron.

The game tells the story of the Transformers, fictional robotic life forms, and the final days of conflict on their home planet of Cybertron. An origins subplot for the Dinobots is also told, reimagined from the Transformers: Generation 1 continuity. Other subplots also tell an adapted story for several characters. Some of the voice cast from the 1984 series The Transformers return to reprise their roles, including Peter Cullen as Autobot leader Optimus Prime and Gregg Berger as Grimlock. Other actors return to reprise their roles from Transformers: War for Cybertron.

— Wikipedia on Transformers: Fall of Cybertron



2022.01.12 Wednesday ACHK


~ 1988 – 1990

The Transformers of this size were sold 37 HKD each at the Watsons near my home. That was much more expensive than an ordinary size one, which costed only around 25 HKD.

One time, mom brought me to ToyRUs. I found that the Transformers there were much cheaper. This one costed only about 29 HKD.

I did not mind buying a Decepticon.

A much more beautiful one was released last year.

— Me@2021-02-25 12:38:38 PM



2021.02.25 Thursday (c) All rights reserved by ACHK

Transformers: War for Cybertron

Transformers: War for Cybertron is a third-person shooter video game developed by High Moon Studios and published by Activision.

The game takes place on the planet Cybertron, prior to the Transformers arrival on Earth. The Autobots and Decepticons are engaged in a civil war. The game can be played starting from either faction’s perspective, but begins chronologically with the Decepticon campaign. The game revolves around the use of a substance known as Dark Energon, which the Decepticon leader Megatron believes will allow him to return the planet to what he refers to as a golden age.

— Wikipedia on Transformers: War for Cybertron

2012.05.18 Friday ACHK



The team’s combined form of Devastator is brutality in its purest form — his sole purpose is to destroy anything and everything that gets in his way. It is ironic that the suitably intelligent Constructicons should sacrifice their thinking ability in their combined form, but simple-mindedness is a common limitation of the assorted other first-generation combining Transformers, because Devastator’s thoughts and actions are limited to what his six components can agree upon at any given time. Consequently, Devastator seems like a being of instinct, lashing out at everything around him before contemplating the consequences, but he is also slow and lumbering and very easy to trip up.

— Wikipedia on Constructicons

2012.04.12 Thursday ACHK

Headmaster (Transformers)


When connected with each other, the human or Nebulan and the Transformer essentially share a single mind and can work together seamlessly, but when separated from each other, both retain their individual minds and bodies. This allows for greater cooperation, and with twice the experience, a better understanding of possible combat or other dangerous situations. The binary-bonding process does not damage the body of either party, and both parties are able to carry on with their normal lives, but it does generate a permanent, irreversible bond between their minds. However, the Headmaster component can find themselves with increased strength.

The process does have a few weaknesses. Some partnerships on both sides suffer from issues partners have with one another. For example, Vorath is a scientist while his Decepticon partner, Mindwipe is a believer in the supernatural, leading the two to bicker over conflicting ideologies. Also, headless Transformers can be stuck in vehicle mode when the Headmaster component is separated.

— Wikipedia on Headmaster (Transformers)

— 2011.06.30

2012.04.10 Tuesday ACHK

Transformers: The Headmasters


但是, 今次沒有”頭領戰士”.






那一輯卡通名叫 Transformers: The Headmasters.


langle langle 變形金剛

頭領戰士rangle rangle.



我猜想, 大陸可能會譯作

langle langle 變壓器

校長rangle rangle.



— Me




2009.07.05 Sunday copyright ACHK



今早看langle langle變形金剛二rangle rangle.


電腦畫師們, 果然做足功課.


牠們也是我年青時候, 變形金剛卡通的主要元素.



有合體機械人: 七隻”建造派”的機械人, 合體成”破壞者”.

有昆蟲機械人. 無數隻細昆蟲可以合體成一隻大昆蟲.


有雙生兒機械人: 兩隻可以合體成一輛雪糕車.




故事是類似卡通片的劇情, 沒有任何深度.

不過,  故事線順暢完整.

期待第三集. 不過, 要等到2012.

那時, 我已經是一個老人.


— Me




2009.07.04 Saturday copyright ACHK

Three Laws of Robotics


1. A robot may not injure a human being or, through inaction, allow a human being to come to harm.

2. A robot must obey orders given to it by human beings, except where such orders would conflict with the First Law.

3. A robot must protect its own existence as long as such protection does not conflict with the First or Second Law.


— Isaac Asimov




2008.11.25 Tuesday CHK_2