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

A033620 Numbers all of whose prime factors are palindromes.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 18, 20, 21, 22, 24, 25, 27, 28, 30, 32, 33, 35, 36, 40, 42, 44, 45, 48, 49, 50, 54, 55, 56, 60, 63, 64, 66, 70, 72, 75, 77, 80, 81, 84, 88, 90, 96, 98, 99, 100, 101, 105, 108, 110, 112, 120, 121, 125, 126, 128, 131
Offset: 1

Views

Author

N. J. A. Sloane, May 17 1998

Keywords

Comments

Multiplicative closure of A002385; A051038 and A046368 are subsequences. - Reinhard Zumkeller, Apr 11 2011

Examples

			10 = 2 * 5 is a term since both 2 and 5 are palindromes.
110 = 2 * 5 * 11 is a term since 2, 5 and 11 are palindromes.
		

Crossrefs

Programs

  • Haskell
    a033620 n = a033620_list !! (n-1)
    a033620_list = filter chi [1..] where
       chi n = a136522 spf == 1 && (n' == 1 || chi n') where
          n' = n `div` spf
          spf = a020639 n  -- cf. A020639
    -- Reinhard Zumkeller, Apr 11 2011
    
  • Maple
    N:= 5: # to get all terms of up to N digits
    digrev:= proc(t) local L; L:= convert(t,base,10);
    add(L[-i-1]*10^i,i=0..nops(L)-1);
    end proc:
    PPrimes:= [2,3,5,7,11]:
    for d from 3 to N by 2 do
        m:= (d-1)/2;
        PPrimes:= PPrimes, select(isprime,[seq(seq(n*10^(m+1)+y*10^m+digrev(n), y=0..9), n=10^(m-1)..10^m-1)]);
    od:
    PPrimes:= map(op,[PPrimes]):
    M:= 10^N:
    B:= Vector(M);
    B[1]:= 1:
    for p in PPrimes do
      for k from 1 to floor(log[p](M)) do
         R:= [$1..floor(M/p^k)];
         B[p^k*R] := B[p^k*R] + B[R]
      od
    od:
    select(t -> B[t] > 0, [$1..M]); # Robert Israel, Jul 05 2015
    # alternative
    isA033620:= proc(n)
        for d in numtheory[factorset](n) do
            if not isA002113(op(1,d)) then
                return false;
            end if;
        end do;
        true ;
    end proc:
    for n from 1 to 300 do
        if isA033620(n) then
            printf("%d,",n) ;
        end if;
    end do: # R. J. Mathar, Sep 09 2015
  • Mathematica
    palQ[n_]:=Reverse[x=IntegerDigits[n]]==x; Select[Range[131],And@@palQ/@First/@FactorInteger[#]&] (* Jayanta Basu, Jun 05 2013 *)
  • PARI
    ispal(n)=n=digits(n);for(i=1,#n\2,if(n[i]!=n[#n+1-i],return(0)));1
    is(n)=if(n<13,n>0,vecmin(apply(ispal,factor(n)[,1]))) \\ Charles R Greathouse IV, Feb 06 2013
    
  • Python
    from sympy import isprime, primefactors
    def pal(n): s = str(n); return s == s[::-1]
    def ok(n): return all(pal(f) for f in primefactors(n))
    print(list(filter(ok, range(1, 132)))) # Michael S. Branicky, Apr 06 2021

Formula

Sum_{n>=1} 1/a(n) = Product_{p in A002385} p/(p-1) = 5.0949... - Amiram Eldar, Sep 27 2020

A036326 Composite numbers n such that juxtaposition of prime factors of n has length 2.

Original entry on oeis.org

4, 6, 9, 10, 14, 15, 21, 25, 35, 49
Offset: 1

Views

Author

Patrick De Geest, Dec 15 1998

Keywords

Comments

There are exactly 10 such numbers.

Crossrefs

A046376 Palindromes with exactly 2 palindromic prime factors (counted with multiplicity), and no other prime factors.

Original entry on oeis.org

4, 6, 9, 22, 33, 55, 77, 121, 202, 262, 303, 393, 505, 626, 707, 939, 1111, 1441, 1661, 1991, 3443, 3883, 7997, 10201, 13231, 15251, 18281, 19291, 20602, 22622, 22822, 24842, 26662, 28682, 30903, 31613, 33933, 35653, 37673, 38683, 39993, 60206, 60406, 60806
Offset: 1

Views

Author

Patrick De Geest, Jun 15 1998

Keywords

Comments

Equivalently, semiprime palindromes where both prime factors are palindromes. - Franklin T. Adams-Watters, Apr 11 2011
The sequence "trivially" includes products of palindromic primes p*q where
a) p = 2 or 3 and q has only digits < 4, as q = 11, 101, 131, 10301, 30103, ...
b) p <= 11 and q has only digits 0 and 1, as q = 101 and repunit primes A004022
c) p = 11 and q has only digits spaced out by zeros, as q = 101, 10301, 10501, 10601, 30103, 30203, 30403, 30703, 30803, ... - M. F. Hasler, Jan 04 2022

