vv

14027 Reputation

20 Badges

10 years, 49 days

MaplePrimes Activity


These are answers submitted by vv

A way to obtain the plot file is the following:

In the worksheet "f.mw" subject to RunWorksheet, don't use plotsetup but use:

...
p := plot(...):
...
return p;

(so, return the PLOT structure).
In the calling worksheet use:

ret := DocumentTools :-RunWorksheet("f.mw"):
plottools:-exportplot( "d:/temp/myplot.png", ret);

General solution: p, q, r, n arbitrary integers (n>0) and s = k^3 - p*A - q*B - r*C, where k is an arbitrary integer.
(Not very interesting).

restart;

u := convert(3^(1/3),RootOf);
v := convert(4^(1/4), RootOf);
uv1 := u + v + 1^(1/1);

RootOf(_Z^3-3, index = 1)

 

RootOf(_Z^2-2, index = 1)

 

RootOf(_Z^3-3, index = 1)+RootOf(_Z^2-2, index = 1)+1

(1)

"I would like to represent  u  and  v  as elements of the field generated by a = u+v+1" .

pf:=evala(Primfield({u,v}));

[[RootOf(_Z^6-6*_Z^4-6*_Z^3+12*_Z^2-36*_Z+1) = RootOf(_Z^2-2, index = 1)+RootOf(_Z^3-3, index = 1)], [RootOf(_Z^2-2, index = 1) = (48/755)*RootOf(_Z^6-6*_Z^4-6*_Z^3+12*_Z^2-36*_Z+1)^5+(27/755)*RootOf(_Z^6-6*_Z^4-6*_Z^3+12*_Z^2-36*_Z+1)^4-(64/151)*RootOf(_Z^6-6*_Z^4-6*_Z^3+12*_Z^2-36*_Z+1)^3-(468/755)*RootOf(_Z^6-6*_Z^4-6*_Z^3+12*_Z^2-36*_Z+1)^2+(879/755)*RootOf(_Z^6-6*_Z^4-6*_Z^3+12*_Z^2-36*_Z+1)-1092/755, RootOf(_Z^3-3, index = 1) = -(124/755)*RootOf(_Z^6-6*_Z^4-6*_Z^3+12*_Z^2-36*_Z+1)-(48/755)*RootOf(_Z^6-6*_Z^4-6*_Z^3+12*_Z^2-36*_Z+1)^5-(27/755)*RootOf(_Z^6-6*_Z^4-6*_Z^3+12*_Z^2-36*_Z+1)^4+(64/151)*RootOf(_Z^6-6*_Z^4-6*_Z^3+12*_Z^2-36*_Z+1)^3+(468/755)*RootOf(_Z^6-6*_Z^4-6*_Z^3+12*_Z^2-36*_Z+1)^2+1092/755]]

(2)

op([1,1,1],pf);

RootOf(_Z^6-6*_Z^4-6*_Z^3+12*_Z^2-36*_Z+1)

(3)

alias(alpha=op([1,1,1],pf));

alpha

(4)

evala(eval(uv1, pf[2]));

alpha+1

(5)

simplify(eval(pf[2], alpha=a-1));

[2^(1/2) = (48/755)*a^5-(213/755)*a^4+(52/755)*a^3+(174/755)*a^2+(987/755)*a-428/151, 3^(1/3) = -(232/755)*a+277/151-(48/755)*a^5+(213/755)*a^4-(52/755)*a^3-(174/755)*a^2]

(6)

simplify(eval(%, a=u+v+1)); # check

[2^(1/2) = 2^(1/2), 3^(1/3) = 3^(1/3)]

(7)


Download Primfield-vv.mw

Just replace
S := sort([sqrt(x2), sqrt(y2), sqrt(z2)]);
with

S := sort([sqrt(x2), sqrt(y2), sqrt(z2)], key=evalf);

This is necessary because we need a numeric rather than symbolic ordering (see ?sort).

Q5:=n -> irem(add(convert(n,base,10)),5):
for n to 100000 do
if (Q5(n)+Q5(n+1)=0) then print(nmin=n); break fi od:

                            nmin = 49999

 

During a birthday party, the birthday child realizes:

In 1968, I was the same age as the sum of the digits of my birth year. How old will I be now at the end of 2025?

restart;

# y = birth year, 1800<y<1968

s:=y -> add(convert(y, base,10))

proc (y) options operator, arrow; add(convert(y, base, 10)) end proc

(1)

eq := 1968-y = 's'(y);

1968-y = s(y)

(2)

for y from 1800 to 1968 do
if eq then Y:=y; fi od;

Y, 2025-Y;

1947, 78

(3)
 

 

Download birth-vv.mw

restart

Denote by u the number with first digit (7) deleted and by n the number of its digits.

Then:

(10*u+7)*3 = 7*10^n+u;

30*u+21 = 7*10^n+u

(1)

u:=solve(%,u);

(7/29)*10^n-21/29

(2)

for n do
if type(u,integer) then print(n); break fi od:

27

(3)

k=u+7*10^n;

k = 7241379310344827586206896551

(4)
 

 

Download sol-vv.mw

dsolve declares alias(c__1 = _C1) ;

restart;
dsolve(diff(y(x),x)=1);
alias();
_C1;

            y(x) = x + c__1
            c__1
            c__1

For container structures (such as tables, rtables) use e.g. EqualEntries  (or LinearAlgebra:-Equal(...), or ...)

EqualEntries(Matrix([[1,2],[1,2]]), <1,2;1,2>);

        true

The equation has a unique real solution, so, "Diophantine" is not essential.

restart;
f:=419*x^2 + 116*x*y - 426*x*z + 78*y^2 - 142*y*z + 133*z^2 - 1604*x - 682*y + 1086*z + 2306:
CS:=Student:-Precalculus:-CompleteSquare:
CS(f,z):
f1:=select(has,[op](%), z)[]:
CS(f-f1,y):
f2:=select(has,[op](%), y)[]:
f3:=CS(expand(f-f1-f2),x):
expand(f-f1-f2-f3);
solve([f1,f2,f3]);

          0
          {x = 7, y = 11, z = 13}

By Dirichlet's theorem on arithmetic progressions - Wikipedia there are infinitely many primes of the form 24*n + 1.
p,q can be any pair of these.

P.S. We could avoid Dirichlet' theorem noting that at least one of the sets {24*n+k| n in N} for k=0,1,...,23   must contain infinitely many primes.

You want the limit of V for beta --> oo. Use:

limit(V, beta = infinity)

It results 6.5.

If you want to check this numerically for large values for beta (as you did), increase first Digits e.g.

Digits := 30;

P.S. Note that usually, for symbolic computations like limit, it is recommended to use exact values or rational values for parameters.

The extra question is not clear enough (for me).

restart;

y:=x -> cos(a*x)+cos(x):

#  Suppose y is periodic with period T. ==>

y(T)=y(0);

cos(a*T)+cos(T) = 2

(1)

solve(op([1,1],%) =1, T, allsolutions) = solve(op([1,2],%) =1, T, allsolutions)

2*Pi*_Z1/a = 2*Pi*_Z2

(2)

a=solve(%, a);

a = _Z1/_Z2

(3)

# Impossible, `a` being irrational!

 

 

Download periodic-vv.mw

Maple does not use LeafCount for the complexity.

length~([e1,e2]);  # same complexity

                     [21, 21]

Better use ifactors:

SumPrimeFactors := n -> add(map2(op,1,ifactors(n)[2])):

 

1 2 3 4 5 6 7 Last Page 1 of 121