Problem 29 Distinct powers

2016-10-11 09:50:00

Consider all integer combinations of \(a^b\) for \(2 ≤ a ≤ 5\) and \(2 ≤ b ≤ 5\):

\[2^2=4, 2^3=8, 2^4=16, 2^5=32\] \[3^2=9, 3^3=27, 3^4=81, 3^5=243\] \[4^2=16, 4^3=64, 4^4=256, 4^5=1024\] \[5^2=25, 5^3=125, 5^4=625, 5^5=3125\]

If they are then placed in numerical order, with any repeats removed, we get the following sequence of 15 distinct terms:

4, 8, 9, 16, 25, 27, 32, 64, 81, 125, 243, 256, 625, 1024, 3125

How many distinct terms are in the sequence generated by \(a^b\) for \(2 ≤ a ≤ 100\) and \(2 ≤ b ≤ 100\)?

Problem 27 Quadratic primes

2016-10-10 12:05:00

Euler discovered the remarkable quadratic formula:

\[n^2 + n + 41\]

It turns out that the formula will produce 40 primes for the consecutive integer values \(0 \le n \le 39\). However, when \(n = 40, 40^2 + 40 + 41 = 40(40 + 1) + 41\) is divisible by 41, and certainly when \(n = 41, 41^2 + 41 + 41\) is clearly divisible by 41.

The incredible formula \(n^2 - 79n + 1601\) was discovered, which produces 80 primes for the consecutive values \(0 \le n \le 79\). The product of the coefficients, −79 and 1601, is −126479.

Considering quadratics of the form:

\(n^2 + an + b\), where \(|a|< 1000\) and \(|b|\le1000\)

where \(|n|\) is the modulus/absolute value of \(n\)

e.g. \(|11| = 11\) and \(|−4| = 4\)

Find the product of the coefficients, \(a\) and \(b\), for the quadratic expression that produces the maximum number of primes for consecutive values of \(n\), starting with \(n = 0\).

再见sae

2016-09-18 09:21:00

8月的时候其实sae已经欠费停应用了,已经开始大规模迁移github.io了

但是其实到现在还有那么若干篇关于FR的还没弄过来

还有一些python小应用什么的没有弄过来

至少这种一天48云豆的实在接受不能,算下来还没有在AWS上面搭个instance合算(阿里云不知道,没用过)

后来发现其实我也就是弄弄小前端,根本不需要嘛

实质性的改变就是,我的兴趣直接从python+django转移到了js和相关的各种jquery, typescript, react上了

Minecraft is coming to China

2016-05-23 10:21:31

之前在群里就听到小伙伴说网易要代理Minecraft。

小伙伴是丢了一mc.163.com,评论道,还有若干看上去很逗逼的宣传视频,然后没有了,有了,了。。。

官方声明

搜了一堆资料,不太明白网易以什么形式代理,不过知乎上面已经各种讨论了,如何看待网易代理 Minecraft ?

我得到的信息好像是这样:

  1. 好像和java版本没关系……
  2. 好像和已经买的正版账号没关系……
  3. 会有中国定制版本,按照视频的特点,说不定会有中国功夫(<–这个是我的脑洞)
  4. 没玩过网易代理的魔兽,所以不太理解买断的涵义
  5. 各种懵逼……

我的世界

2016-03-31 23:10:31

最近迷恋上了Minecraft这款游戏。

其实知乎介绍了很久了,但是一直没尝试。

一开始也就是很无耻地在安卓上玩盗版,但是玩着玩着就是在忍不住买了个PC正版的帐号。

下面的安装都没测试,都是靠记忆,要是出问题我不负责

我只是因为AWS免费套餐到期,把里面的配置文件拉出来备份下

sudo apt-get install nginx
sudo apt-get install python-dev
sudo apt-get install uwsgi
sudo apt-get install uwsgi-plugin-python

uwsgi 测试

uwsgi --http-socket :9090 --plugin python --wsgi-file XXXX.py --process 3

各种配置文件链接

ln -s /home/XX/XX/XX/uwsgi.ini /etc/uwsgi/apps-enabled/

nginx同理

nginx配置

server {
    listen      80;
    server_name xx.xx.xx.xx;
    access_log  /home/ubuntu/nginx_conf/log/access.log;
    error_log   /home/ubuntu/nginx_conf/log/error.log;

    location /static {
        alias /home/xx/xx/xx/project/static;
    }

    location /test { #test去掉就是根目录
        include uwsgi_params;
        uwsgi_pass 127.0.0.1:9090;
        uwsgi_param UWSGI_SCRIPT django_wsgi;
        uwsgi_param SCRIPT_NAME /test;# test..
        uwsgi_modifier1 30;
        proxy_read_timeout 300;
        proxy_connect_timeout 300;
        proxy_redirect off;
    }
}

uwsgi配置

[uwsgi]
chdir           = /home/xx/project
module          = projectname.wsgi:application
master          = true
socket          = 127.0.0.1:9090
plugin          = python
process         = 4
chmod-socket    = 666
buffer-size     = 49152
threads         = 2
max-requests    = 6000
vacuum          = true
daemonize       = /home/xx/xx/xx/uwsgi.log

在玩了几天过后,一些在刚开始两天从市场带回来的小龙都长大了,有些出落得愈发标致/帅气,有些就有点……

硝基