login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A093888 Largest palindromic divisor of n!. 5
1, 1, 2, 6, 8, 8, 9, 252, 252, 252, 48384, 48384, 48384, 48384, 525525, 525525, 525525, 595595, 595595, 969969, 969969, 969969, 405909504, 5273993725, 5273993725, 5273993725, 5273993725, 5273993725, 5273993725, 5273993725, 5273993725, 290826628092, 290826628092, 290826628092 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
As positive palindromes do not end in 0 terms are not a multiple of 10. - David A. Corneth, Oct 07 2022
LINKS
Michael S. Branicky, Table of n, a(n) for n = 0..60 (terms 1..40 from David A. Corneth)
FORMULA
a(n) = A093030(A000142(n)). - Michel Marcus, Oct 12 2022
EXAMPLE
a(8) = 252 as 252 is the largest palindrome that divides 8! = 40320.
MATHEMATICA
Table[SelectFirst[Reverse[Divisors[n!]], PalindromeQ], {n, 30}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Nov 19 2020 *)
PROG
(PARI) a(n) = { res = 1; my(d = divisors(n! >> val(n, 2))); forstep(i = #d, 1, -1, if(ispal(d[i]), res = d[i]; break; ) ); d = divisors(n! / 5^val(n, 5)); forstep(i = #d, 1, -1, if(d[i] < res, return(res); ); if(ispal(d[i]), res = d[i]; break; ) ); res }
ispal(n) = my(d = digits(n)); d == Vecrev(d)
val(n, p) = my(r=0); while(n, r+=n\=p); r \\ David A. Corneth, Oct 07 2022
(Python)
from sympy import divisors, factorial, multiplicity
def ispal(n): s = str(n); return s == s[::-1]
def b(n, k): f = factorial(n); return f//k**multiplicity(k, f)
def a(n):
m2 = max(d for d in divisors(b(n, 2), generator=True) if ispal(d))
m5 = max(d for d in divisors(b(n, 5), generator=True) if ispal(d))
return max(m2, m5)
print([a(n) for n in range(34)]) # Michael S. Branicky, Oct 12 2022 after David A. Corneth
CROSSREFS
Sequence in context: A236676 A021376 A243311 * A136702 A328910 A064165
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Apr 23 2004
EXTENSIONS
More terms from Jason Earls, May 07 2004
a(0) and more terms from David A. Corneth, Oct 07 2022
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 20:08 EDT 2024. Contains 371963 sequences. (Running on oeis4.)