Numbers
文章平均质量分 70
northwolves
MS-VB-MVP
MS-EXCEL-MVP
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Select n numbers from 1 to m with all of array 'all' and none of array 'none'
How to select n numbers from 1 to m with all of array all and none of array none? Try the following codes,please. Sub getall(ByVal m As Long, ByVal n As Long, ByRef all, ByRef none) Select原创 2009-12-15 22:07:00 · 1619 阅读 · 0 评论 -
How Rich Are You in the World?
HOW RICH ARE YOU? Use the codes below ,you can find where you sit in the richest people list in world. Sub Showhowrichyouare()Getit InputBox("Please enter原创 2008-12-08 20:18:00 · 1715 阅读 · 0 评论 -
动态规划一例
题目(http://topic.youkuaiyun.com/u/20081208/16/672693a2-ce8e-462a-ba07-a70ff2f0c5a2.html?seed=2109433475):有一个蛋糕,被切成了100份,现将这个100份装到12个盘子中,要求每个盘子中的份数不能为0,并且份数中必须还有数字3,不论个位或者十位,例如13份,37份等。 请给出每个盘子中各装多少份的所有答案。原创 2008-12-08 22:45:00 · 2673 阅读 · 0 评论 -
Get the Degree of Angle Between Hour and Minute Hand of a Clock at Anytime
We need to calculate Degree of angle between hour and minute hand Sometimes.So I wrote a function to solve it: Function Hourhandminute(ByVal mytime As Date) As StringDim t As Single, h As原创 2008-12-14 00:21:00 · 1207 阅读 · 0 评论 -
使用动态规划解决有关数字组合的问题
题目:在SHEET2中列出SHEET1表中重量不超过170,体积不超过200的所有组合(http://club.excelhome.net/viewthread.php?tid=382466&page=1#pid2435030) Sheet1 序号重量体积1253022631327324原创 2008-12-20 13:43:00 · 2000 阅读 · 2 评论 -
C++ 实现"1234567"的全排列
原帖地址(http://starlancer.org/~is2004/mini/test/read.cgi/gen/1085476446/)方法1:#include char c[9];int x,j,k;int main(int i){for(i=35280;i--;)if(j=i%7,c[j+1]=j+49,!j){for(x=7,j=720;x-1;j转载 2008-12-24 16:05:00 · 1916 阅读 · 0 评论 -
Get prime numbers nearby a number less than 10^10
For any given number less than 10^10,you can get prime numbers from 10000 numbers nearby it by the following codes: Private Sub Command1_Click()Debug.Print primes10000(987654321)End Sub原创 2008-12-28 20:32:00 · 1251 阅读 · 0 评论 -
Excel 汉字区位互相转换公式
汉字-->区位: =TEXT(INT(CODE(A1)/256-160)*100+MOD(CODE(A1),256)-160,"0000") 区位-->汉字: =CHAR((INT(A1/100)+160)*256+MOD(A1,100)+160)原创 2009-05-22 11:18:00 · 1229 阅读 · 0 评论 -
一道趣味数学题(二)
123456789这九个按顺序排列的数,要求在它们之间插入若干个+,-,*,/ ,使其结果正好等于100如: 1*2*3*4+5+6+7*8+9=100 以下代码在http://blog.youkuaiyun.com/northwolves/archive/2004/07/25/51038.aspx基础上修改而成: Sub main() 开始计算getall 100getall 10原创 2009-11-20 13:23:00 · 10188 阅读 · 22 评论 -
An inequality about sine function
A problem provided by me and solved by mathe in bbs.emath.ac.cn(See: http://zdu.spaces.live.com/blog/cns!C95152CB25EF2037!136.entry) In http://bbs.emath.ac.cn/viewthread.php?tid=49&page转载 2009-11-20 23:54:00 · 910 阅读 · 0 评论 -
一元多项式的幂
Function PowerPolynomial(ByVal f As String, ByVal n As Long) As String If n = 1 Then power = f: Exit Function Dim a() As Long, b, c(), s() As String, max As Long, i As Long, j As Long, k As原创 2010-01-17 14:23:00 · 1389 阅读 · 0 评论 -
Number of sets of natural numbers less than n which sum to n.
The integer sequence was in : A111133 Seems easy. Sub Calc() Dim n As Long, count(), i As Long n = 500 ReDim count(n) count(0) = 1 For i = 1 To n For j = n To原创 2010-01-17 17:07:00 · 1785 阅读 · 0 评论 -
Solutions to place plus or minus signs to a non-zero digits sequence 123456789 so that result of thus described arithmetic opera
Its very easy to solve the problem,but maybe useful for elementary students. Sub getall() Dim s(300) As String, v(300) As Long, result As Long, temp As Long, x(1 To 17) As String, t, op原创 2009-12-06 21:43:00 · 1620 阅读 · 0 评论 -
Nine-digit Fractions
Problem: Suppose integer A,B(A>B) and Double C were satisified A/B=C and all digits(1-9) each used just once in the all 3 numbers(A,B,C) respectively. An example:152463798÷123456789=1.2349原创 2009-02-17 21:31:00 · 1665 阅读 · 0 评论 -
整数三角形题目两则
问题1: 周长不大于n,边长为整数的三角形有多少个?解法: Function p(ByVal n As Long)周长n的三角形的个数If n Mod 2 Then n = n + 3p = Round(n ^ 2 / 48)End FunctionSub Main()Dim i As Long, cFor i = 1 To 10 ^ 6c = c +原创 2010-02-23 23:21:00 · 1791 阅读 · 0 评论 -
Continued Fraction of Squareroot
Continued Fraction can be find in http://mathworld.wolfram.com/ContinuedFraction.html Function ContinuedFraction(ByVal n As Long)Dim root As Long, p As Long, q As Long, b() As String, temp As Lo原创 2010-02-25 22:42:00 · 1506 阅读 · 1 评论 -
Fundamental Solution to Pell's Equation
From Wikipedia,Pells equationis any Diophantine equation of the formwhere n is a nonsquare integer and x and y are integers. We can calculate the x,y for certain n with the followi原创 2010-01-03 13:19:00 · 1919 阅读 · 1 评论 -
Two math problems in http://projecteureka.org sumitted by me.
http://projecteureka.org/problem/question/814 Problem 814 - Tringles whose perimeter are 12345 Count different Tringles whose all 3 side lengths are integers and perimeter are 12345.Solut原创 2010-01-03 13:57:00 · 1219 阅读 · 0 评论 -
An UDF to calculate weekday
It seems feasible . Function myweekday(ByVal y As Long, ByVal m As Long, ByVal d As Long) As Long Dim bias As Long If m > 2 Then bias = m - 2 Else bias = 10 + m原创 2010-01-09 23:50:00 · 1343 阅读 · 0 评论 -
ProjectEuler 125
http://projecteuler.net/index.php?section=problems&id=125 Problem 12504 August 2006 The palindromic number 595 is interesting because it can be written as the sum of consecutive squares原创 2010-04-30 16:07:00 · 2165 阅读 · 0 评论 -
Get Integer sided triangles for which the area/perimeter ratio is integral
Problem: Consider the triangle with sides 6, 8 and 10. It can be seen that the perimeter and the area are both equal to 24. So the area/perimeter ratio is equal to 1. Consider also the原创 2010-05-04 23:19:00 · 1958 阅读 · 0 评论 -
如何计算数据组合在全排序组合中的行值
VBA计算数据组合在全排序组合中的行值原创 2010-07-06 21:12:00 · 3243 阅读 · 2 评论 -
分解质因数
分解质因数原创 2010-07-06 22:07:00 · 2812 阅读 · 2 评论 -
How to arrange 10 digits so that the product of the some of them is equal to a number represented by the remaining digits
10 digits equations原创 2010-06-17 21:52:00 · 1619 阅读 · 0 评论 -
UDF to show the expression of cell formula.
UDF to show the expression of cell formula原创 2010-12-24 13:49:00 · 2678 阅读 · 0 评论 -
The four number game
The Four Numbers Game is a mathematical game, as taught by Dr. Paul Sally, Prof. of Mathematics at the University of Chicago. To play this game, draw a square and put a number at each corner, thus: 5_原创 2008-11-24 20:27:00 · 991 阅读 · 0 评论 -
Google Treasure Hunt 2008--Robot Problem
QuestionA robot is located at the top-left corner of a 65 x 45 grid (marked Start in the diagram below).The robot can only move either down or right at any point in time. The robot is tryin原创 2009-01-01 12:46:00 · 1166 阅读 · 0 评论 -
A Square Perfect Square
原创 2009-01-02 00:00:00 · 931 阅读 · 0 评论 -
递归实现数字的组合(C++)
递归实现数字的组合 #include void Combin(int m,int n,int a){ if(m == n){ if(a>0)printf("%d",a); while(n > 0) printf("%d",n--); printf("/n"); return;原创 2008-11-10 23:47:00 · 2059 阅读 · 1 评论 -
Google Treasure Hunt 2008---Find the Smallest Prime Number
Question: Find the smallest number that can be expressed as the sum of 3 consecutive prime numbers, the sum of 11 consecutive prime numbers, the sum of 25 consecutive prime numbers, the sum of 171 con原创 2009-01-03 12:27:00 · 1119 阅读 · 0 评论 -
The Number of Triangles Formed by Intersecting Diagonals of a Regular Polygon
Reproduced from http://www.cs.uwaterloo.ca/journals/JIS/sommars/newtriangle.html Journal of Integer Sequences, Vol. 1 (1998), Article 98.1.5The Number of Triangles Fo转载 2009-01-09 19:02:00 · 9784 阅读 · 0 评论 -
Largest Ten Digit Powers
The idea was Inspirated from the following link: Homogeneous Square Numbers (Provided by mathe, http://bbs.emath.ac.cn/thread-78-1-1.html) Look at the 10-digit number 9876543210,its the large原创 2009-01-11 15:39:00 · 2166 阅读 · 0 评论 -
nth prime number contain n as their substring within 100000000
A small VBA code to get these numbers: Sub Main() Dim i&, j&, k&, n&, num&, a(100000000) As Byte, p(1 To 10000000) As Long num = 1 p(num) = 2 The 1st prime n = 10原创 2009-01-11 21:27:00 · 1067 阅读 · 0 评论 -
Smallest Ten Digit Powers
This is a companion piece of Largest Ten Digit Powers . The codes are almostly same,with a few changes only. Function befit(ByVal s As String, ByVal num As Long) As Boolean tell if a string原创 2009-01-11 22:41:00 · 1404 阅读 · 0 评论 -
Ten Digit Powers
With helps of many friends, the Ten Digit Powers sequence has been updated to n=128. More details,see Ten digit numbers Millions thanks to 无心人,mathe and gxqcn. The sequence was showed as原创 2009-01-13 21:45:00 · 1130 阅读 · 0 评论 -
Multi select elements which sums upto a certain number from an array
Give an array and a certain number,how to select some of the elements to sums upto the number?The following codes can bring you one or more solutions out:Sub Solve(ByVal Total As Double, B原创 2008-11-25 19:37:00 · 1926 阅读 · 0 评论 -
Which Numbers are the Sum of Two Squares?
The main goal of todays lecture is to prove the following theorem. Theorem 1.1 A number is a sum of two squares if and only if all prime factors of of the form have even exponent in the prim转载 2008-11-24 19:50:00 · 1376 阅读 · 0 评论 -
About Google Treasure Hunt 2008
今天比较高兴,一口气做完了四道题目。看来VB6 仍有用武之地,尽管速度着实令人失望。 Thank you for entering the Treasure Hunt! Here are the first correct entries we received for the email address northwolves@gmail.com: Questi原创 2008-12-30 15:37:00 · 1066 阅读 · 0 评论 -
随机排列n*n方阵
将n组1-n随机置于n*n的单元格中,使得每行,每列都是1-n的一个全排列 Sub Perm()Dim n As Long, i As Long, j As Long, arr(), brr(), t As Longn = 20ReDim arr(n - 1, n - 1)ReDim brr(n - 1)For i = 0 To n ^ 2 - 1arr(i原创 2008-11-25 21:51:00 · 5359 阅读 · 2 评论 -
一道趣味算术题
题目地址:http://club.excelhome.net/thread-175411-1-1.html 先看几个数:312132,231213,41312432,23421314 可以看到以上字串有以下特点: 2个1 之间有1个数,2个2 之间有2个数,2个3之间有3个数... 试找出由(1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,原创 2008-11-26 10:31:00 · 32149 阅读 · 41 评论
分享