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.

A093889 a(n) = n!/A093888(n).

Original entry on oeis.org

1, 1, 1, 1, 3, 15, 80, 20, 160, 1440, 75, 825, 9900, 128700, 165888, 2488320, 39813120, 597196800, 10749542400, 125411328000, 2508226560000, 52672757760000, 2769091920000, 4901791334400, 117642992025600, 2941074800640000, 76467944816640000, 2064634510049280000, 57809766281379840000, 1676483222160015360000
Offset: 0

Views

Author

Amarnath Murthy, Apr 23 2004

Keywords

Examples

			a(4) = 3 as the largest palindromic divisor of 4! comes from the set {1, 2, 3, 4, 6, 8, 12, 24}. The largest palindrome is this set is 8 so a(4) = 4! / 8 = 3. - _David A. Corneth_, Oct 12 2022
		

Crossrefs

Programs

  • Python
    from sympy import divisors, factorial, multiplicity
    def ispal(n): s = str(n); return s == s[::-1]
    def b(f, k): return f//k**multiplicity(k, f)
    def a(n):
        f = factorial(n)
        m2 = max(d for d in divisors(b(f, 2), generator=True) if ispal(d))
        m5 = max(d for d in divisors(b(f, 5), generator=True) if ispal(d))
        return f//max(m2, m5)
    print([a(n) for n in range(34)]) # Michael S. Branicky, Oct 12 2022

Extensions

Corrected and extended by Jason Earls, May 07 2004
a(0) and more terms from David A. Corneth, Oct 07 2022

A093030 Largest palindromic divisor of n.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 5, 11, 6, 1, 7, 5, 8, 1, 9, 1, 5, 7, 22, 1, 8, 5, 2, 9, 7, 1, 6, 1, 8, 33, 2, 7, 9, 1, 2, 3, 8, 1, 7, 1, 44, 9, 2, 1, 8, 7, 5, 3, 4, 1, 9, 55, 8, 3, 2, 1, 6, 1, 2, 9, 8, 5, 66, 1, 4, 3, 7, 1, 9, 1, 2, 5, 4, 77, 6, 1, 8, 9, 2, 1, 7, 5, 2, 3, 88, 1, 9, 7, 4, 3, 2, 5, 8, 1, 7, 99, 5, 101
Offset: 1

Views

Author

Jason Earls, May 07 2004

Keywords

Crossrefs

Cf. A093888.

Programs

  • Mathematica
    a[n_] := Module[{d = Divisors[n]}, k = Length[d]; While[!PalindromeQ[d[[k]]], k--]; d[[k]]]; Array[a, 101] (* Amiram Eldar, Dec 16 2019 *)

A339508 Number of subsets of {2..n} such that the product of the elements is a decimal palindrome.

Original entry on oeis.org

1, 1, 2, 4, 6, 7, 8, 10, 11, 13, 13, 33, 43, 56, 70, 73, 99, 114, 134, 151, 151, 185, 333, 372, 445, 456, 558, 565, 672, 1031, 1031, 1220, 1518, 1967, 2161, 2176, 2238, 5399, 5543, 6720, 6720, 8857, 10019, 11819, 16882, 16896, 18072, 19299, 21267, 23405, 23405, 24686
Offset: 0

Views

Author

Ilya Gutkovskiy, Dec 07 2020

Keywords

Comments

a(k*10) = a(k*10-1) because all new products end in 0, thus not palindromes. - Michael S. Branicky, Dec 08 2020

Examples

			a(9) = 13 subsets: {}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {2, 3}, {2, 4}, {4, 7, 9} and {2, 3, 6, 7}.
		

Crossrefs

Programs

  • Python
    from numpy import prod
    from itertools import combinations
    def a(n):
        ans = 1  # empty set
        for r in range(1, n):
            for s in combinations(range(2, n+1), r):
                strsp = str(prod(s))
                ans += strsp==strsp[::-1]
        return ans
    print([a(n) for n in range(20)])  # Michael S. Branicky, Dec 08 2020
    
  • Python
    from functools import lru_cache, reduce
    from operator import mul
    from itertools import combinations
    @lru_cache(maxsize=None)
    def A339508(n):
        nlist = [i for i in range(2,n) if i % 10 != 0]
        if n == 0 or n == 1:
            return 1
        c = A339508(n-1)
        if n % 10 != 0:
            if str(n) == str(n)[::-1]:
                c += 1
            for i in range(1,len(nlist)+1):
                for d in combinations(nlist,i):
                    s = str(reduce(mul,d)*n)
                    if s == s[::-1]:
                        c += 1
        return c # Chai Wah Wu, Dec 08 2020
    
  • Python
    from functools import lru_cache
    def cond(p): sp = str(p); return sp == sp[::-1]
    @lru_cache(maxsize=None)
    def b(n, p):
        if n == 1: return int(cond(p))
        return b(n-1, p) + b(n-1, p*n) if p*n%10 else b(n-1, p)
    def a(n): return 1 if n < 2 else b(n, 1)
    print([a(n) for n in range(36)]) # Michael S. Branicky, Oct 05 2022

Extensions

a(23)-a(32) from Michael S. Branicky, Dec 08 2020
a(33)-a(42) from Chai Wah Wu, Dec 08 2020
a(43)-a(48) from Chai Wah Wu, Dec 11 2020
a(49)-a(51) from Michael S. Branicky, Oct 05 2022

A114340 Largest palindromic divisor of n!! (double factorial = A006882(n)).

Original entry on oeis.org

1, 2, 3, 8, 5, 8, 7, 8, 9, 8, 99, 9, 9009, 252, 9009, 252, 9009, 48384, 969969, 48384, 969969, 405504, 969969, 405504, 969969, 405504, 969969, 525525, 969969, 525525, 79833897, 525525, 133464331, 595595, 5273993725, 595595
Offset: 1

Views

Author

Giovanni Resta, Feb 07 2006

Keywords

Examples

			a(16)=252 since 252 is the largest palindromic factor of 16!!= 10321920=252* 40960.
		

Crossrefs

Programs

  • Mathematica
    palQ[n_]:= n == FromDigits@Reverse@IntegerDigits@n; Array[Max[Select[Divisors[ #!! ], palQ]] &, 40]

Formula

a(n) = A093030(A006882(n)). - Michel Marcus, Oct 13 2022
Showing 1-4 of 4 results.