Thread: Always composite numbers? View Single Post
 2020-02-15, 03:55 #2 LaurV Romulan Interpreter     Jun 2011 Thailand 83×101 Posts Are you trolling, or what? Code: gp > doze(n)=((12^n-1)/11)*(12^(n+2)+1)+25*12^n %1 = (n)->((12^n-1)/11)*(12^(n+2)+1)+25*12^n gp > doze(0) %2 = 25 gp > doze(1) %3 = 2029 gp > 12^3+13+288 %4 = 2029 gp > doze(2) %5 = 273181 gp > n=0;while(!isprime(doze(n)),printf("...%d...%c",n,13);n++);n ...0... %6 = 1 HUH??? (this fast stop was really unexpected, haha, and it totally took me by surprise. I should have known that 2029 is prime! But somewhere in the corner of my mind I was trusting you that there are no primes... Big mistake... Anyhow, continuing... Code:  gp > isprime(2029) %7 = 1 gp > n=2;while(!isprime(doze(n)),printf("...%d...%c",n,13);n++);n %8 = 2 HUH??? Again? continuing... Code:  gp > isprime(273181) %9 = 1 gp > 12^5+12^4+2*12^3+12^2+12^1+1 %10 = 273181 gp > n=3;while(!isprime(doze(n)),printf("...%d...%c",n,13);n++);n %11 = 3 gp > doze(3) %12 = 39109981 gp > isprime(%) %13 = 1 HUH??? Again? continuing... Code:  gp > n=4;while(!isprime(doze(n)),printf("...%d...%c",n,13);n++);n ...26... time = 11 ms. %14 = 27 gp > doze(27) %15 = 247034206444509265352361785372634788125166592897428447392861 gp > isprime(%) %16 = 1 gp > GRRRRRR.... Edit, modify the oneliner to be easier to call (just pressing up arrow, without changing the start value) Code: gp > 27 %18 = 27 gp > n=%+1;while(!isprime(doze(n)),printf("...%d...%c",n,13);n++);n ...34... %19 = 35 gp > n=%+1;while(!isprime(doze(n)),printf("...%d...%c",n,13);n++);n ...41... %20 = 42 gp > n=%+1;while(!isprime(doze(n)),printf("...%d...%c",n,13);n++);n ...65... %21 = 66 gp > n=%+1;while(!isprime(doze(n)),printf("...%d...%c",n,13);n++);n ...84... %22 = 85 gp > doze(85) %23 = 3782523501323864273640948080633865577531395800266304515211581987031320387343953524514660357926542631809629293255791000553 6420609584690895592018538198985334828642857876896842543151543389 gp > ?digits digits(x,{b=10}): gives the vector formed by the digits of x in base b (x and b integers). gp > digits(doze(85),12) %24 = [ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1] Be my guest to count if the form is right... (to make it easyer for you, I aligned and eliminated the spaces using editor's facilities. Eight primes or so in the first 100... you either were dreaming during testing, or you are trolling. Last fiddled with by LaurV on 2020-02-15 at 04:40