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.

A261073 Semiprimes whose prime factors are of equal binary length and which differ from each other in one bit position only.

Original entry on oeis.org

6, 35, 323, 437, 713, 899, 1763, 1961, 2021, 2537, 3233, 4757, 5561, 5609, 6497, 7313, 9797, 10403, 10961, 11009, 18209, 19043, 21353, 22499, 23393, 26969, 27221, 29177, 37001, 38021, 39203, 45113, 71273, 72899, 79523, 87953, 95477, 98201, 99221, 106793, 114857, 114929, 123353
Offset: 1

Views

Author

Antti Karttunen, Sep 22 2015

Keywords

Examples

			6 = 2*3 is present, as 2 in binary is "10" and 3 in binary is "11", so both have two (significant) bits and they differ only in one bit-position from each other.
35 = 5*7 is present, as 5 in binary is "101" and 7 in binary is "111", which both have three bits, differing only in the middle position from each other.
		

Crossrefs

Cf. also A261074, A261075.
Cf. A071697 (a subsequence).
Intersection of A085721 and A261077.

Programs

  • Mathematica
    Select[Range[10^6], And[Length@ # == 2, IntegerLength[#1, 2] == IntegerLength[#2, 2] & @@ #, Total@ BitXor[IntegerDigits[#1, 2], IntegerDigits[#2, 2]] == 1 & @@ #] &@ 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]));
    isA261073(n) = { my(a,b); if(bigomega(n)!=2, 0, a=A020639(n); b = (n/a); ((A000523(a) == A000523(b)) && (1 == norml2(binary(bitxor(a,b)))))); };
    i=0; n=0; while(i < 5000, n++; if(isA261073(n), i++; write("b261073.txt", i, " ", n)));
    
  • Scheme
    ;; With Antti Karttunen's IntSeq-library.
    (define A261073 (MATCHING-POS 1 1 (lambda (n) (and (= 2 (A001222 n)) (= (A000523 (A020639 n)) (A000523 (A006530 n))) (= 1 (A101080bi (A020639 n) (A006530 n)))))))

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.

A261078 Semiprimes p*q such that q = p + 2^k for some k >= 0.

Original entry on oeis.org

6, 15, 21, 33, 35, 57, 65, 77, 143, 161, 185, 201, 209, 221, 323, 377, 393, 437, 473, 497, 713, 899, 1073, 1457, 1517, 1529, 1577, 1763, 1769, 1841, 1961, 2021, 2537, 2993, 3233, 3473, 3497, 3599, 3713, 3737, 3953, 4553, 4601, 4757, 5183, 5561, 5609, 5753, 6497, 6557, 7217, 7313, 8633, 8777, 9593, 9797, 10001, 10265, 10403, 10841, 10961, 11009, 11021
Offset: 1

Views

Author

Antti Karttunen, Sep 22 2015

Keywords

Comments

Terms ending with digit 5 (in decimal) are very rare, because terms of A123250 are rare.

Examples

			6 = 2*3 is present as 3 = 2 + 2^0.
15 = 3*5 is present as 5 = 3 + 2^1.
35 = 5*7 is present as 7 = 5 + 2^1.
		

Crossrefs

Cf. also A261073, A261077 (subsequences).

Programs

  • PARI
    A020639(n) = if(1==n,n,vecmin(factor(n)[, 1]));
    isA261078(n) = { my(d); if(bigomega(n)!=2, return(0), d = (n/A020639(n)) - A020639(n); (d && !bitand(d,d-1))); };
    i=0; n=0; while(i < 10000, n++; if(isA261078(n), i++; write("b261078.txt", i, " ", n)));
    
  • Scheme
    ;; With Antti Karttunen's IntSeq-library.
    (define A261078 (MATCHING-POS 1 1 (lambda (n) (and (= 2 (A001222 n)) (pow2? (- (A006530 n) (A020639 n)))))))
    (define (pow2? n) (and (> n 0) (zero? (A004198bi n (- n 1))))) ;; A004198bi implements bitwise-AND (Cf. A004198)

A261080 Semiprimes p*q for which p and q are successive primes and their binary representations differ from each other in one bit position only.

Original entry on oeis.org

6, 35, 323, 437, 899, 1763, 2021, 4757, 9797, 10403, 19043, 22499, 27221, 38021, 39203, 72899, 79523, 95477, 99221, 131753, 145157, 154433, 164009, 205193, 210677, 213443, 250997, 272483, 324899, 381923, 412163, 416021, 455621, 549077, 557993, 594437, 656099, 675683, 736163, 741317, 777923, 783221, 826277, 870473, 881717, 974153, 1022117, 1102499, 1127843, 1238753
Offset: 1

Views

Author

Antti Karttunen, Sep 23 2015

Keywords

Comments

Numbers n for which A260737(n) = A261079(n) = 1.

Examples

			6 is included as 6 = 2*3, 2 and 3 are successive primes, and 2 (in binary "10") and 3 (in binary "11") differ by only one bit from each other.
		

Crossrefs

Intersection of A006094 and A261077.

Programs

  • Mathematica
    brdQ[{a_,b_}]:=Module[{c=IntegerDigits[a,2],d=IntegerDigits[b,2]}, Length[ c] == Length[d]&&Count[Total/@Transpose[{c,d}],1]==1]; Times@@@ Select[ Partition[Prime[Range[200]],2,1],brdQ] (* Harvey P. Dale, Jan 29 2016 *)

Formula

a(n) = A205511(n) * A205302(n).
Showing 1-4 of 4 results.