login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A244423 Nonprime palindromes n such that the product of divisors of n is also a palindrome. 2
1, 4, 22, 111, 121, 202, 1001, 1111, 10001, 10201, 11111, 100001, 1000001, 1001001, 1012101, 1100011, 1101011, 1111111, 10000001, 100000001, 101000101, 110000011, 200010002, 10000000001, 10011111001, 11000100011, 11001010011, 11100100111, 11101010111, 20000100002 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

Primes trivially satisfy this property and are therefore not included in the sequence.

These are the palindromes in A244411.

LINKS

Chai Wah Wu, Table of n, a(n) for n = 1..49

Eric Weisstein's World of Mathematics, Palindromic Number

Index entries for sequences related to palindromes

EXAMPLE

The divisors of 22 are 1, 2, 11 and 22. 1*2*11*22 = 484 is a palindrome. Since 22 is also a palindrome, 22 is a member of this sequence.

MAPLE

with(numtheory); P:=proc(q) local a, b, c, k, n; for n from 1 to q do

if not isprime(n) then a:=n; b:=0; while a>0 do b:=b*10+(a mod 10); a:=trunc(a/10); od;

if b=n then a:=divisors(n); b:=mul(a[k], k=1..nops(a));

a:=b; c:=0; while a>0 do c:=c*10+(a mod 10); a:=trunc(a/10); od; if c=b then print(n);

fi; fi; fi; od; end: P(10^9); # Paolo P. Lava, Jul 04 2014

MATHEMATICA

palQ[n_] := Block[{d = IntegerDigits@ n}, Reverse@ d == d]; lim = 15000000; Select[Complement[Range@ lim, Prime@ Range@ PrimePi@ lim], And[palQ@ #, palQ[Times @@ Divisors@ #]] &] (* Michael De Vlieger, Aug 25 2015 *)

Select[Range[200002*10^5], !PrimeQ[#]&&AllTrue[{#, Times@@Divisors[#]}, PalindromeQ]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 28 2020 *)

PROG

(PARI) rev(n)={r=""; dig=digits(n); for(i=1, #dig, r=concat(Str(dig[i]), r)); return(eval(r))}

for(n=1, 10^8, if(rev(n)==n&&(!isprime(n)), d=divisors(n); ss=prod(j=1, #d, d[j]); if(ss==rev(ss), print1(n, ", "))))

(PARI) /* david(n) returns the n-th palindrome from David A. Corneth, Jun 06 2014 */

david(n)={my(d, i, r); r=vector(#digits(n-10^(#digits(n\11)))+#digits(n\11)); n=n-10^(#digits(n\11)); d=digits(n); for(i=1, #d, r[i]=d[i]; r[#r+1-i]=d[i]); sum(i=1, #r, 10^(#r-i)*r[i])}

rev(n)={r=""; dig=digits(n); for(i=1, #dig, r=concat(Str(dig[i]), r)); return(eval(r))}

for(n=2, 10^6, pal=david(n); if(!isprime(pal), d=divisors(pal); ss=prod(j=1, #d, d[j]); if(ss==rev(ss), print1(pal, ", "))))

(Python)

import sympy

from sympy import isprime

from sympy import divisors

def rev(n):

..r = ""

..for i in str(n):

....r = i + r

..return int(r)

def a():

..for n in range(1, 10**8):

....if rev(n) == n and not isprime(n):

......p = 1

......for i in divisors(n):

........p*=i

......if rev(p)==p:

........print(n, end=', ')

a()

(Python)

from sympy import divisor_count, sqrt

def palgen(l, b=10): # generator of palindromes in base b of length <= 2*l

    if l > 0:

        yield 0

        for x in range(1, l+1):

            n = b**(x-1)

            n2 = n*b

            for y in range(n, n2):

                k, m = y//b, 0

                while k >= b:

                    k, r = divmod(k, b)

                    m = b*m + r

                yield y*n + b*m + k

            for y in range(n, n2):

                k, m = y, 0

                while k >= b:

                    k, r = divmod(k, b)

                    m = b*m + r

                yield y*n2 + b*m + k

A244423_list = [1]

for n in palgen(6):

    d = divisor_count(n)

    if d > 2:

        q, r = divmod(d, 2)

        s = str(n**q*(sqrt(n) if r else 1))

        if s == s[::-1]:

            A244423_list.append(n) # Chai Wah Wu, Aug 25 2015

CROSSREFS

Cf. A244411, A002113.

Sequence in context: A007994 A006651 A159616 * A144047 A077543 A084157

Adjacent sequences:  A244420 A244421 A244422 * A244424 A244425 A244426

KEYWORD

nonn,base

AUTHOR

Derek Orr, Jun 27 2014

EXTENSIONS

Edited name by Chai Wah Wu, Aug 25 2015

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 18 10:11 EDT 2020. Contains 337166 sequences. (Running on oeis4.)