A257404 Numbers of the form p * q^p where p and q are primes, in increasing order.
8, 18, 24, 50, 81, 98, 160, 242, 338, 375, 578, 722, 896, 1029, 1058, 1215, 1682, 1922, 2738, 3362, 3698, 3993, 4418, 5618, 6591, 6962, 7442, 8978, 10082, 10658, 12482, 13778, 14739, 15309, 15625, 15842, 18818
Offset: 1
Keywords
Examples
(2,2):8, (2,3):18, (3,2):24, (2,5):50, (3,3):81, (2,7):98.
Programs
-
JavaScript
primes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97]; results = []; max = 2 * Math.pow(primes[primes.length-1],2); for (i = 0; i < primes.length; i++) { for (j = 0; j < primes.length; j++) { p = primes[i]; q = primes[j]; n = p * Math.pow(q,p); if (n <= max) { // add it results.push(n); } else { // break out of this loop break; } } } // sort results and print them results.sort(function(a, b){return a-b}).valueOf();
-
Mathematica
max=10^5; p=q=2; Sort[Reap[While[2*q^2 <= max, While[(n=p*q^p) <= max, Sow@n; p=NextPrime@p]; p=2; q=NextPrime@q ]][[2,1]]] (* Giovanni Resta, May 19 2015 *)
-
PARI
is(n)={bittest(6,#n=factor(n)~)||return;#n==1&&return(n[1,1]+1==n[2,1]);(n[2,1]==1&&n[2,2]==n[1,1])||(n[2,2]==1&&n[1,2]==n[2,1])} \\ M. F. Hasler, May 04 2015