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 A265113 #17 Sep 08 2022 08:46:14 %S A265113 2,3,7,31,79,127,157,317,379,751,1087,1151,1277,1279,1531,1789,1951, %T A265113 2297,2557,2927,3067,3259,3319,3581,4253,4349,5119,5231,5503,5807, %U A265113 5821,6271,6653,6871,8191,8447,8689,9209,10079,10837,11597,11903,12799,13309,13591 %N A265113 Primes p such that p and p^2 have the same number of 1's in their binary representations. %C A265113 Primes p such that p^2 is in A089042. %C A265113 Primes p such that A000120(p) = A000120(p^2). %C A265113 Contains all terms > 43 in A079361. %C A265113 Subset of A077436. %H A265113 Robert Israel, <a href="/A265113/b265113.txt">Table of n, a(n) for n = 1..1000</a> %e A265113 7 is in the sequence because 7 and 7^2 = 49 have binary representations 111 and 110001 which both have three 1's. %p A265113 f:= proc(n) isprime(n) and (convert(convert(n,base,2),`+`) = convert(convert(n^2,base,2),`+`)) end proc: %p A265113 select(f, [2,seq(i,i=3..10^5,2)]); %t A265113 Select[ Prime@ Range@ 1700, DigitCount[n, 2, 1] == DigitCount[n^2, 2, 1], &] (* _Robert G. Wilson v_, Dec 01 2015 *) %o A265113 (Magma) [NthPrime(n): n in [1..2000] | Multiplicity({* z: z in Intseq(NthPrime(n)^2, 2) *}, 1) eq &+Intseq(NthPrime(n), 2)]; // _Vincenzo Librandi_, Dec 02 2015 %o A265113 (PARI) c(k, d, b) = {my(c=0, f); while (k>b-1, f=k-b*(k\b); if (f==d, c++); k\=b); if (k==d, c++); return(c)} %o A265113 forprime(p=2, 1e5, if(c(p, 1, 2) == c(p^2, 1, 2), print1(p, ", "))) \\ _Altug Alkan_, Dec 02 2015 %Y A265113 Cf. A000120, A077436, A079361, A089042. %K A265113 nonn,base %O A265113 1,1 %A A265113 _Robert Israel_, Dec 01 2015