This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Foo { | |
n : int | |
} | |
struct Bar<'a> { | |
n : int, | |
other : Option<&'a mut Foo> | |
} | |
impl<'a> Bar<'a> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "", | |
"signature": "sha256:7e2b0b3f559153fa30133c48b47ee3b799879a07364ebb6c8e27998d3344c6a0" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[warn(non_camel_case_types)]; | |
/* | |
Euler Challenge #70 | |
Euler's Totient function, φ(n) [sometimes called the phi function], is used to determine the number of positive numbers less than or equal to n which are relatively prime to n. For example, as 1, 2, 4, 5, 7, and 8, are all less than nine and relatively prime to nine, φ(9)=6. | |
The number 1 is considered to be relatively prime to every positive number, so φ(1)=1. | |
Interestingly, φ(87109)=79180, and it can be seen that 87109 is a permutation of 79180. |
NewerOlder