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.

Previous Showing 11-18 of 18 results.

A261075 Semiprimes whose prime factors are of equal binary length and which differ from each other in exactly three bit positions.

Original entry on oeis.org

527, 551, 1591, 2173, 2491, 2623, 3127, 5183, 5963, 6059, 6557, 6767, 6887, 7031, 7373, 7571, 7597, 7739, 7979, 8051, 8249, 8549, 8633, 8881, 9017, 9523, 9701, 10541, 10807, 11303, 11639, 12091, 12317, 12827, 14351, 19519, 20413, 20989, 21823, 22331, 23213, 24047, 24613, 24881, 24883, 25777, 25807, 26549, 26671, 26827, 26989, 27661, 28199, 28459, 28757, 29329
Offset: 1

Views

Author

Antti Karttunen, Sep 22 2015

Keywords

Examples

			291311 = 523 * 557 is included (as term a(334)) because 523 ("1000001011" in binary) and 557 ("1000101101" in binary) differ in exactly three bit-positions.
		

Crossrefs

Cf. also A261073, A261074.
Subsequence of A085721.

Programs

  • Mathematica
    Select[Range@ 30000, And[Length@ # == 2, IntegerLength[#1, 2] == IntegerLength[#2, 2] & @@ #, Total@ BitXor[IntegerDigits[#1, 2], IntegerDigits[#2, 2]] == 3 & @@ #] &@ Flatten@ Map[ConstantArray[#1, #2] & @@ # &, FactorInteger@ #] &] (* Michael De Vlieger, Oct 08 2016 *)
  • PARI
    A000523 = n -> logint(n, 2);
    A020639(n) = if(1==n,n,vecmin(factor(n)[, 1]));
    isA261075(n) = { my(a,b); if(bigomega(n)!=2, 0, a = A020639(n); b = (n/a); ((A000523(a) == A000523(b)) && (3 == norml2(binary(bitxor(a,b)))))); };
    i=0; n=0; while(i < 10000, n++; if(isA261075(n), i++; write("b261075.txt", i, " ", n)));
    
  • Scheme
    ;; With Antti Karttunen's IntSeq-library.
    (define A261075 (MATCHING-POS 1 1 (lambda (n) (and (= 2 (A001222 n)) (= (A000523 (A020639 n)) (A000523 (A006530 n))) (= 3 (A101080bi (A020639 n) (A006530 n)))))))

A261077 Semiprimes whose prime factors differ from each other in one bit position only.

Original entry on oeis.org

6, 21, 33, 35, 57, 65, 161, 185, 201, 323, 377, 393, 437, 473, 497, 713, 899, 1529, 1577, 1763, 1769, 1841, 1961, 2021, 2537, 3233, 3473, 3497, 3737, 4553, 4601, 4757, 5561, 5609, 5753, 6497, 7217, 7313, 9593, 9797, 10265, 10403, 10841, 10961, 11009, 12297, 14129, 15689, 17513, 18209, 19043, 19337, 21353, 22499, 23129, 23393, 26969, 27221, 27233, 29177
Offset: 1

Views

Author

Antti Karttunen, Sep 22 2015

Keywords

Examples

			21 = 3*7 is present because 3 in binary is "11" ("011" when extended with a leading zero) and 7 in binary is "111", and these differ only in the bit-position 2 (with indexing where the least significant bit is in the position 0).
33 = 3*11 is present because 3 in binary is "11" ("0011" when extended with two leading zeros) and 11 in binary is "1011", and these differ only in the bit-position 3.
		

Crossrefs

Cf. also A261073, A261080 (subsequences).
Subsequence of A261078.
Gives the positions of ones in A260737.

Programs

A260737 Sum of Hamming distances between binary representations of prime factors of n, summed over all nonordered pairs of primes present (with multiplicity) in the prime factorization of n.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 2, 0, 2, 2, 0, 0, 2, 0, 6, 1, 2, 0, 3, 0, 4, 0, 4, 0, 6, 0, 0, 1, 3, 1, 4, 0, 2, 3, 9, 0, 4, 0, 4, 4, 3, 0, 4, 0, 6, 2, 8, 0, 3, 3, 6, 1, 5, 0, 10, 0, 4, 2, 0, 1, 4, 0, 6, 2, 6, 0, 6, 0, 4, 4, 4, 2, 8, 0, 12, 0, 4, 0, 7, 2, 3, 4, 6, 0, 9, 2, 6, 3, 4, 3, 5, 0, 4, 2, 12, 0, 6, 0, 12, 4, 5, 0, 6, 0, 8, 3, 8, 0, 4, 2, 10, 6, 4, 3, 14
Offset: 1

Views

Author

Antti Karttunen, Sep 22 2015

Keywords

Examples

			For n = 1 the prime factorization is empty, thus there is nothing to sum, so a(1) = 0.
For n = 6 = 2*3, a(6) = 1 because the Hamming distance between 2 and 3 is 1 as 2 = "10" in binary and 3 = "11" in binary.
For n = 10 = 2*5, a(10) = 3 because the Hamming distance between 2 and 5 is 3 as 2 = "10" in binary (extended with a leading zero to make it "010") and 5 = "101" in binary.
For n = 12 = 2*2*3, a(12) = 2 because the Hamming distance between 2 and 3 is 1, and the pair (2,3) occurs twice as one can pick either one of the two 2's present in the prime factorization to be a pair of a single 3. Note that the Hamming distance between 2 and 2 is 0, thus the pair (2,2) of prime divisors does not contribute to the sum.
For n = 36 = 2*2*3*3, a(36) = 4 because the Hamming distance between 2 and 3 is 1, and the prime factor pair (2,3) occurs four times in total. Note that the Hamming distance is zero between 2 and 2 as well as between 3 and 3, thus the pairs (2,2) and (3,3) do not contribute to the sum.
		

Crossrefs

Cf. A101080.
Cf. A000961 (positions of the zeros), A261077 (positions of the ones).
Cf. also A261079.

A268726 Index of the toggled bit between n and A268717(n+1): a(n) = A000523(A003987(n, A268717(1+n))).

Original entry on oeis.org

0, 1, 2, 0, 3, 0, 0, 1, 4, 0, 0, 1, 0, 1, 2, 0, 5, 0, 0, 1, 0, 1, 2, 0, 0, 1, 2, 0, 3, 0, 0, 1, 6, 0, 0, 1, 0, 1, 2, 0, 0, 1, 2, 0, 3, 0, 0, 1, 0, 1, 2, 0, 3, 0, 0, 1, 4, 0, 0, 1, 0, 1, 2, 0, 7, 0, 0, 1, 0, 1, 2, 0, 0, 1, 2, 0, 3, 0, 0, 1, 0, 1, 2, 0, 3, 0, 0, 1, 4, 0, 0, 1, 0, 1, 2, 0, 0, 1, 2, 0, 3, 0, 0, 1, 4, 0, 0, 1, 0, 1, 2, 0, 5, 0, 0, 1, 0, 1, 2, 0, 0
Offset: 0

Views

Author

Antti Karttunen, Feb 13 2016

Keywords

Comments

A fractal sequence, because a permutation of A007814. Removing zeros yields A268727(n) = a(n)+1.

Crossrefs

One less than A268727.
Cf. also array A268833.

Programs

Formula

a(n) = A007814(1 + A006068(n)).
a(n) = A000523(A003987(n, A268717(1+n))).
a(n) = floor(log_2(n XOR A003188(1 + A006068(n)))).
Other identities:
For all n >= 1, a(A003188(n-1)) = A007814(n).

A268727 One-based index of the toggled bit between n and A268717(n+1): a(n) = A070939(A003987(n,A268717(1+n))).

Original entry on oeis.org

1, 2, 3, 1, 4, 1, 1, 2, 5, 1, 1, 2, 1, 2, 3, 1, 6, 1, 1, 2, 1, 2, 3, 1, 1, 2, 3, 1, 4, 1, 1, 2, 7, 1, 1, 2, 1, 2, 3, 1, 1, 2, 3, 1, 4, 1, 1, 2, 1, 2, 3, 1, 4, 1, 1, 2, 5, 1, 1, 2, 1, 2, 3, 1, 8, 1, 1, 2, 1, 2, 3, 1, 1, 2, 3, 1, 4, 1, 1, 2, 1, 2, 3, 1, 4, 1, 1, 2, 5, 1, 1, 2, 1, 2, 3, 1, 1, 2, 3, 1, 4, 1, 1, 2, 5, 1, 1, 2, 1, 2, 3, 1, 6, 1, 1, 2, 1, 2, 3, 1, 1
Offset: 0

Views

Author

Antti Karttunen, Feb 13 2016

Keywords

Comments

A fractal sequence like A268726.

Crossrefs

One more than A268726.
Cf. also array A268833.

Programs

Formula

a(n) = A001511(1+A006068(n)).
a(n) = A070939(A003987(n,A268717(1+n))).
a(n) = 1 + floor(log_2(n XOR A003188(1+A006068(n)))).
a(n) = A001511(n)*(1-A010059(n)) + 1. - Alan Michael Gómez Calderón, Jun 15 2025

A268834 Transpose of array A268833.

Original entry on oeis.org

0, 1, 0, 2, 1, 0, 1, 2, 1, 0, 2, 3, 2, 1, 0, 3, 2, 3, 2, 1, 0, 2, 1, 2, 1, 2, 1, 0, 1, 2, 3, 2, 3, 2, 1, 0, 2, 3, 4, 3, 2, 1, 2, 1, 0, 3, 2, 3, 4, 3, 2, 1, 2, 1, 0, 4, 3, 2, 3, 4, 3, 2, 3, 2, 1, 0, 3, 4, 1, 2, 3, 4, 3, 2, 3, 2, 1, 0, 2, 3, 2, 3, 2, 3, 2, 1, 2, 1, 2, 1, 0, 3, 2, 3, 2, 3, 2, 1, 2, 3, 2, 1, 2, 1, 0, 2, 1, 2, 1, 4, 3, 2, 3, 4, 3, 2, 3, 2, 1, 0
Offset: 0

Views

Author

Antti Karttunen, Feb 15 2016

Keywords

Comments

See comments in A268833.

Examples

			The top left [0 .. 16] x [0 .. 16] section of the array:
  0, 1, 2, 1, 2, 3, 2, 1, 2, 3, 4, 3, 2, 3, 2, 1, 2
  0, 1, 2, 3, 2, 1, 2, 3, 2, 3, 4, 3, 2, 1, 2, 3, 2
  0, 1, 2, 3, 2, 3, 4, 3, 2, 1, 2, 3, 2, 3, 4, 3, 2
  0, 1, 2, 1, 2, 3, 4, 3, 2, 3, 2, 1, 2, 3, 4, 3, 2
  0, 1, 2, 3, 2, 3, 4, 3, 2, 3, 4, 5, 4, 3, 4, 3, 2
  0, 1, 2, 1, 2, 3, 4, 3, 2, 3, 4, 3, 4, 5, 4, 3, 2
  0, 1, 2, 1, 2, 3, 2, 1, 2, 3, 4, 3, 4, 5, 4, 3, 2
  0, 1, 2, 3, 2, 1, 2, 3, 2, 3, 4, 5, 4, 3, 4, 3, 2
  0, 1, 2, 3, 2, 3, 4, 3, 2, 3, 4, 5, 4, 3, 4, 3, 2
  0, 1, 2, 1, 2, 3, 4, 3, 2, 3, 4, 3, 4, 5, 4, 3, 2
  0, 1, 2, 1, 2, 3, 2, 1, 2, 3, 4, 3, 4, 5, 4, 3, 2
  0, 1, 2, 3, 2, 1, 2, 3, 2, 3, 4, 5, 4, 3, 4, 3, 2
  0, 1, 2, 1, 2, 3, 2, 1, 2, 3, 4, 3, 2, 3, 2, 1, 2
  0, 1, 2, 3, 2, 1, 2, 3, 2, 3, 4, 3, 2, 1, 2, 3, 2
  0, 1, 2, 3, 2, 3, 4, 3, 2, 1, 2, 3, 2, 3, 4, 3, 2
  0, 1, 2, 1, 2, 3, 4, 3, 2, 3, 2, 1, 2, 3, 4, 3, 2
  0, 1, 2, 3, 2, 3, 4, 3, 2, 3, 4, 5, 4, 3, 4, 3, 2
		

Crossrefs

Transpose of A268833.

Programs

A261349 T(n,k) is the decimal equivalent of a code for k that maximizes the sum of the Hamming distances between (cyclical) adjacent code words; triangle T(n,k), n>=0, 0<=k<=2^n-1, read by rows.

Original entry on oeis.org

0, 0, 1, 0, 3, 1, 2, 0, 7, 1, 6, 3, 4, 2, 5, 0, 15, 1, 14, 3, 12, 2, 13, 6, 9, 7, 8, 5, 10, 4, 11, 0, 31, 1, 30, 3, 28, 2, 29, 6, 25, 7, 24, 5, 26, 4, 27, 12, 19, 13, 18, 15, 16, 14, 17, 10, 21, 11, 20, 9, 22, 8, 23, 0, 63, 1, 62, 3, 60, 2, 61, 6, 57, 7, 56, 5
Offset: 0

Views

Author

Alois P. Heinz, Nov 18 2015

Keywords

Comments

This code might be called "Anti-Gray code".
The sum of the Hamming distances between (cyclical) adjacent code words of row n gives 0, 2, 6, 20, 56, 144, 352, ... = A014480(n-1) for n>1.

Examples

			Triangle T(n,k) begins:
  0;
  0,  1;
  0,  3, 1,  2;
  0,  7, 1,  6, 3,  4, 2,  5;
  0, 15, 1, 14, 3, 12, 2, 13, 6,  9, 7,  8, 5, 10, 4, 11;
  0, 31, 1, 30, 3, 28, 2, 29, 6, 25, 7, 24, 5, 26, 4, 27, 12, 19, ... ;
  0, 63, 1, 62, 3, 60, 2, 61, 6, 57, 7, 56, 5, 58, 4, 59, 12, 51, ... ;
		

Crossrefs

Columns k=0-3 give: A000004, A000225, A000012 (for n>1), A000918 (for n>1).
Row lengths give A000079.
Row sums give A006516.

Programs

  • Maple
    g:= n-> Bits[Xor](n, iquo(n, 2)):
    T:= (n, k)-> (t-> `if`(m=0, t, 2^n-1-t))(g(iquo(k, 2, 'm'))):
    seq(seq(T(n, k), k=0..2^n-1), n=0..6);

Formula

T(n,k) = A003188(k/2) if k even, T(n,k) = 2^n-1-A003188((k-1)/2) else.
A101080(T(n,2k),T(n,2k+1)) = n, A101080(T(n,2k),T(n,2k-1)) = n-1.
T(n,2^n-1) = A083329(n-1) for n>0.
T(n,2^n-2) = A000079(n-2) for n>1.
T(2n,2n) = A003188(n).
T(2n+1,2n+1) = 2*4^n - 1 - A003188(n) = A083420(n) - A003188(n).

A362951 a(n) is the Hamming distance between the binary expansions of n and phi(n) where phi is the Euler totient function (A000010).

Original entry on oeis.org

0, 2, 1, 2, 1, 1, 1, 2, 4, 3, 1, 1, 1, 1, 3, 2, 1, 2, 1, 3, 3, 3, 1, 1, 3, 3, 2, 1, 1, 3, 1, 2, 4, 3, 5, 2, 1, 3, 6, 3, 1, 3, 1, 3, 4, 3, 1, 1, 4, 3, 3, 3, 1, 2, 5, 1, 4, 3, 1, 3, 1, 1, 4, 2, 4, 4, 1, 3, 4, 5, 1, 2, 1, 5, 4, 3, 4, 4, 1, 3, 5, 5, 1, 3, 3, 5, 6
Offset: 1

Views

Author

Darío Clavijo, Jul 05 2023

Keywords

Comments

a(2^k) = 2 for k >= 1.
a(p) = 1 for each odd prime p because phi(p) = p-1 and (p-1 xor p) = 1.

Crossrefs

Programs

  • Mathematica
    A362951[n_] := DigitCount[BitXor[n, EulerPhi[n]], 2, 1];
    Array[A362951, 100] (* Paolo Xausa, Feb 20 2024 *)
  • Python
    from gmpy2 import mpz, hamdist
    from sympy import totient
    a = lambda n: hamdist(mpz(n), mpz(totient(n)))
    print([a(n) for n in range(1, 87)])
    
  • Python
    from sympy import totient
    def A362951(n): return (n^totient(n)).bit_count() # Chai Wah Wu, Jul 07 2023

Formula

a(n) = A101080(n,A000010(n)).
a(n) = A000120(A169814(n)).
Previous Showing 11-18 of 18 results.