#Processing, 161 bytes
Processing, 161 bytes
int p(int n){for(int k=1;++k<=sqrt(n);)if(n%k<1)return 0;return 1;}void t(int n){for(int i=1,j;i<=n;i++){if(p(i)<1)continue;for(j=i;j>0;j--)print(p(j)<1?"":j);}}
One function does the primality checking, the other does the printing. Call it by t(7)
###Ungolfed
Ungolfed
The first function does the primality checking. It returns an int instead of a boolean since this way more bytes are saved. (int instead of boolean, 0 instead of false, 1 instead of true)
int Q103891p(int n){
for(int k=1;++k<=sqrt(n);)
if(n%k<1)return 0;
return 1;
}
The second function prints out the string. It iterates through every number, if it is not a prime, skip to the next iteration. If it is a prime, it continues down to the printing inside another for-loop. Again, if the number is prime, then we print it, otherwise not.
void Q103891(int n){
for(int i=1,j;i<=n;i++){
if(p(i)<1)continue;
for(j=i;j>0;j--)
print(p(j)<1?"":j);
}
}
#Processing, 161 bytes
int p(int n){for(int k=1;++k<=sqrt(n);)if(n%k<1)return 0;return 1;}void t(int n){for(int i=1,j;i<=n;i++){if(p(i)<1)continue;for(j=i;j>0;j--)print(p(j)<1?"":j);}}
One function does the primality checking, the other does the printing. Call it by t(7)
###Ungolfed
The first function does the primality checking. It returns an int instead of a boolean since this way more bytes are saved. (int instead of boolean, 0 instead of false, 1 instead of true)
int Q103891p(int n){
for(int k=1;++k<=sqrt(n);)
if(n%k<1)return 0;
return 1;
}
The second function prints out the string. It iterates through every number, if it is not a prime, skip to the next iteration. If it is a prime, it continues down to the printing inside another for-loop. Again, if the number is prime, then we print it, otherwise not.
void Q103891(int n){
for(int i=1,j;i<=n;i++){
if(p(i)<1)continue;
for(j=i;j>0;j--)
print(p(j)<1?"":j);
}
}
Processing, 161 bytes
int p(int n){for(int k=1;++k<=sqrt(n);)if(n%k<1)return 0;return 1;}void t(int n){for(int i=1,j;i<=n;i++){if(p(i)<1)continue;for(j=i;j>0;j--)print(p(j)<1?"":j);}}
One function does the primality checking, the other does the printing. Call it by t(7)
Ungolfed
The first function does the primality checking. It returns an int instead of a boolean since this way more bytes are saved. (int instead of boolean, 0 instead of false, 1 instead of true)
int Q103891p(int n){
for(int k=1;++k<=sqrt(n);)
if(n%k<1)return 0;
return 1;
}
The second function prints out the string. It iterates through every number, if it is not a prime, skip to the next iteration. If it is a prime, it continues down to the printing inside another for-loop. Again, if the number is prime, then we print it, otherwise not.
void Q103891(int n){
for(int i=1,j;i<=n;i++){
if(p(i)<1)continue;
for(j=i;j>0;j--)
print(p(j)<1?"":j);
}
}
#Processing, 161 bytes
int p(int n){for(int k=1;++k<=sqrt(n);)if(n%k<1)return 0;return 1;}void t(int n){for(int i=1,j;i<=n;i++){if(p(i)<1)continue;for(j=i;j>0;j--)print(p(j)<1?"":j);}}
One function does the primality checking, the other does the printing. Call it by t(7)
###Ungolfed
The first function does the primality checking. It returns an int instead of a boolean since this way more bytes are saved. (int instead of boolean, 0 instead of false, 1 instead of true)
int Q103891p(int n){
for(int k=1;++k<=sqrt(n);)
if(n%k<1)return 0;
return 1;
}
The second function prints out the string. It iterates through every number, if it is not a prime, skip to the next iteration. If it is a prime, it continues down to the printing inside another for-loop. Again, if the number is prime, then we print it, otherwise not.
void Q103891(int n){
for(int i=1,j;i<=n;i++){
if(p(i)<1)continue;
for(j=i;j>0;j--)
print(p(j)<1?"":j);
}
}
#Processing, 161 bytes
int p(int n){for(int k=1;++k<=sqrt(n);)if(n%k<1)return 0;return 1;}void t(int n){for(int i=1,j;i<=n;i++){if(p(i)<1)continue;for(j=i;j>0;j--)print(p(j)<1?"":j);}}
One function does the primality checking, the other does the printing. Call it by t(7)
#Processing, 161 bytes
int p(int n){for(int k=1;++k<=sqrt(n);)if(n%k<1)return 0;return 1;}void t(int n){for(int i=1,j;i<=n;i++){if(p(i)<1)continue;for(j=i;j>0;j--)print(p(j)<1?"":j);}}
One function does the primality checking, the other does the printing. Call it by t(7)
###Ungolfed
The first function does the primality checking. It returns an int instead of a boolean since this way more bytes are saved. (int instead of boolean, 0 instead of false, 1 instead of true)
int Q103891p(int n){
for(int k=1;++k<=sqrt(n);)
if(n%k<1)return 0;
return 1;
}
The second function prints out the string. It iterates through every number, if it is not a prime, skip to the next iteration. If it is a prime, it continues down to the printing inside another for-loop. Again, if the number is prime, then we print it, otherwise not.
void Q103891(int n){
for(int i=1,j;i<=n;i++){
if(p(i)<1)continue;
for(j=i;j>0;j--)
print(p(j)<1?"":j);
}
}
#Processing, 138161 bytes
int ip(int n){for(int k=1;++k<=sqrt(n);)if(n%k<1)return 0;return 1;}void at(int n){for(int i=0i=1,j;i++<=n;j;i<=n;i++)for{if(j=i;jp(i)<1)continue;for(j=i;j>0;j-->1;)print(ip(j)>0<1?j:"":j);}}
One function does the primality checking, the other does the printing. Call it by at(7)
DOESN'T WORK
#Processing, 138 bytes
int i(int n){for(int k=1;++k<=sqrt(n);)if(n%k<1)return 0;return 1;}void a(int n){for(int i=0,j;i++<=n;)for(j=i;j-->1;)print(i(j)>0?j:"");}
One function does the primality checking, the other does the printing. Call it by a(7)
DOESN'T WORK
#Processing, 161 bytes
int p(int n){for(int k=1;++k<=sqrt(n);)if(n%k<1)return 0;return 1;}void t(int n){for(int i=1,j;i<=n;i++){if(p(i)<1)continue;for(j=i;j>0;j--)print(p(j)<1?"":j);}}
One function does the primality checking, the other does the printing. Call it by t(7)