Remy José Cano on Mon, 05 Mar 2018 09:15:18 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: forprime in arithmetic progressions?


Greetings Bill.

:-) I bring this time an attachment. Hope you enjoy it.

Previously I mentioned a sequence where presumably all its terms are
squarefree...

Such is g(n) there in the attachment.

Cheers,
Remy.

----------------------------------------------
1-43 Entrada principal a Santa Juana. Mérida, ME 5101, Venezuela
Phone: +58 412 077 6 077;
Page: https://www.oeis.org/wiki/User:R._J._Cano
Email: cano.remy.jose@gmail.com
/* R. J. Cano, Mar 03 2018 */

f0(n)=sum(k=0,n,   k  *(n+1)^k); \\ Greatest permutation that can be written in the base n+1 without repetition of digits.
f1(n)=sum(k=0,n,(n-k) *(n+1)^k); \\ Smallest permutation that can be written in the base n+1 without repetition of digits.

g(n)=1+f0(n)*f1(n); \\ Def. inspired by Euclid's idea on getting new primes based upon "all those already known"...

\\ Decomposition of g(n) in parts p0, p1, and p2, according to an application of the delta-no-delta formalism.

p0(n)=sum(t=1,n-1,t*(n-t)*((n+1)^2)^(t-1)); \\ Here are the same digits found in the palindromes defining A211869, this time in the base (n+1)^2;

p1(n)=sum(i=1,n-1,sum(k=i+1,n,i*(n-k)*((n+1)^(i+k))));

p2(n)=sum(k=0,n-1,sum(i=k+1,n,i*(n-k)*((n+1)^(i+k))));

/*
 -----------------------------------
  n+g(n) is a multiple of (n+1)^2  
 -----------------------------------
 Proof: If we notice above that i+k always range for p2(n) between 1 and 2*n-1, such affirmation depends on the p2(n) term where (k,i)=(0,1) because for any other combination and due the properties of powers, at least (n+1)^2 always is factorizable from the remaining expression. But then what left there is n*(n+1)+1=(n+1)^2-n, revealing that n+g(n) is 0 mod (n+1)^2 */ 

H(n)=((n+1)^2)*p0(n);

G(n)=1+H(n)+p1(n)+p2(n); \\ Equivalent to g(n) built from the previous decomposition;

/* WARNING: The commented routine shown below literally killed my machine twice for (b,a) equals to: 1st time (1000,0) and 2nd time (500,101); It was mainly my fault since I allowed GP to manage ALL the theoretically available RAM for my machine (AMD64 E-300 APU with Radeon, 4 Gigas of RAM, I am not kidding!) Lesson learned: It is preferable a "GP stack overflow" message than being oneself forced to hold down the power button of the Laptop (Toshiba C855D in my case).

testEquivGg(b,{a=0})={for(k=a,b,if(G(k)!=g(k),print("Mismatch found! for n="k";");return(0)));return(1)} \\ Intended as an empirical test.

Later, after contemplation of my personal anecdotes as PARI/GP user and with some moral support obtained in the past from the dev. team, I did remember that perhaps the option -g had to be used in GP2C so I edited "/usr/local/bin/gp2c-run" for having that into account;

End.*/