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 A145257 #30 Aug 12 2024 13:15:38 %S A145257 6,15,10,30,14,63,18,12,12,55,21,247,30,63,34,85,20,57,24,28,26,253, %T A145257 38,45,28,30,46,1015,55,1023,66,36,36,42,40,185,42,45,48,205,44,215, %U A145257 50,51,54,14335,69,56,52,54,56,159,57,95,77,60,60,767,87,4087,126,255,130,80 %N A145257 a(n) is the smallest integer > n that is non-coprime to n and has the same number of 0's in its binary representation as n has. %H A145257 Rémy Sigrist, <a href="/A145257/b145257.txt">Table of n, a(n) for n = 2..10000</a> %H A145257 Rémy Sigrist, <a href="/A145257/a145257.gp.txt">PARI program for A145257</a> %t A145257 a[n_] := Block[{},i = n + 1; While[GCD[i, n] == 1 || Not[DigitCount[n, 2, 0] == DigitCount[i, 2, 0]], i++ ]; i]; Table[a[n], {n, 2, 100}] (* _Stefan Steinerberger_, Oct 17 2008 *) %t A145257 sncp[n_]:=Module[{k=n+1},While[CoprimeQ[k,n]||DigitCount[k,2,0]!=DigitCount[ n,2,0],k++];k]; Array[sncp,70,2] (* _Harvey P. Dale_, Aug 11 2024 *) %o A145257 (PARI) \\ See Links section. %o A145257 (PARI) a(n) = {my(m = n+1, nb = #binary(n) - hammingweight(n)); while (!((gcd(m, n) > 1) && (nb == #binary(m) - hammingweight(m))), m++); m;} \\ _Michel Marcus_, Feb 06 2020 %o A145257 (Magma) a:=[]; for n in [2..70] do k:=n+1; while Gcd(n,k) eq 1 or Multiplicity(Intseq(n,2),0) ne Multiplicity(Intseq(k,2),0) do k:=k+1; end while; Append(~a,k); end for; a; // _Marius A. Burtea_, Feb 06 2020 %Y A145257 Cf. A023416 (number of 0's in binary expansion of n). %Y A145257 Cf. A140977, A145254, A145255, A145256. %K A145257 base,nonn %O A145257 2,1 %A A145257 _Leroy Quet_, Oct 05 2008 %E A145257 More terms from _Stefan Steinerberger_, Oct 17 2008 %E A145257 a(58)-a(64) from _Ray Chandler_, Jun 20 2009