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-10 of 13 results. Next

A339079 a(n) is the least number which is coprime to its binary weight (A094387) with a gap n to the next term of A094387, or 0 if such a number does not exist.

Original entry on oeis.org

1, 5, 19, 113, 872, 2357, 619, 831479, 645109, 28011357, 97768316, 377282539, 469754781, 403248635900
Offset: 1

Views

Author

Amiram Eldar, Nov 22 2020

Keywords

Comments

a(15) > 6 * 10^12, if it exists.

Examples

			a(1) = 1 since both 1 and 2 = 1 + 1 are coprime to their binary weight, and they are the least pair of consecutive numbers with this property.
a(2) = 5 since 5 and 7 = 5 + 2 are coprime to their binary weight, and 6 is not since gcd(6, A000120(6)) = 2, and they are the least pair with a difference 2 with this property.
		

Crossrefs

Cf. A000120, A094387, A339078 (decimal analog).

Programs

  • Mathematica
    copQ[n_] := CoprimeQ[n, DigitCount[n, 2, 1]]; s[mx_] := Module[{c = 0, n1 = 1, n2, seq, d}, seq = Table[0, {mx}]; n2 = n1 + 1; While[c < mx, While[! copQ[n2], n2++]; d = n2 - n1; If[d <= mx && seq[[d]] == 0, c++; seq[[d]] = n1]; n1 = n2; n2++]; seq]; s[9]

A339076 Numbers which are coprime to their digital sum (A007953).

Original entry on oeis.org

1, 10, 11, 13, 14, 16, 17, 19, 23, 25, 29, 31, 32, 34, 35, 37, 38, 41, 43, 47, 49, 52, 53, 56, 58, 59, 61, 65, 67, 71, 73, 74, 76, 79, 83, 85, 89, 91, 92, 94, 95, 97, 98, 100, 101, 103, 104, 106, 107, 109, 113, 115, 119, 121, 122, 124, 125, 127, 128, 131, 137
Offset: 1

Views

Author

Amiram Eldar, Nov 22 2020

Keywords

Comments

Numbers k such that gcd(k, A007953(k)) = 1.
Olivier (1975, 1976) proved that the asymptotic density of this sequence is 9/(2*Pi^2) = 0.455945... (A088245).
None of the terms are divisible by 3.
The powers of 10 (A011557) are terms. These are also the only Niven numbers (A005349) in this sequence.
Includes all the prime numbers above 7.

Examples

			10 is a term since A007953(10) = 1 + 0 = 1, and gcd(10, 1) = 1.
		

Crossrefs

Subsequence of A001651.
Subsequence: A011557.
Binary version: A094387.

