Publications by R on Guangchuang Yu

project euler – Problem 32

08.11.2011

We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once; for example, the 5-digit number, 15234, is 1 through 5 pandigital. The product 7254 is unusual, as the identity, 39 × 186 = 7254, containing multiplicand, multiplier, and product is 1 through 9 pandigital. Find the sum of all products whose...

717 sym R (1101 sym/4 pcs) 1 tbl

project euler – Problem 44

08.11.2011

Pentagonal numbers are generated by the formula, Pn=n(3n−1)/2. The first ten pentagonal numbers are: 1, 5, 12, 22, 35, 51, 70, 92, 117, 145, ... It can be seen that P4 + P7 = 22 + 70 = 92 = P8. However, their difference, 70 − 22 = 48, is not pentagonal. Find the pair of pentagonal numbers, Pj and Pk, for which their sum and difference is p...

817 sym R (988 sym/2 pcs)

project euler – problem 47

08.11.2011

The first two consecutive numbers to have two distinct prime factors are: 14 = 2 × 7 15 = 3 × 5 The first three consecutive numbers to have three distinct prime factors are: 644 = 2² × 7 × 23 645 = 3 × 5 × 43 646 = 2 × 17 × 19. Find the first four consecutive integers to have four distinct primes factors. What is the first of these n...

845 sym R (1129 sym/2 pcs)

project euler – problem 49

08.11.2011

The arithmetic sequence, 1487, 4817, 8147, in which each of the terms increases by 3330, is unusual in two ways: (i) each of the three terms are prime, and, (ii) each of the 4-digit numbers are permutations of one another. There are no arithmetic sequences made up of three 1-, 2-, or 3-digit primes, exhibiting this property, but there is one oth...

662 sym R (1479 sym/4 pcs) 1 tbl

ML-Class Ex 7 – kMeans clustering

24.12.2011

The K-means algorithm is a method to automatically cluster similar data examples together. The intuition behind K-means is an iterative procedure that starts by guessing the initial centroids, and then refines this guess by repeatedly assigning examples to their closest centroids and then recomputing the centroids based on the assignments. This a...

1311 sym R (1998 sym/4 pcs) 2 img 2 tbl

draw chinese character Jiong using ggplot2

17.02.2012

The Chinese character Jiong (囧) is now widely used for expressing ideas or feelings such as annoyance, shock, embarrassment, awkwardness, scorn. The function plot of y=1/(x^2-1) looks very similar of this symbol. I use ggplot2 to draw the symbol of Jiong. It looks like: The function line is very easy to draw, but the options to hone this graph...

1153 sym 2 img

clusterProfiler: an R Package for Comparing Biological Themes Among Gene Clusters

06.05.2012

Increasing quantitative data generated from transcriptomics and proteomics require integrative strategies for analysis. Here, we present an R package, clusterProfiler that automates the process of biological-term classification and the enrichment analysis of gene clusters. The analysis module and visualization module were combined into a reusable...

1722 sym

project-euler–problem 65

16.09.2012

The square root of 2 can be written as an infinite continued fraction. \( \sqrt{2} = 1+\frac{1}{2+\frac{1}{2+\frac{1}{2+\frac{1}{2+?}}}} \) The infinite continued fraction can be written, √2 = [1;(2)], (2) indicates that 2 repeats ad infinitum. In a similar way, √23 = [4;(1,3,1,8)]. It turns out that the sequence of partial values of contin...

1852 sym R (743 sym/2 pcs) 1 tbl

project euler: problem 61

22.11.2012

Triangle, square, pentagonal, hexagonal, heptagonal, and octagonal numbers are all figurate (polygonal) numbers and are generated by the following formulae: Triangle P3,n=n(n+1)/2 1, 3, 6, 10, 15, ... Square P4,n=n2 1, 4, 9, 16, 25, ... Pentagonal P5,n=n(3n−1)/2 1, 5, 12, 22, 35, ... Hexagonal ...

1315 sym R (3987 sym/4 pcs) 1 tbl

project euler: problem 62

03.12.2012

The cube, 41063625 (3453), can be permuted to produce two other cubes: 56623104 (3843) and 66430125 (4053). In fact, 41063625 is the smallest cube which has exactly three permutations of its digits which are also cube.Find the smallest cube for which exactly five permutations of its digits are cube. — I tried to generate all the cubic number w...

1120 sym R (982 sym/3 pcs) 1 tbl