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.

A382638 Numbers k for which the repeating part with leading 0's of 1/k in decimal is a palindrome and longer than one digit.

Original entry on oeis.org

1616, 14208, 16160, 17472, 142080, 161600, 174720, 454656, 511488, 838656, 1363968, 1420800, 1578125, 1616000, 1747200, 1818624, 1900992, 4091904, 4265625, 4546560, 4734375, 5114880, 8183808, 8386560, 13639680, 14208000, 15781250, 16160000, 17472000, 18186240, 19009920
Offset: 1

Views

Author

Jean-Marc Rebert, Apr 01 2025

Keywords

Examples

			1616 is a term, because 1/1616 = 0.0006188118811881188118811881188118811881... = 0.0006(1881), where the repeating period 1881 is a palindrome longer than a single digit.
511488 is a term, because 1/511488 = 1.955080080080080080080080080080080080... E-6 = 1.955(080) E-6, where the repeating period O80 is a palindrome longer than a single digit.
11 is not a term, because 1/11 = 0.09090909090909090909090909090909090909... = 0,(09), where the repeating period 09 is not a palindrome .
101 is not a term, because 1/101 = 0.0099009900990099009900990099009900990099 = 0,(0099), where the repeating period 0099 is not a palindrome.
Term 4091904 is itself a palindrome. - _Bert Dobbelaere_, Apr 27 2025
		

Crossrefs

Cf. A382176 (in golden ratio base).

Programs

  • Mathematica
    p[{t_List}]:=t; p[t_List]:={}; p[{, t_List}]:=t; Select[ Range@ 20000, (r = p@ RealDigits[1/#][[1]]; Length@ r > 1 && r == Reverse@ r) &] (* Giovanni Resta, Apr 23 2025 *)
  • Python
    from itertools import count, islice
    from sympy import multiplicity, n_order
    def A382638_gen(startvalue=1): # generator of terms >= startvalue
        for k in count(max(startvalue,1)):
            m2, m5 = multiplicity(2,k), multiplicity(5,k)
            r = max(m2,m5)
            b, m = 10**r, 10**(t:=n_order(10,c) if (c:=(k>>m2)//5**m5)>1 else 1)-1
            s = str(m*b//k-b//k*m).zfill(t)
            if len(s)>1 and s[:(l:=len(s)+1>>1)]==s[:-l-1:-1]:
                yield k
    A382638_list = list(islice(A382638_gen(),4)) # Chai Wah Wu, Apr 22 2025

Extensions

More terms from Bert Dobbelaere, Apr 27 2025