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.

Previous Showing 51-60 of 829 results. Next

A029953 Palindromic in base 6.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 7, 14, 21, 28, 35, 37, 43, 49, 55, 61, 67, 74, 80, 86, 92, 98, 104, 111, 117, 123, 129, 135, 141, 148, 154, 160, 166, 172, 178, 185, 191, 197, 203, 209, 215, 217, 259, 301, 343, 385, 427, 434, 476, 518, 560, 602, 644, 651, 693, 735, 777, 819
Offset: 1

Views

Author

Keywords

Comments

Cilleruelo, Luca, & Baxter prove that this sequence is an additive basis of order (exactly) 3. - Charles R Greathouse IV, May 03 2020

Crossrefs

Palindromes in bases 2 through 10: A006995, A014190, A014192, A029952, A029953, A029954, A029803, A029955, A002113.

Programs

  • Magma
    [n: n in [0..900] | Intseq(n, 6) eq Reverse(Intseq(n, 6))]; // Vincenzo Librandi, Sep 09 2015
    
  • Mathematica
    f[n_,b_] := Module[{i=IntegerDigits[n,b]}, i==Reverse[i]]; lst={}; Do[If[f[n,6], AppendTo[lst,n]], {n,1000}]; lst (* Vladimir Joseph Stephan Orlovsky, Jul 08 2009 *)
  • PARI
    ispal(n,b=6)=my(d=digits(n,b)); d==Vecrev(d) \\ Charles R Greathouse IV, May 03 2020
    
  • Python
    from gmpy2 import digits
    from sympy import integer_log
    def A029953(n):
        if n == 1: return 0
        y = 6*(x:=6**integer_log(n>>1,6)[0])
        return int((c:=n-x)*x+int(digits(c,6)[-2::-1]or'0',6) if nChai Wah Wu, Jun 14 2024

Formula

Sum_{n>=2} 1/a(n) = 3.03303318... (Phunphayap and Pongsriiam, 2019). - Amiram Eldar, Oct 17 2020

A062687 Numbers all of whose divisors are palindromic.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 66, 77, 88, 99, 101, 121, 131, 151, 181, 191, 202, 242, 262, 303, 313, 353, 363, 373, 383, 393, 404, 484, 505, 606, 626, 707, 727, 757, 787, 797, 808, 909, 919, 929, 939, 1111, 1331, 1441, 1661, 1991, 2222, 2662
Offset: 1

Views

Author

Erich Friedman, Jul 04 2001

Keywords

Examples

			The divisors of 44 are 1, 2, 4, 11, 22 and 44, which are all palindromes, so 44 is in the sequence.
808 has divisors are 1, 2, 4, 8, 101, 202, 404, 808, so 808 is in the sequence.
818 is palindromic, but since it's 2 * 409, it's not in the sequence.
		

Crossrefs

Cf. A087991, A084325, A002385 (subset).
Subsequence of A002113.

Programs

  • Maple
    isA062687 := proc(n)
        for d in numtheory[divisors](n) do
            if not isA002113(d) then
                return false;
            end if;
        end do;
        true ;
    end proc: # R. J. Mathar, Sep 09 2015
  • Mathematica
    palQ[n_] := Module[{idn = IntegerDigits[n]}, idn == Reverse[idn]]; Select[Range[2750], And@@palQ/@Divisors[#] &] (* Harvey P. Dale, Feb 27 2012 *)
  • PARI
    isok(n) = {d = divisors(n); rd = vector(#d, i, subst(Polrev(digits(d[i])), x, 10)); (d == rd);} \\ Michel Marcus, Oct 10 2014

A055483 a(n) is the GCD of n and the reverse of n.

Original entry on oeis.org

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

Views

Author

Erich Friedman, Jun 27 2000

Keywords

Comments

a(A226778(n)) = 1; a(A071249(n)) > 1. - Reinhard Zumkeller, Jun 18 2013
a(n) = n iff n >= 1 is a palindrome (n is in A002113). - Felix Fröhlich, Oct 28 2014

Examples

			a(12) = 3 since gcd(12, 21) = 3.
a(13) = 1 since 13 and 31 are coprime.
a(101) = gcd(101, 101) = 101.
		

Crossrefs

Different from A069652, first differs at a(101), since gcd(101, 110) = 1.

Programs

  • Haskell
    a055483 n = gcd n $ a004086 n  -- Reinhard Zumkeller, Jun 18 2013
    
  • Magma
    [Gcd(n, Seqint(Reverse(Intseq(n)))): n in [1..100]]; // Vincenzo Librandi, Oct 29 2014
    
  • Mathematica
    gcn[n_] := GCD[n, IntegerReverse[n]]; Array[gcn, 120] (* Harvey P. Dale, Jan 23 2012 *)
  • PARI
    a004086(n)=eval(concat(Vecrev(Str(n))))
    a(n)=gcd(n, a004086(n)) \\ Felix Fröhlich, Oct 28 2014
    
  • Python
    from math import gcd
    def a(n): return gcd(n, int(str(n)[::-1]))
    print([a(n) for n in range(1, 112)]) # Michael S. Branicky, Aug 31 2021
  • Scala
    def reverseDigits(n: Int): Int = Integer.parseInt(n.toString.reverse)
    def euclGCD(a: Int, b: Int): Int = b match { case 0 => a; case n => Math.abs(euclGCD(b, a % b)) }
    (1 to 120).map(n => euclGCD(n, reverseDigits(n))) // Alonso del Arte, Aug 31 2021
    

Formula

a(n) = gcd(n, A004086(n)). - Felix Fröhlich, Oct 28 2014
3 | a(n) if 3 | n and 9 | a(n) if 9 | n. - Alonso del Arte, Aug 31 2021

Extensions

Edited by Robert G. Wilson v, Apr 10 2002

A035137 Numbers that are not the sum of 2 palindromes (where 0 is considered a palindrome).

Original entry on oeis.org

21, 32, 43, 54, 65, 76, 87, 98, 201, 1031, 1041, 1042, 1051, 1052, 1053, 1061, 1062, 1063, 1064, 1071, 1072, 1073, 1074, 1075, 1081, 1082, 1083, 1084, 1085, 1086, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1099, 1101, 1103, 1104, 1105, 1106, 1107, 1108
Offset: 1

Views

Author

Patrick De Geest, Nov 15 1998

Keywords

Comments

Apparently, every positive number is equal to the sum of at most 3 positive palindromes. - Giovanni Resta, May 12 2013
A260254(a(n)) = 0. - Reinhard Zumkeller, Jul 21 2015
A261675(a(n)) >= 3 (and, conjecturally, = 3). - N. J. A. Sloane, Sep 03 2015
This sequence is infinite. Proof: It is easy to see that 200...01 (with any number of zeros) cannot be the sum of two palindromes. - N. J. A. Sloane, Sep 03 2015
The conjecture that every number is the sum of 3 palindromes fails iff there is a term a(n) such that for all palindromes P < a(n), the difference a(n) - P is also a term of this sequence. - M. F. Hasler, Sep 08 2015
Cilleruelo and Luca (see links) have proved the conjecture that every positive integer is the sum of at most three palindromes (in bases >= 5), and also that the density of those that require three is positive. - Christopher E. Thompson, Apr 14 2016

Crossrefs

Cf. A260254, A260255 (complement), A002113, A261906, A261907.
Cf. A319477 (disallowing zero).

Programs

  • Haskell
    a035137 n = a035137_list !! (n-1)
    a035137_list = filter ((== 0) . a260254) [0..]
    -- Reinhard Zumkeller, Jul 21 2015
    
  • Maple
    N:= 4: # to get all terms with <= N digits
    revdigs:= proc(n) local L,j,nL;
      L:= convert(n,base,10); nL:= nops(L);
      add(L[j]*10^(nL-j),j=1..nL);
    end proc;
    palis:= $0..9:
    for d from 2 to N do
      if d::even then
        palis:= palis, seq(x*10^(d/2)+revdigs(x),x=10^(d/2-1)..10^(d/2)-1)
      else
        palis:= palis, seq(seq(x*10^((d+1)/2)+y*10^((d-1)/2)+revdigs(x),y=0..9),x=10^((d-3)/2)..10^((d-1)/2)-1);
      fi
    od:
    palis:= [palis]:
    A:= Array(0..10^N-1):
    A[palis]:= 1:
    B:= SignalProcessing:-Convolution(A,A):
    select(t -> B[t+1] < 0.5, [$1..10^N-1]); # Robert Israel, Jun 22 2015
  • Mathematica
    palQ[n_]:=FromDigits[Reverse[IntegerDigits[n]]]==n; nn=1108; t={}; Do[i=c=0; While[i<=n && c!=1,If[palQ[i] && palQ[n-i], AppendTo[t,n]; c=1]; i++],{n,nn}]; Complement[Range[nn],t] (* Jayanta Basu, May 12 2013 *)
  • PARI
    is_A035137(n)={my(k=0);!until(n<2*k=nxt(k),is_A002113(n-k)&&return)} \\ Uses function nxt() given in A002113. Not very efficient for large n, better start with k=n-A261423(n). Maybe also better use A261423 rather than nxt(). - M. F. Hasler, Jul 21 2015

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

A050782 Smallest positive multiplier m such that m*n is palindromic (or zero if no such m exists).

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 21, 38, 18, 35, 17, 16, 14, 9, 0, 12, 1, 7, 29, 21, 19, 37, 9, 8, 0, 14, 66, 1, 8, 15, 7, 3, 13, 15, 0, 16, 6, 23, 1, 13, 9, 3, 44, 7, 0, 19, 13, 4, 518, 1, 11, 3, 4, 13, 0, 442, 7, 4, 33, 9, 1, 11, 4, 6, 0, 845, 88, 4, 3, 7, 287, 1, 11, 6, 0, 12345679, 8
Offset: 0

Views

Author

Patrick De Geest, Oct 15 1999

Keywords

Comments

Multiples of 81 require the largest multipliers.
From Jon E. Schoenfield, Jan 15 2015: (Start)
In general, a(n) is large when n is a multiple of 81. E.g., for n in [1..10000], of the 9000 terms where a(n)>0, 111 are at indices n that are multiples of 81; of the remaining 8889 terms,
755 are in [1..9],
1760 are in [10..99],
3439 are in [100..999],
2180 are in [1000..9999],
708 are in [10000..99999],
36 are in [100000..999999],
6 are in [1000000..9999999],
2 are in [10000000..99999999],
2 are in [100000000..999999999],
and 1 (the largest) is a(8891) = 8546948927,
but the smallest of the 111 terms whose indices are multiples of 81 is a(2997)=333667. (End)
a(n) = 0 iff 10 | n. a(n) = 1 iff n is a palindrome. If k | a(n) then a(k*n) = a(n)/k. - Robert Israel, Jan 15 2015

Examples

			E.g., a(81) -> 81 * 12345679 = 999999999 and a palindrome.
		

Crossrefs

Programs

  • Maple
    digrev:= proc(n) local L,d,i;
      L:= convert(n,base,10);
      d:= nops(L);
      add(L[i]*10^(d-i),i=1..d);
    end proc:
    f:= proc(n)
    local d,d2,x,t,y;
    if n mod 10 = 0 then return 0 fi;
    if n < 10 then return 1 fi;
    for d from 2 do
      if d::even then
        d2:= d/2;
        for x from 10^(d2-1) to 10^d2-1 do
           t:= x*10^d2 + digrev(x);
           if t mod n = 0 then return(t/n) fi;
        od
      else
        d2:= (d-1)/2;
        for x from 10^(d2-1) to 10^d2-1 do
          for y from 0 to 9 do
            t:= x*10^(d2+1)+y*10^d2+digrev(x);
            if t mod n = 0 then return(t/n) fi;
          od
        od
      fi
    od;
    end proc:
    seq(f(n),n=0 .. 100); # Robert Israel, Jan 15 2015
  • Mathematica
    t={0}; Do[i=1; If[IntegerQ[n/10],y=0,While[Reverse[x=IntegerDigits[i*n]]!=x,i++]; y=i]; AppendTo[t,y],{n,80}]; t (* Jayanta Basu, Jun 01 2013 *)
  • Python
    from _future_ import division
    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
    def A050782(n, l=10):
        if n % 10:
            x = palgen(l)
            next(x)  # replace with x.next() in Python 2.x
            for i in x:
                q, r = divmod(i, n)
                if not r:
                    return q
            else:
                return 'search limit reached.'
        else:
            return 0 # Chai Wah Wu, Dec 30 2014

A261422 Number of ordered triples (u,v,w) of palindromes such that u+v+w=n.

Original entry on oeis.org

1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 63, 72, 79, 84, 87, 88, 87, 84, 79, 72, 66, 55, 51, 45, 40, 36, 33, 31, 30, 30, 30, 33, 27, 34, 33, 33, 33, 33, 33, 33, 33, 33, 36, 27, 39, 36, 36, 36, 36, 36, 36, 36, 36, 39, 27, 45, 39, 39, 39, 39, 39, 39, 39, 39, 42, 27, 52, 42, 42, 42, 42, 42, 42, 42, 42, 45
Offset: 0

Views

Author

N. J. A. Sloane, Aug 27 2015

Keywords

Comments

It is known that a(n)>0 for all n.

Examples

			4 can be written as a sum of three palindromes in 15 ways: 4+0+0 (3 ways), 3+1+0 (6 ways), 2+2+0 (3 ways), and 2+1+1 (3 ways), so a(4)=15.
		

Crossrefs

Cf. A002113. Differs from A261132, which assumes 0 <= u <= v <= w.
For records see A262544, A262545.

Programs

  • Mathematica
    (* This program is not suitable to compute a large number of terms. *)
    compositions[n_, k_] := Flatten[Permutations[PadLeft[#, k]]& /@ IntegerPartitions[n, k], 1];
    a[n_] := Select[compositions[n, 3], AllTrue[#, PalindromeQ]&] // Length;
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Aug 05 2018 *)

Formula

G.f. = P(x)^3, where P(x) = 1 + x + x^2 + x^3 + x^4 + x^5 + x^6 + x^7 + x^8 + x^9 + x^11 + x^22 + x^33 + x^44 + x^55 + x^66 + x^77 + x^88 + x^99 + x^101 + x^111 + ... = Sum_{palindromes p} x^p.

A331191 Numbers whose dual Zeckendorf representations (A104326) are palindromic.

Original entry on oeis.org

0, 1, 3, 4, 6, 11, 12, 16, 19, 22, 32, 33, 38, 42, 48, 53, 64, 71, 87, 88, 98, 106, 110, 118, 124, 134, 142, 148, 174, 194, 205, 231, 232, 245, 255, 271, 284, 288, 304, 317, 323, 336, 346, 362, 375, 402, 420, 462, 474, 516, 548, 566, 608, 609, 635, 656, 666, 687
Offset: 1

Views

Author

Amiram Eldar, Jan 11 2020

Keywords

Comments

Pairs of numbers of the form {F(2*k-1)-2, F(2*k-1)-1}, for k >= 2, where F(k) is the k-th Fibonacci number, are consecutive terms in this sequence: {0, 1}, {3, 4}, {11, 12}, {32, 33}, ... - Amiram Eldar, Sep 03 2022

Examples

			4 is a term since its dual Zeckendorf representation, 101, is palindromic.
		

Crossrefs

Programs

  • Mathematica
    mirror[dig_, s_] := Join[dig, s, Reverse[dig]];
    select[v_, mid_] := Select[v, Length[#] == 0 || Last[#] != mid &];
    fib[dig_] := Plus @@ (dig * Fibonacci[Range[2, Length[dig] + 1]]);
    pals = Join[{{}}, Rest[Select[IntegerDigits[Range[0, 2^6 - 1], 2], SequenceCount[#, {0, 0}] == 0 &]]];
    Union@Join[{0}, fib /@ Join[mirror[#, {}] & /@ (select[pals, 0]), mirror[#, {0}] & /@ (select[pals, 0]), mirror[#, {1}] & /@ pals]]

A008509 Positive integers k such that k-th triangular number is palindromic.

Original entry on oeis.org

1, 2, 3, 10, 11, 18, 34, 36, 77, 109, 132, 173, 363, 1111, 1287, 1593, 1833, 2662, 3185, 3369, 3548, 8382, 11088, 18906, 50281, 57166, 102849, 111111, 167053, 179158, 246642, 337650, 342270, 365436, 417972, 1620621, 3240425, 3457634, 3707883
Offset: 1

Views

Author

Keywords

References

  • Charles W. Trigg, Palindromic Triangular Numbers, J. Rec. Math., 6 (1973), 146-147.
  • D. Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, 93.

Crossrefs

Programs

A032350 Palindromic nonprime numbers.

Original entry on oeis.org

1, 4, 6, 8, 9, 22, 33, 44, 55, 66, 77, 88, 99, 111, 121, 141, 161, 171, 202, 212, 222, 232, 242, 252, 262, 272, 282, 292, 303, 323, 333, 343, 363, 393, 404, 414, 424, 434, 444, 454, 464, 474, 484, 494, 505, 515, 525, 535, 545, 555, 565, 575, 585, 595, 606, 616
Offset: 1

Views

Author

Keywords

Comments

Complement of A002385 (palindromic primes) with respect to A002113 (palindromic numbers). - Jaroslav Krizek, Mar 12 2013
Banks, Hart, and Sakata derive a nontrivial upper bound for the number of prime palindromes n <= x as x tends to infinity. It follows that almost all palindromes are composite. The results hold in any base. The authors use Weil's bound for Kloosterman sums. - Jonathan Sondow, Jan 02 2018

Crossrefs

Programs

  • GAP
    Filtered([1..620],n-> not IsPrime(n) and ListOfDigits(n)=Reversed(ListOfDigits(n))); # Muniru A Asiru, Mar 08 2019
  • Mathematica
    palq[n_] := IntegerDigits[n]==Reverse[IntegerDigits[n]]; Select[Range[700], palq[ # ]&&!PrimeQ[ # ]&]
    (* Second program: *)
    Select[Range@ 616, And[PalindromeQ@ #, ! PrimeQ@ #] &] (* Michael De Vlieger, Jan 02 2018 *)
  • Sage
    [n for n in (1..616) if not is_prime(n) and Word(n.digits()).is_palindrome()] # Peter Luschny, Sep 13 2018
    

Extensions

Edited by Dean Hickerson, Oct 22 2002
Previous Showing 51-60 of 829 results. Next