This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A215932 #46 Oct 30 2024 08:05:20 %S A215932 7,13,31,79,97,167,313,383,709,739,761,907,937,1009,1033,1151,1487, %T A215932 1511,1733,1847,1933,3019,3067,3083,3109,3301,3319,3371,3391,3463, %U A215932 3643,3803,7457,7481,7547,7589,7603,7841,9001,9013,9103,9133,9857,10009,10039,10067 %N A215932 Happy reversible primes. %C A215932 Happy numbers that are prime and if the digits are reversed they remain prime (and of course happy, since addition is commutative). %C A215932 Intersection of A007500 and A007770. - _N. J. A. Sloane_, Mar 16 2013 %C A215932 This is to A031161 (palindromic lucky numbers) as prime happy numbers are to lucky numbers (A000959). - _Jonathan Vos Post_, Mar 16 2013 %t A215932 revpQ[n_] := PrimeQ[n] && PrimeQ[FromDigits@Reverse@IntegerDigits@n]; happyQ[n_] := Block[{w = n}, While[w > 6, w = Total[ IntegerDigits[w]^2]]; w == 1]; Select[Range[10^4], revpQ[#] && happyQ[#] &] (* _Giovanni Resta_, Mar 16 2013 *) %o A215932 (C) %o A215932 int main() %o A215932 {long unsigned int n,i,si,a[]={4,16,37,58,89,145,42,20},t,x,c1=0, sod(long unsigned int),rev(long unsigned int),prim(long unsigned int); %o A215932 for(n=2;n<=12000;n++) {t=n;si=0;while(si!=1){for(i=0;i<=7;i++){if(t==a[i]){si=1;break;}} %o A215932 if(t==1){si=1;if(prim(n)==0){x=rev(n);if(prim(x)==0){printf(", %lu",n);c1=c1+1;}}}t=sod(t);}}} %o A215932 long unsigned int sod(long unsigned int m){long unsigned int d=0,r;while(m>0){r=m%10;d=d+r*r;m=m/10;} return(d);} %o A215932 long unsigned int rev(long unsigned int p){long unsigned int d=0,r;while(p>0){r=p%10;d=d*10+r;p=p/10;}return(d);} %o A215932 long unsigned int prim(long unsigned int n){long unsigned int i,d=0; for(i=2;i<=n/2;i++){if(n%i==0){d=1;break;}}return(d);} %Y A215932 Cf. A007500, A007770, A035497. %K A215932 nonn,base %O A215932 1,1 %A A215932 _Jayanta Basu_, Mar 16 2013