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-2 of 2 results.

A355716 a(n) is the smallest number that has exactly n binary palindrome divisors (A006995).

Original entry on oeis.org

1, 3, 9, 15, 99, 45, 135, 189, 315, 495, 945, 765, 2079, 6237, 3465, 5355, 4095, 8415, 31185, 20475, 25245, 12285, 85995, 58905, 61425, 45045, 69615, 176715, 446985, 225225, 328185, 208845, 135135, 405405, 528255, 1396395, 675675, 2027025, 765765, 5360355, 2993445, 3968055, 3828825
Offset: 1

Views

Author

Bernard Schott, Jul 15 2022

Keywords

Examples

			a(4) = 15 since 15 has 4 divisors {1, 3, 5, 15} that are all palindromes when written in binary: 1, 11, 101 and 1111; no positive integer smaller than 15 has four divisors that are binary palindromes, hence a(4) = 15.
a(5) = 99 since 99 has 6 divisors {1, 3, 9, 11, 33, 99} of which only 11 is not a palindrome when written in binary: 11_10 = 1011_2; no positive integer smaller than 99 has five divisors that are binary palindromes, hence a(5) = 99.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := DivisorSum[n, 1 &, PalindromeQ[IntegerDigits[#, 2]] &]; seq[len_, nmax_] := Module[{s = Table[0, {len}], c = 0, n = 1, i}, While[c < len && n < nmax, i = f[n]; If[i <= len && s[[i]] == 0, c++; s[[i]] = n]; n++]; s]; seq[25, 10^5] (* Amiram Eldar, Jul 15 2022 *)
  • PARI
    is(n) = my(d=binary(n)); d==Vecrev(d); \\ A006995
    a(n) = my(k=1); while (sumdiv(k, d, is(d)) != n, k++); k; \\ Michel Marcus, Jul 15 2022
    
  • Python
    from sympy import divisors
    from itertools import count, islice
    def c(n): b = bin(n)[2:]; return b == b[::-1]
    def f(n): return sum(1 for d in divisors(n, generator=True) if c(d))
    def agen():
        n, adict = 1, dict()
        for k in count(1):
            fk = f(k)
            if fk not in adict: adict[fk] = k
            while n in adict: yield adict[n]; n += 1
    print(list(islice(agen(), 20))) # Michael S. Branicky, Jul 23 2022

Extensions

More terms from Michael S. Branicky, Jul 15 2022

A331897 Positive numbers all of whose divisors are negabinary palindromes (A331891) with a record number of divisors.

Original entry on oeis.org

1, 3, 21, 5397, 353703189
Offset: 1

Views

Author

Amiram Eldar, Jan 30 2020

Keywords

Comments

A number m is in this sequence if it is in A331896, and d(m) > d(k) for all terms k < m in A331896, where d(m) is the number of divisors of m (A000005).
The corresponding number of divisors are 1, 2, 4, 8, 16, ...
Apparently the terms are squarefree products of Mersenne primes (A000668) and Fermat primes (A019434).
a(6) <= 3301173437325733061894777515.

Examples

			21 is a term since all the divisors of 21, {1, 3, 7, 21}, are palindromes in negabinary representation: {1, 111, 11011, 10101}, and it has 4 divisors, more than the number of divisors of smaller numbers with this property: 1, 3, 5, 7, 11, and 17 have no more than 2 divisors.
		

Crossrefs

Programs

  • Mathematica
    negabin[n_] := negabin[n] = If[n==0, 0, negabin[Quotient[n-1, -2]]*10 + Mod[n, 2]];
    negaBinPalQ[n_] := PalindromeQ[negabin[n]];
    negaBinAllDivPalQ[n_] := negaBinPalQ[n] && AllTrue[Most @ Divisors[n], negaBinPalQ];
    divNumMax = 0; seq={}; Do[If[negaBinAllDivPalQ[n] && (divNum = DivisorSigma[0, n]) > divNumMax, divNumMax = divNum; AppendTo[seq, n]], {n, 1, 6000}]; seq
Showing 1-2 of 2 results.