
Numbers
文章平均质量分 70
northwolves
MS-VB-MVP
MS-EXCEL-MVP
展开
-
UDF to show the expression of cell formula.
UDF to show the expression of cell formula原创 2010-12-24 13:49:00 · 2551 阅读 · 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 · 1597 阅读 · 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 · 1296 阅读 · 0 评论 -
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 · 848 阅读 · 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 · 9896 阅读 · 22 评论 -
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 · 1109 阅读 · 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 · 1160 阅读 · 0 评论 -
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 · 1790 阅读 · 0 评论 -
使用动态规划解决有关数字组合的问题
题目:在SHEET2中列出SHEET1表中重量不超过170,体积不超过200的所有组合(http://club.excelhome.net/viewthread.php?tid=382466&page=1#pid2435030) Sheet1 序号重量体积1253022631327324原创 2008-12-20 13:43:00 · 1876 阅读 · 2 评论 -
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 · 1134 阅读 · 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 · 2579 阅读 · 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 · 1528 阅读 · 0 评论 -
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 · 1566 阅读 · 0 评论 -
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 · 1499 阅读 · 0 评论 -
分解质因数
分解质因数原创 2010-07-06 22:07:00 · 2669 阅读 · 2 评论 -
如何计算数据组合在全排序组合中的行值
VBA计算数据组合在全排序组合中的行值原创 2010-07-06 21:12:00 · 3112 阅读 · 2 评论 -
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 · 1830 阅读 · 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 · 2039 阅读 · 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 · 1266 阅读 · 0 评论 -
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 · 1138 阅读 · 0 评论 -
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 · 1794 阅读 · 1 评论 -
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 · 1409 阅读 · 1 评论 -
整数三角形题目两则
问题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 · 1718 阅读 · 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 · 1635 阅读 · 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 · 1573 阅读 · 0 评论 -
Erf
ERF 返回误差函数在上下限之间的积分。如果该函数不可用,并返回错误值 #NAME?,请安装并加载“分析工具库”加载宏。 在“工具”菜单上,单击“加载宏”。 在“可用加载宏”列表中,选中“分析工具库”框,再单击“确定”。 如果必要,请遵循安装程序中的指示。 语法ERF(lower_limit,up原创 2008-12-08 14:27:00 · 1466 阅读 · 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 · 1808 阅读 · 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 · 1062 阅读 · 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 · 1298 阅读 · 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 · 1017 阅读 · 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 · 2005 阅读 · 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 · 9384 阅读 · 0 评论 -
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 · 1065 阅读 · 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 · 1959 阅读 · 1 评论 -
A Square Perfect Square
原创 2009-01-02 00:00:00 · 876 阅读 · 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 · 1046 阅读 · 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 · 1197 阅读 · 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 · 852 阅读 · 0 评论 -
Nine Digits Expression
Problem: Insert + ,-,*,/ signs as necessary in the string 123456789 to form an expression that evaluates to a certain number. Answer: Sub test() getall 2009, 1 getall 2009, 2En原创 2009-02-18 01:31:00 · 942 阅读 · 0 评论 -
Nine-digit Fractions(II)
Problem: Suppose integer A,B(A>B) and single C were satisified A/B=C and all digits(1-9) each used just once in the both sides of the equality respectively. Try to get all solutions. Answer:原创 2009-02-11 01:16:00 · 1983 阅读 · 0 评论