OFFSET
2,1
LINKS
Rémy Sigrist, Table of n, a(n) for n = 2..10000
Rémy Sigrist, PARI program for A145257
MATHEMATICA
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 *)
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 *)
PROG
(PARI) \\ See Links section.
(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
(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
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Leroy Quet, Oct 05 2008
EXTENSIONS
More terms from Stefan Steinerberger, Oct 17 2008
a(58)-a(64) from Ray Chandler, Jun 20 2009
STATUS
approved