Bonkers Tetration

Find the sum of all positive integers n n less than 100 satisfying the congruence

2 3 4 n m o d ( n + 1 ) = 1 . \Large 2^{3^{4^{\cdot^{\cdot^{\cdot^ n} }}}} \bmod {(n+1)} = 1 \; .


The answer is 1473.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

We want the sum of all odd integers n n in the interval [ 2 , 100 ] [2,100] such that ϕ ( n ) \phi(n) is divisible by 3.

1
2
3
4
5
6
7
8
totient :: Int -> Int
totient 1 = 1
totient a = length $ [ b | b <- [1..a-1], gcd a b == 1]

answer :: Int
answer = sum $ [n | n <- [2..100], odd n, (totient n) `mod` 3 == 0]

main = print answer

n n should be even.

Abdelhamid Saadi - 4 years, 4 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...