Examples

			The palindrome 35653 is a term since it has 2 factors, 101 and 353, both palindromic.
		

Crossrefs

Cf. A001358 (semiprimes), A002113 (palindromes), A002385 (palindromic primes).
Subsequence of A188650.

Programs

  • Mathematica
    Take[Select[Times@@@Tuples[Select[Prime[Range[5000]],PalindromeQ],2], PalindromeQ]// Union,50] (* Harvey P. Dale, Aug 25 2019 *)
  • PARI
    {first(N=50, p=1) = vector(N, i, until( bigomega( p=nxt_A002113(p))==2 && vecmin( apply( is_A002113, factor(p)[,1])),); p)} \\ M. F. Hasler, Jan 04 2022
    
  • Python
    from sympy import factorint
    from itertools import product
    def ispal(n): s = str(n); return s == s[::-1]
    def pals(d, base=10): # all d-digit palindromes
        digits = "".join(str(i) for i in range(base))
        for p in product(digits, repeat=d//2):
            if d > 1 and p[0] == "0": continue
            left = "".join(p); right = left[::-1]
            for mid in [[""], digits][d%2]: yield int(left + mid + right)
    def ok(pal):
        f = factorint(pal)
        return sum(f.values()) == 2 and all(ispal(p) for p in f)
    print(list(filter(ok, (p for d in range(1, 6) for p in pals(d) if ok(p))))) # Michael S. Branicky, Aug 14 2022

Formula

Intersection of A002113 and A046368; A188649(a(n)) = a(n). - Reinhard Zumkeller, Apr 11 2011

Extensions

Definition clarified by Franklin T. Adams-Watters, Apr 11 2011
More terms from Lars Blomberg, Nov 06 2015

A046400 Numbers with exactly 2 distinct palindromic prime factors.

Original entry on oeis.org

6, 10, 14, 15, 21, 22, 33, 35, 55, 77, 202, 262, 302, 303, 362, 382, 393, 453, 505, 543, 573, 626, 655, 706, 707, 746, 755, 766, 905, 917, 939, 955, 1057, 1059, 1111, 1119, 1149, 1267, 1337, 1441, 1454, 1514, 1565, 1574, 1594, 1661, 1765, 1838, 1858, 1865
Offset: 1

Views

Author

Patrick De Geest, Jun 15 1998

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[2000], (f = FactorInteger[#])[[;; , 2]] == {1, 1} && And @@ PalindromeQ /@ f[[;; , 1]] &] (* Amiram Eldar, Apr 03 2021 *)

A129112 Decimal expansion of constant equal to concatenated semiprimes.

Original entry on oeis.org

4, 6, 9, 1, 0, 1, 4, 1, 5, 2, 1, 2, 2, 2, 5, 2, 6, 3, 3, 3, 4, 3, 5, 3, 8, 3, 9, 4, 6, 4, 9, 5, 1, 5, 5, 5, 7, 5, 8, 6, 2, 6, 5, 6, 9, 7, 4, 7, 7, 8, 2, 8, 5, 8, 6, 8, 7, 9, 1, 9, 3, 9, 4, 9, 5, 1, 0, 6, 1, 1, 1, 1, 1, 5, 1, 1, 8, 1, 1, 9, 1, 2, 1, 1, 2, 2, 1, 2, 3, 1, 2, 9
Offset: 1

Views

Author

Jonathan Vos Post, May 24 2007

Keywords

Comments

Is this, as Copeland and Erdos (1946) showed for the Copeland-Erdos constant, a normal number in base 10? I conjecture that it is, despite the fact that the density of odd semiprimes exceeds the density of even semiprimes. What are the first few digits of the continued fraction of this constant? What are the positions of the first occurrence of n in the continued fraction? What are the incrementally largest terms and at what positions do they occur?
Coincides up to n=15 with concatenation of A046368. - M. F. Hasler, Oct 01 2007
Indeed, a theorem of Copeland & Erdős proves that this constant is 10-normal. - Charles R Greathouse IV, Feb 06 2015

Examples

			4.691014152122252633343538394649515557586265...
		

Crossrefs

Cf. A001358, A019518, A030168, A033308 = decimal expansion of Copeland-Erdos constant: concatenate primes, A033309-A033311, A129808.

Programs

  • Mathematica
    Flatten[IntegerDigits/@Select[Range[200],PrimeOmega[#]==2&]] (* Harvey P. Dale, Jan 17 2012 *)
  • PARI
    print1(4); for(n=6,129, if(bigomega(n)==2, d=digits(n); for(i=1,#d, print1(", "d[i])))) \\ Charles R Greathouse IV, Feb 06 2015
Showing 1-5 of 5 results.