Programs

  • Mathematica
    Select[Range[200], CoprimeQ[#, Plus @@ IntegerDigits[#]] &]

A332880 If n = Product (p_j^k_j) then a(n) = numerator of Product (1 + 1/p_j).

Original entry on oeis.org

1, 3, 4, 3, 6, 2, 8, 3, 4, 9, 12, 2, 14, 12, 8, 3, 18, 2, 20, 9, 32, 18, 24, 2, 6, 21, 4, 12, 30, 12, 32, 3, 16, 27, 48, 2, 38, 30, 56, 9, 42, 16, 44, 18, 8, 36, 48, 2, 8, 9, 24, 21, 54, 2, 72, 12, 80, 45, 60, 12, 62, 48, 32, 3, 84, 24, 68, 27, 32, 72
Offset: 1

Views

Author

Ilya Gutkovskiy, Feb 28 2020

Keywords

Comments

Numerator of sum of reciprocals of squarefree divisors of n.
(6/Pi^2) * A332881(n)/a(n) is the asymptotic density of numbers that are coprime to their digital sum in base n+1 (see A094387 and A339076 for bases 2 and 10). - Amiram Eldar, Nov 24 2022

Examples

			1, 3/2, 4/3, 3/2, 6/5, 2, 8/7, 3/2, 4/3, 9/5, 12/11, 2, 14/13, 12/7, 8/5, 3/2, 18/17, ...
		

Crossrefs

Programs

  • Maple
    a:= n-> numer(mul(1+1/i[1], i=ifactors(n)[2])):
    seq(a(n), n=1..80);  # Alois P. Heinz, Feb 28 2020
  • Mathematica
    Table[If[n == 1, 1, Times @@ (1 + 1/#[[1]] & /@ FactorInteger[n])], {n, 1, 70}] // Numerator
    Table[Sum[MoebiusMu[d]^2/d, {d, Divisors[n]}], {n, 1, 70}] // Numerator
  • PARI
    A001615(n) = if(1==n,n, my(f=factor(n)); prod(i=1, #f~, f[i, 1]^f[i, 2] + f[i, 1]^(f[i, 2]-1))); \\ After code in A001615
    A332880(n) = numerator(A001615(n)/n);

Formula

Numerators of coefficients in expansion of Sum_{k>=1} mu(k)^2*x^k/(k*(1 - x^k)).
a(n) = numerator of Sum_{d|n} mu(d)^2/d.
a(n) = numerator of psi(n)/n.
a(p) = p + 1, where p is prime.
a(n) = A001615(n) / A306695(n) = A001615(n) / gcd(n, A001615(n)). - Antti Karttunen, Nov 15 2021
From Amiram Eldar, Nov 24 2022: (Start)
Asymptotic means:
Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k)/A332881(k) = 15/Pi^2 = 1.519817... (A082020).
Limit_{m->oo} (1/m) * Sum_{k=1..m} A332881(k)/a(k) = Product_{p prime} (1 - 1/(p*(p+1))) = 0.704442... (A065463). (End)

A358977 Numbers that are coprime to the sum of their primorial base digits (A276150).

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 10, 11, 13, 14, 15, 17, 19, 21, 22, 23, 26, 29, 30, 31, 34, 35, 37, 38, 39, 41, 43, 46, 47, 49, 53, 54, 55, 57, 58, 59, 61, 62, 63, 67, 69, 71, 73, 74, 78, 79, 81, 82, 83, 85, 86, 87, 89, 91, 93, 94, 95, 97, 98, 101, 102, 103, 106, 107, 109, 110
Offset: 1

Views

Author

Amiram Eldar, Dec 07 2022

Keywords

Comments

Numbers k such that gcd(k, A276150(k)) = 1.
The primorial numbers (A002110) are terms. These are also the only primorial base Niven numbers (A333426) in this sequence.
Includes all the prime numbers.
The numbers of terms not exceeding 10^k, for k = 1, 2, ..., are 7, 59, 603, 6047, 60861, 608163, 6079048, 60789541, 607847981, 6080015681... . Conjecture: The asymptotic density of this sequence exists and equals 6/Pi^2 = 0.607927... (A059956), the same as the density of A094387.

Examples

			3 is a term since A276150(3) = 2, and gcd(3, 2) = 1.
		

Crossrefs

Subsequences: A000040, A002110.
Similar sequences: A094387, A339076, A358975, A358976, A358978.

Programs

  • Mathematica
    With[{max = 4}, bases = Prime@Range[max, 1, -1]; nmax = Times @@ bases - 1; sumdig[n_] := Plus @@ IntegerDigits[n, MixedRadix[bases]]; Select[Range[nmax], CoprimeQ[#, sumdig[#]] &]]
  • PARI
    is(n) = {my(p=2, s=0, m=n, r); while(m>0, r = m%p; s+=r; m\=p; p = nextprime(p+1)); gcd(n, s)==1; }

A161152 Positive integers n such that {the number of (non-leading) 0's in the binary representation of n} is coprime to n.

Original entry on oeis.org

1, 2, 5, 6, 8, 9, 11, 13, 14, 17, 19, 20, 21, 23, 25, 27, 29, 30, 32, 33, 35, 37, 38, 39, 41, 43, 44, 45, 47, 49, 50, 51, 52, 53, 55, 56, 57, 59, 61, 62, 66, 67, 68, 69, 71, 72, 73, 77, 79, 81, 83, 85, 86, 87, 89, 91, 92, 93, 95, 96, 97, 101, 103, 106, 107, 109, 111, 113, 115
Offset: 1

Views

Author

Leroy Quet, Jun 03 2009

Keywords

Comments

1 is the only integer of the form 2^k - 1 (k>=0) included in this sequence, because such integers contain no binary 0's, and 0 is considered here to be coprime only to 1.

Examples

			13 is in the sequence because the number of non-leading 0 s in the binary representation of 13 is 1 (13_10 = 1101_2) and gcd(1, 13) = 1. - _Indranil Ghosh_, Mar 08 2017
		

Crossrefs

Programs

  • Mathematica
    Select[Range[115], GCD[DigitCount[#, 2, 0], #] == 1 &] (* Indranil Ghosh, Mar 08 2017 *)
  • PARI
    b(n) = if(n<1, 0, b(n\2) + 1 - n%2);
    for (n=1, 115, if(gcd(b(n),n)==1, print1(n", "))); \\ Indranil Ghosh, Mar 08 2017
    
  • Python
    from math import gcd
    i=j=1
    while j<=100:
        if gcd(bin(i)[2:].count("0"),i)==1:
            print(j, i)
            j+=1
        i+=1 # Indranil Ghosh, Mar 08 2017

Extensions

Extended by Ray Chandler, Jun 11 2009

A161153 Positive integers that are coprime to their number of digits in binary representation.

Original entry on oeis.org

1, 3, 4, 5, 7, 9, 11, 13, 15, 16, 17, 18, 19, 21, 22, 23, 24, 26, 27, 28, 29, 31, 35, 37, 41, 43, 47, 49, 53, 55, 59, 61, 64, 65, 66, 67, 68, 69, 71, 72, 73, 74, 75, 76, 78, 79, 80, 81, 82, 83, 85, 86, 87, 88, 89, 90, 92, 93, 94, 95, 96, 97, 99, 100, 101, 102, 103, 104, 106
Offset: 1

Views

Author

Leroy Quet, Jun 03 2009

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[106], GCD[Length[IntegerDigits[#, 2]], #]==1 &] (* Indranil Ghosh, Mar 08 2017 *)
  • PARI
    for(n=1, 106, if(gcd(#digits(n, 2), n)==1, print1(n,", "))) \\ Indranil Ghosh, Mar 08 2017
    
  • Python
    from math import gcd
    i=1
    j=1
    while j<=100:
        if gcd(len(bin(i)[2:]),i)==1:
            print(j, i)
            j+=1
        i+=1 # Indranil Ghosh, Mar 08 2017

Extensions

Extended by Ray Chandler, Jun 11 2009
Name edited by Michel Marcus, Apr 30 2021

A161154 Positive integers n such that both {the number of (non-leading) 0's in the binary representation of n} is coprime to n and {the number of 1's in the binary representation of n} is coprime to n.

Original entry on oeis.org

1, 2, 5, 8, 9, 11, 13, 14, 17, 19, 23, 25, 27, 29, 32, 33, 35, 37, 38, 39, 41, 43, 44, 45, 47, 49, 50, 51, 52, 53, 56, 57, 59, 61, 62, 67, 71, 73, 77, 79, 83, 85, 87, 89, 91, 93, 95, 97, 101, 103, 107, 109, 113, 117, 119, 121, 125, 128, 131, 133, 134, 135, 137, 139, 141
Offset: 1

Views

Author

Leroy Quet, Jun 03 2009

Keywords

Comments

1 is the only integer of the form 2^k - 1 (k>=0) included in this sequence, because such integers contain no binary 0's, and 0 is considered here to be coprime only to 1.

Crossrefs

Programs

  • Mathematica
    bcpQ[n_]:=Module[{ones=DigitCount[n,2,1],zeros=DigitCount[n,2,0]}, And@@ CoprimeQ[ {ones,zeros},n]]; Select[Range[150],bcpQ] (* Harvey P. Dale, Feb 19 2012 *)
  • PARI
    b0(n) = if(n<1, 0, b0(n\2) + 1 - n%2);
    b1(n) = if(n<1, 0, b1(n\2) + n%2);
    for (n=1, 141, if(gcd(b0(n),n)==1 && gcd(b1(n),n)==1, print1(n", "))) \\ Indranil Ghosh, Mar 08 2017
    
  • Python
    from math import gcd
    i=j=1
    while j<=100:
        if gcd(bin(i)[2:].count("0"),i)==1==gcd(bin(i)[2:].count("1"),i):
            print(j, i)
            j+=1
        i+=1 # Indranil Ghosh, Mar 08 2017

Extensions

Extended by Ray Chandler, Jun 11 2009

A161155 Positive integers n such that {the number of (non-leading) 0's in the binary representation of n} is coprime to n, {the number of 1's in the binary representation of n} is coprime to n and {the number of digits in the binary representation of n} is coprime to n.

Original entry on oeis.org

1, 5, 9, 11, 13, 17, 19, 23, 27, 29, 35, 37, 41, 43, 47, 49, 53, 59, 61, 67, 71, 73, 79, 83, 85, 87, 89, 93, 95, 97, 101, 103, 107, 109, 113, 117, 121, 125, 131, 133, 135, 137, 139, 141, 143, 147, 149, 151, 153, 157, 161, 163, 165, 167, 169, 173, 175, 177, 179, 181
Offset: 1

Views

Author

Leroy Quet, Jun 03 2009

Keywords

Comments

1 is the only integer of the form 2^k - 1 (k>=0) included in this sequence, because such integers contain no binary 0's, and 0 is considered here to be coprime only to 1.

Crossrefs

Programs

  • Mathematica
    Select[Range[181], GCD[DigitCount[#,2,0] , #]==1 && GCD[DigitCount[#,2,1],#]==1 && GCD[Length[IntegerDigits[#,2]],#]==1 &] (* Indranil Ghosh, Mar 08 2017 *)
  • PARI
    b0(n) = if(n<1, 0, b0(n\2) + 1 - n%2);
    b1(n) = if(n<1, 0, b1(n\2) + n%2);
    for (n=1, 181, if(gcd(b0(n), n) == 1 && gcd(b1(n), n) == 1 && gcd(#digits(n, 2), n) == 1, print1(n", "))) \\ Indranil Ghosh, Mar 08 2017
    
  • Python
    from math import gcd
    i=j=1
    while j<=100:
        if gcd(bin(i)[2:].count("0"),i)==1 and gcd(bin(i)[2:].count("1"),i)==1 and gcd(len(bin(i)[2:]),i)==1:
            print(j, i)
            j+=1
        i+=1 # Indranil Ghosh, Mar 08 2017

Extensions

Extended by Ray Chandler, Jun 11 2009

A161156 Positive integers n such that {the number of (non-leading) 0's in the binary representation of n} is coprime to n, and {the number of 1's in the binary representation of n} is coprime to n, but {the number of digits in the binary representation of n} is not coprime to n.

Original entry on oeis.org

2, 8, 14, 25, 32, 33, 38, 39, 44, 45, 50, 51, 52, 56, 57, 62, 77, 91, 119, 128, 134, 146, 148, 152, 158, 164, 176, 182, 188, 194, 196, 206, 208, 214, 218, 224, 236, 242, 244, 248, 254, 267, 279, 291, 297, 309, 327, 333, 339, 351, 357, 369, 375, 381, 387, 393
Offset: 1

Views

Author

Leroy Quet, Jun 03 2009

Keywords

Comments

1 is the only integer of the form 2^k - 1 (k>=0) which is coprime to the number of 0's in its binary representation, because such integers contain no binary 0's, and 0 is considered here to be coprime only to 1.

Crossrefs

Programs

  • Mathematica
    Select[Range[393], GCD[DigitCount[#, 2, 0] , #]==1 && GCD[DigitCount[#, 2, 1], #] == 1 && GCD[Length[IntegerDigits[#, 2]], #] != 1 &] (* Indranil Ghosh, Mar 08 2017 *)
  • PARI
    b0(n) = if(n<1, 0, b0(n\2) + 1 - n%2);
    b1(n) = if(n<1, 0, b1(n\2) + n%2);
    for (n=1, 393, if(gcd(b0(n), n) == 1 && gcd(b1(n), n) == 1 && gcd(#digits(n, 2), n) != 1, print1(n", "))); \\ Indranil Ghosh, Mar 08 2017
    
  • Python
    from math import gcd
    i=j=1
    while j<=1000:
        if gcd(bin(i)[2:].count("0"),i)==1 and gcd(bin(i)[2:].count("1"),i)==1 and gcd(len(bin(i)[2:]),i)!=1:
            print(i, end=", ")
            j+=1
        i+=1 # Indranil Ghosh, Mar 08 2017

Extensions

Extended by Ray Chandler, Jun 11 2009

A358975 Numbers that are coprime to their digital sum in base 3 (A053735).

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 13, 17, 19, 23, 27, 29, 31, 37, 41, 43, 47, 49, 51, 53, 55, 59, 61, 67, 69, 71, 73, 79, 81, 83, 85, 89, 91, 97, 101, 103, 107, 109, 113, 119, 121, 123, 125, 127, 129, 131, 137, 139, 141, 143, 147, 149, 151, 153, 155, 157, 159, 161, 163, 167, 169
Offset: 1

Views

Author

Amiram Eldar, Dec 07 2022

Keywords

Comments

Numbers k such that gcd(k, A053735(k)) = 1.
All the terms are odd since if k is even then A053735(k) is even and so gcd(k, A053735(k)) >= 2.
Olivier (1975, 1976) proved that the asymptotic density of this sequence is 4/Pi^2 = 0.40528... (A185199).
The powers of 3 (A000244) are terms. These are also the only ternary Niven numbers (A064150) in this sequence.
Includes all the odd prime numbers (A065091).

Examples

			3 is a term since A053735(3) = 1, and gcd(3, 1) = 1.
		

Crossrefs

Subsequences: A000244, A065091.
Similar sequences: A094387, A339076, A358976, A358977, A358978.

Programs

  • Mathematica
    q[n_] := CoprimeQ[n, Plus @@ IntegerDigits[n, 3]]; Select[Range[200], q]
  • PARI
    is(n) = gcd(n, sumdigits(n, 3)) == 1;
Showing 1-10 of 13 results. Next