cp's OEIS Frontend

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.

Showing 1-4 of 4 results.

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.

Original entry on oeis.org

6, 15, 10, 30, 14, 63, 18, 12, 12, 55, 21, 247, 30, 63, 34, 85, 20, 57, 24, 28, 26, 253, 38, 45, 28, 30, 46, 1015, 55, 1023, 66, 36, 36, 42, 40, 185, 42, 45, 48, 205, 44, 215, 50, 51, 54, 14335, 69, 56, 52, 54, 56, 159, 57, 95, 77, 60, 60, 767, 87, 4087, 126, 255, 130, 80
Offset: 2

Views

Author

Leroy Quet, Oct 05 2008

Keywords

Crossrefs

Cf. A023416 (number of 0's in binary expansion of n).

Programs

  • 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
  • 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 *)
  • 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
    

Extensions

More terms from Stefan Steinerberger, Oct 17 2008
a(58)-a(64) from Ray Chandler, Jun 20 2009

A145254 a(n) = the smallest positive integer that is non-coprime to n and has the same number of 1's in its binary representation as n.

Original entry on oeis.org

2, 3, 2, 5, 3, 7, 2, 3, 5, 11, 3, 13, 7, 15, 2, 17, 3, 19, 5, 7, 11, 23, 3, 25, 13, 15, 7, 29, 15, 31, 2, 3, 6, 7, 3, 37, 14, 15, 5, 41, 7, 43, 11, 15, 23, 47, 3, 7, 14, 15, 13, 53, 15, 55, 7, 15, 29, 59, 15, 61, 31, 63, 2, 5, 3, 67, 6, 21, 7, 71, 3, 73, 14, 15, 14, 77, 15, 79, 5, 21, 14, 83
Offset: 2

Views

Author

Leroy Quet, Oct 05 2008

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Function[k, SelectFirst[Range[2, n], And[! CoprimeQ[#, n], DigitCount[#, 2, 1] == k] &]]@ DigitCount[n, 2, 1], {n, 2, 83}] (* Michael De Vlieger, Oct 26 2017 *)
  • PARI
    a(n) = {my(k = 1, hn = hammingweight(n)); while ((hammingweight(k) != hn) || (gcd(n, k) == 1), k++); k;} \\ Michel Marcus, Oct 27 2017

Extensions

Extended by Ray Chandler, Nov 03 2008

A145255 a(n) = the smallest positive integer that is non-coprime to n and has the same number of 0's in its binary representation as n has.

Original entry on oeis.org

2, 3, 4, 5, 2, 7, 8, 9, 4, 11, 4, 13, 2, 3, 16, 17, 8, 19, 8, 9, 4, 23, 8, 10, 4, 6, 4, 29, 2, 31, 32, 33, 16, 20, 16, 37, 8, 9, 16, 41, 8, 43, 8, 9, 4, 47, 16, 35, 8, 9, 8, 53, 4, 5, 8, 9, 4, 59, 4, 61, 2, 3, 64, 65, 32, 67, 32, 33, 16, 71, 32, 73, 16, 18, 16, 35, 8, 79, 32, 33, 16, 83, 16
Offset: 2

Views

Author

Leroy Quet, Oct 05 2008

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Function[k, SelectFirst[Range[2, n], And[! CoprimeQ[#, n], DigitCount[#, 2, 0] == k] &]]@ DigitCount[n, 2, 0], {n, 2, 84}] (* Michael De Vlieger, Oct 26 2017 *)

Extensions

Extended by Ray Chandler, Nov 03 2008

A161396 a(n) = the smallest positive integer that contains the same number of 1's as n when a(n) and n are written in binary, is not coprime to n, and is not a divisor of n.

Original entry on oeis.org

4, 6, 8, 10, 9, 14, 16, 6, 6, 22, 9, 26, 21, 27, 32, 34, 10, 38, 6, 14, 14, 46, 9, 35, 14, 15, 21, 58, 27, 62, 64, 6, 6, 14, 10, 74, 14, 15, 6, 82, 22, 86, 14, 27, 30, 94, 9, 14, 14, 15, 14, 106, 15, 110, 21, 15, 30, 118, 27, 122, 93, 111, 128, 10, 9, 134, 6
Offset: 2

Views

Author

Leroy Quet, Jun 09 2009

Keywords

Examples

			6_10 (6 in decimal) is 110_2 (110 in binary). 9_10 = 1001_2, which contains the same number of ones in the binary expansion. 9 isn't coprime to 6; they share prime factor 3 and 9 isn't a divisor of 6. No positive integer less than 9 has these properties. Therefore, a(6) = 9.
		

Crossrefs

Extensions

Offset corrected and more terms from Rémy Sigrist, Apr 15 2017
Showing 1-4 of 4 results.