login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Numbers of the form p * q^p where p and q are primes, in increasing order.
0

%I #27 Jun 23 2022 20:34:11

%S 8,18,24,50,81,98,160,242,338,375,578,722,896,1029,1058,1215,1682,

%T 1922,2738,3362,3698,3993,4418,5618,6591,6962,7442,8978,10082,10658,

%U 12482,13778,14739,15309,15625,15842,18818

%N Numbers of the form p * q^p where p and q are primes, in increasing order.

%e (2,2):8, (2,3):18, (3,2):24, (2,5):50, (3,3):81, (2,7):98.

%t 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 *)

%o (JavaScript)

%o 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];

%o results = [];

%o max = 2 * Math.pow(primes[primes.length-1],2);

%o for (i = 0; i < primes.length; i++) {

%o for (j = 0; j < primes.length; j++) {

%o p = primes[i];

%o q = primes[j];

%o n = p * Math.pow(q,p);

%o if (n <= max) {

%o // add it

%o results.push(n);

%o } else {

%o // break out of this loop

%o break;

%o }

%o }

%o }

%o // sort results and print them

%o results.sort(function(a, b){return a-b}).valueOf();

%o (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

%Y Cf. some subsequences: A079704, A104126.

%K nonn

%O 1,1

%A _William Brian Repko_, Apr 22 2015