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-10 of 16 results. Next

A002113 Palindromes in base 10.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 66, 77, 88, 99, 101, 111, 121, 131, 141, 151, 161, 171, 181, 191, 202, 212, 222, 232, 242, 252, 262, 272, 282, 292, 303, 313, 323, 333, 343, 353, 363, 373, 383, 393, 404, 414, 424, 434, 444, 454, 464, 474, 484, 494, 505, 515
Offset: 1

Views

Author

Keywords

Comments

n is a palindrome (i.e., a(k) = n for some k) if and only if n = A004086(n). - Reinhard Zumkeller, Mar 10 2002
It seems that if n*reversal(n) is in the sequence then n = 3 or all digits of n are less than 3. - Farideh Firoozbakht, Nov 02 2014
The position of a palindrome within the sequence can be determined almost without calculation: If the palindrome has an even number of digits, prepend a 1 to the front half of the palindrome's digits. If the number of digits is odd, prepend the value of front digit + 1 to the digits from position 2 ... central digit. Examples: 98766789 = a(19876), 515 = a(61), 8206028 = a(9206), 9230329 = a(10230). - Hugo Pfoertner, Aug 14 2015
This sequence is an additive basis of order at most 49, see Banks link. - Charles R Greathouse IV, Aug 23 2015
The order has been reduced from 49 to 3; see the Cilleruelo-Luca and Cilleruelo-Luca-Baxter links. - Jonathan Sondow, Nov 27 2017
See A262038 for the "next palindrome" and A261423 for the "preceding palindrome" functions. - M. F. Hasler, Sep 09 2015
The number of palindromes with d digits is 10 if d = 1, and otherwise it is 9 * 10^(floor((d - 1)/2)). - N. J. A. Sloane, Dec 06 2015
Sequence A033665 tells how many iterations of the Reverse-then-add function A056964 are needed to reach a palindrome; numbers for which this will never happen are Lychrel numbers (A088753) or rather Kin numbers (A023108). - M. F. Hasler, Apr 13 2019
This sequence is an additive basis of order 3, see Cilleruelo, Luca, & Baxter and Sigg. - Charles R Greathouse IV, Apr 08 2025

References

  • Karl G. Kröber, "Palindrome, Perioden und Chaoten: 66 Streifzüge durch die palindromischen Gefilde" (1997, Deutsch-Taschenbücher; Bd. 99) ISBN 3-8171-1522-9.
  • Clifford A. Pickover, A Passion for Mathematics, Wiley, 2005; see p. 71.
  • Alfred S. Posamentier, Math Charmers, Tantalizing Tidbits for the Mind, Prometheus Books, NY, 2003, pages 50-52.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See p. 120.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Subsequence of A061917 and A221221.
A110745 is a subsequence.
Union of A056524 and A056525.
Palindromes in bases 2 through 11: A006995 and A057148, A014190 and A118594, A014192 and A118595, A029952 and A118596, A029953 and A118597, A029954 and A118598, A029803 and A118599, A029955 and A118600, this sequence, A029956. Also A262065 (base 60), A262069 (subsequence).
Palindromic primes: A002385. Palindromic nonprimes: A032350.
Palindromic-pi: A136687.
Cf. A029742 (complement), A086862 (first differences).
Palindromic floor function: A261423, also A261424. Palindromic ceiling: A262038.
Cf. A004086 (read n backwards), A064834, A118031, A136522 (characteristic function), A178788.
Ways to write n as a sum of three palindromes: A261132, A261422.
Minimal number of palindromes that add to n using greedy algorithm: A088601.
Minimal number of palindromes that add to n: A261675.

Programs

  • GAP
    Filtered([0..550],n->ListOfDigits(n)=Reversed(ListOfDigits(n))); # Muniru A Asiru, Mar 08 2019
    
  • Haskell
    a002113 n = a002113_list !! (n-1)
      a002113_list = filter ((== 1) . a136522) [1..] -- Reinhard Zumkeller, Oct 09 2011
    
  • Haskell
    import Data.List.Ordered (union)
      a002113_list = union a056524_list a056525_list -- Reinhard Zumkeller, Jul 29 2015, Dec 28 2011
    
  • Magma
    [n: n in [0..600] | Intseq(n, 10) eq Reverse(Intseq(n, 10))]; // Vincenzo Librandi, Nov 03 2014
    
  • Maple
    read transforms; t0:=[]; for n from 0 to 2000 do if digrev(n) = n then t0:=[op(t0),n]; fi; od: t0;
    # Alternatively, to get all palindromes with <= N digits in the list "Res":
    N:=5;
    Res:= $0..9:
    for d from 2 to N do
      if d::even then
        m:= d/2;
        Res:= Res, seq(n*10^m + digrev(n),n=10^(m-1)..10^m-1);
      else
        m:= (d-1)/2;
        Res:= Res, seq(seq(n*10^(m+1)+y*10^m+digrev(n),y=0..9),n=10^(m-1)..10^m-1);
      fi
    od: Res:=[Res]: # Robert Israel, Aug 10 2014
    # A variant: Gets all base-10 palindromes with exactly d digits, in the list "Res"
    d:=4:
    if d=1 then Res:= [$0..9]:
    elif d::even then
        m:= d/2:
        Res:= [seq(n*10^m + digrev(n), n=10^(m-1)..10^m-1)]:
    else
        m:= (d-1)/2:
        Res:= [seq(seq(n*10^(m+1)+y*10^m+digrev(n), y=0..9), n=10^(m-1)..10^m-1)]:
    fi:
    Res; # N. J. A. Sloane, Oct 18 2015
    isA002113 := proc(n)
        simplify(digrev(n) = n) ;
    end proc: # R. J. Mathar, Sep 09 2015
  • Mathematica
    palQ[n_Integer, base_Integer] := Module[{idn = IntegerDigits[n, base]}, idn == Reverse[idn]]; (* then to generate any base-b sequence for 1 < b < 37, replace the 10 in the following instruction with b: *) Select[Range[0, 1000], palQ[#, 10] &]
    base10Pals = {0}; r = 2; Do[Do[AppendTo[base10Pals, n * 10^(IntegerLength[n] - 1) + FromDigits@Rest@Reverse@IntegerDigits[n]], {n, 10^(e - 1), 10^e - 1}]; Do[AppendTo[base10Pals, n * 10^IntegerLength[n] + FromDigits@Reverse@IntegerDigits[n]], {n, 10^(e - 1), 10^e - 1}], {e, r}]; base10Pals (* Arkadiusz Wesolowski, May 04 2012 *)
    nthPalindromeBase[n_, b_] := Block[{q = n + 1 - b^Floor[Log[b, n + 1 - b^Floor[Log[b, n/b]]]], c = Sum[Floor[Floor[n/((b + 1) b^(k - 1) - 1)]/(Floor[n/((b + 1) b^(k - 1) - 1)] - 1/b)] - Floor[Floor[n/(2 b^k - 1)]/(Floor[n/(2 b^k - 1)] - 1/ b)], {k, Floor[Log[b, n]]}]}, Mod[q, b] (b + 1)^c * b^Floor[Log[b, q]] + Sum[Floor[Mod[q, b^(k + 1)]/b^k] b^(Floor[Log[b, q]] - k) (b^(2 k + c) + 1), {k, Floor[Log[b, q]]}]] (* after the work of Eric A. Schmidt, works for all integer bases b > 2 *)
    Array[nthPalindromeBase[#, 10] &, 61, 0] (* please note that Schmidt uses a different, a more natural and intuitive offset, that of a(1) = 1. - Robert G. Wilson v, Sep 22 2014 and modified Nov 28 2014 *)
    Select[Range[10^3], PalindromeQ] (* Michael De Vlieger, Nov 27 2017 *)
    nLP[cn_Integer]:=Module[{s,len,half,left,pal,fdpal},s=IntegerDigits[cn]; len=Length[s]; half=Ceiling[len/2]; left=Take[s,half]; pal=Join[left,Reverse[ Take[left,Floor[len/2]]]]; fdpal=FromDigits[pal]; Which[cn==9,11,fdpal>cn,fdpal,True,left=IntegerDigits[ FromDigits[left]+1]; pal=Join[left,Reverse[Take[left,Floor[len/2]]]]; FromDigits[pal]]]; NestList[nLP,0,100] (* Harvey P. Dale, Dec 10 2024 *)
  • PARI
    is_A002113(n)=Vecrev(n=digits(n))==n \\ M. F. Hasler, Nov 17 2008, updated Apr 26 2014, Jun 19 2018
    
  • PARI
    is(n)=n=digits(n);for(i=1,#n\2,if(n[i]!=n[#n+1-i],return(0))); 1 \\ Charles R Greathouse IV, Jan 04 2013
    
  • PARI
    a(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])} \\ David A. Corneth, Jun 06 2014
    
  • PARI
    \\ recursive--feed an element a(n) and it gives a(n+1)
    nxt(n)=my(d=digits(n));i=(#d+1)\2;while(i&&d[i]==9,d[i]=0;d[#d+1-i]=0;i--);if(i,d[i]++;d[#d+1-i]=d[i],d=vector(#d+1);d[1]=d[#d]=1);sum(i=1,#d,10^(#d-i)*d[i]) \\ David A. Corneth, Jun 06 2014
    
  • PARI
    \\ feed a(n), returns n.
    inv(n)={my(d=digits(n));q=ceil(#d/2);sum(i=1,q,10^(q-i)*d[i])+10^floor(#d/2)} \\ David A. Corneth, Jun 18 2014
    
  • PARI
    inv_A002113(P)={P\(P=10^(logint(P+!P,10)\/2))+P} \\ index n of palindrome P = a(n), much faster than above: no sum is needed. - M. F. Hasler, Sep 09 2018
    
  • PARI
    A002113(n,L=logint(n,10))=(n-=L=10^max(L-(n<11*10^(L-1)),0))*L+fromdigits(Vecrev(digits(if(nM. F. Hasler, Sep 11 2018
    
  • Python
    # edited by M. F. Hasler, Jun 19 2018
    def A002113_list(nMax):
      mlist=[]
      for n in range(nMax+1):
         mstr=str(n)
         if mstr==mstr[::-1]:
            mlist.append(n)
      return mlist # Bill McEachen, Dec 17 2010
    
  • Python
    from itertools import chain
    A002113 = sorted(chain(map(lambda x:int(str(x)+str(x)[::-1]),range(1,10**3)),map(lambda x:int(str(x)+str(x)[-2::-1]), range(10**3)))) # Chai Wah Wu, Aug 09 2014
    
  • Python
    from itertools import chain, count
    A002113 = chain(k for k in count(0) if str(k) == str(k)[::-1])
    print([next(A002113) for k in range(60)]) # Jan P. Hartkopf, Apr 10 2021
    
  • Python
    is_A002113 = lambda n: (s:=str(n))[::-1]==s # M. F. Hasler, May 23 2024
    
  • Python
    from math import log10, floor
    def A002113(n):
      if n < 2: return 0
      P = 10**floor(log10(n//2)); M = 11*P
      s = str(n - (P if n < M else M-P))
      return int(s + s[-2 if n < M else -1::-1]) # M. F. Hasler, Jun 06 2024
    
  • SageMath
    [n for n in (0..515) if Word(n.digits()).is_palindrome()] # Peter Luschny, Sep 13 2018
    
  • Scala
    def palQ(n: Int, b: Int = 10): Boolean = n - Integer.parseInt(n.toString.reverse) == 0
    (0 to 999).filter(palQ()) // _Alonso del Arte, Nov 10 2019

Formula

A136522(a(n)) = 1.
A178788(a(n)) = 0 for n > 9. - Reinhard Zumkeller, Jun 30 2010
A064834(a(n)) = 0. - Reinhard Zumkeller, Sep 18 2013
a(n+1) = A262038(a(n)+1). - M. F. Hasler, Sep 09 2015
Sum_{n>=2} 1/a(n) = A118031. - Amiram Eldar, Oct 17 2020
a(n) = (floor(d(n)/(c(n)*9 + 1)))*10^A055642(d(n)) + A004086(d(n)) where b(n, k) = ceiling(log((n + 1)/k)/log(10)), c(n) = b(n, 2) - b(n, 11) and d(n) = (n - A086573(b(n*(2 - c(n)), 2) - 1)/2 - 1). - Alan Michael Gómez Calderón, Mar 11 2025

A057890 In base 2, either a palindrome or becomes a palindrome if trailing 0's are omitted.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 21, 24, 27, 28, 30, 31, 32, 33, 34, 36, 40, 42, 45, 48, 51, 54, 56, 60, 62, 63, 64, 65, 66, 68, 72, 73, 80, 84, 85, 90, 93, 96, 99, 102, 107, 108, 112, 119, 120, 124, 126, 127, 128, 129, 130, 132, 136, 144, 146
Offset: 1

Views

Author

Marc LeBrun, Sep 25 2000

Keywords

Comments

Symmetric bit strings (bit-reverse palindromes), including as many leading as trailing zeros.
Fixed points of A057889, complement of A057891
n such that A000265(n) is in A006995. - Robert Israel, Jun 07 2016

Examples

			10 is included, since 01010 is a palindrome, but 11 is not because 1011 is not.
		

Crossrefs

Programs

  • Haskell
    a057890 n = a057890_list !! (n-1)
    a057890_list = 0 : filter ((== 1) . a178225 . a000265) [1..]
    -- Reinhard Zumkeller, Oct 21 2011
    
  • Maple
    dmax:= 10: # to get all terms < 2^dmax
    revdigs:= proc(n)
      local L, Ln, i;
      L:= convert(n, base, 2);
      Ln:= nops(L);
      add(L[i]*2^(Ln-i), i=1..Ln);
    end proc;
    P[0]:= {0}:
    P[1]:= {1}:
    for d from 2 to dmax do
      if d::even then
        P[d]:= { seq(2^(d/2)*x + revdigs(x), x=2^(d/2-1)..2^(d/2)-1)}
      else
        m:= (d-1)/2;
        B:={seq(2^(m+1)*x + revdigs(x), x=2^(m-1)..2^m-1)};
        P[d]:= B union map(`+`, B, 2^m)
      fi
    od:
    A:= `union`(seq(seq(map(`*`,P[d],2^k),k=0..dmax-d),d=0..dmax)):
    sort(convert(A,list)); # Robert Israel, Jun 07 2016
  • Mathematica
    PaleQ[n_Integer, base_Integer] := Module[{idn, trim = n/base^IntegerExponent[n, base]}, idn = IntegerDigits[trim, base]; idn == Reverse[idn]]; Select[Range[0, 150], PaleQ[#, 2] &] (* Lei Zhou, Dec 13 2013 *)
    pal2Q[n_]:=Module[{id=Drop[IntegerDigits[n,2],-IntegerExponent[n,2]]},id==Reverse[id]]; Join[{0},Select[Range[200],pal2Q]] (* Harvey P. Dale, Feb 26 2015 *)
    A057890Q = If[# > 0 && EvenQ@#, #0[#/2], # == #~IntegerReverse~2] &; Select[0~Range~146, A057890Q] (* JungHwan Min, Mar 29 2017 *)
    Select[Range[0, 200], PalindromeQ[IntegerDigits[#, 2] /. {b__, 0..} -> {b} ]&] (* Jean-François Alcover, Sep 18 2018 *)
  • PARI
    bitrev(n) = subst(Pol(Vecrev(binary(n>>valuation(n,2))), 'x), 'x, 2);
    is(n) = my(x = n >> valuation(n,2)); x == bitrev(x);
    concat(0, select(is,vector(147,n,n)))  \\ Gheorghe Coserea, Jun 07 2016
    
  • PARI
    is(n)=n==0 || Vecrev(n=binary(n>>valuation(n,2)))==n \\ Charles R Greathouse IV, Aug 25 2016
  • Python
    A057890 = [n for n in range(10**6) if bin(n)[2:].rstrip('0') == bin(n)[2:].rstrip('0')[::-1]] # Chai Wah Wu, Aug 12 2014
    

Formula

A030101(A030101(n)) = A030101(n). - David W. Wilson, Jun 09 2009, Jun 18 2009
A178225(A000265(a(n))) = 1. - Reinhard Zumkeller, Oct 21 2011
a(7*2^n-4*n-4) = 4^n + 1, a(10*2^n-4*n-6) = 2*4^n + 1. - Gheorghe Coserea, Apr 05 2017

A057891 In base 2, neither a palindrome nor becomes a palindrome if trailing 0's are omitted.

Original entry on oeis.org

11, 13, 19, 22, 23, 25, 26, 29, 35, 37, 38, 39, 41, 43, 44, 46, 47, 49, 50, 52, 53, 55, 57, 58, 59, 61, 67, 69, 70, 71, 74, 75, 76, 77, 78, 79, 81, 82, 83, 86, 87, 88, 89, 91, 92, 94, 95, 97, 98, 100, 101, 103, 104, 105, 106, 109, 110, 111, 113, 114, 115, 116, 117, 118
Offset: 1

Views

Author

Marc LeBrun, Sep 25 2000

Keywords

Comments

These could be called "asymmetric bit strings".
Fixed pairs of A057889, complement of A057890.
If these numbers are converted to their binary polynomial, one of the roots of that polynomial will have absolute values other than 1 or 0. For example 11 = 2^3 + 2^1 + 2^0, the absolute values of the roots of x^3 + x + 1 are 0.682328... and 1.21061... which are not 1 or 0, so 11 is in the sequence. The first number with this property which is not a term is A057890(53) = 107. - Benedict W. J. Irwin, Sep 07 2017 and Andrey Zabolotskiy, Oct 13 2017

Examples

			11 is included because 1011 is asymmetrical, but 12 is not because 001100 is a palindrome.
		

Crossrefs

Cf. A061917, A006995. Complement of A057890.

Programs

  • Haskell
    a057891 n = a057891_list !! (n-1)
    a057891_list = filter ((== 0) . a178225 . a000265) [1..]
    -- Reinhard Zumkeller, Oct 21 2011

Formula

A030101(A030101(n)) != A030101(n). - David Wilson, Jun 09 2009, Jun 18 2009
A178225(A000265(a(n))) = 0. - Reinhard Zumkeller, Oct 21 2011

Extensions

Edited by N. J. A. Sloane, Jun 09 2009 at the suggestion of Ray Chandler
A-numbers in formula corrected by R. J. Mathar, Jun 18 2009

A325148 Squares which can be expressed as the product of a number and its reversal.

Original entry on oeis.org

0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 400, 484, 900, 1089, 1600, 1936, 2500, 3025, 3600, 4356, 4900, 5929, 6400, 7744, 8100, 9801, 10000, 10201, 12100, 12321, 14641, 17161, 19881, 22801, 25921, 29241, 32761, 36481, 40000, 40804, 44944, 48400, 49284, 53824, 58564, 63504, 68644, 73984, 79524, 85264
Offset: 1

Views

Author

Bernard Schott, Apr 03 2019

Keywords

Comments

The numbers k such that k * rev(k) is a square are in A306273.
The squares of palindromes of A014186 are a subsequence.
The square roots of the first 65 terms of this sequence (from 0 to 160000) are exactly the first 65 terms of A061917. Then a(66) = 162409 = 403^2 and the non-palindrome 403 is the first term of another sequence A325151.

Examples

			Zero ways: 169 = 13^2 cannot be equal to k * rev(k).
One way: 400 = 200 * 2; 10201 = 101 * 101; 162409 = 169 * 961.
Two ways: 7683984 = 2772 * 2772 = 1584 * 4851.
Three ways: 6350400 = 14400 * 441 = 25200 * 252 = 44100 * 144.
		

Crossrefs

Equals A325149 Union A083408.
Cf. A325149 (only one way), A083408 (at least two ways). A325150 (exactly two ways), A307019 (exactly three ways).
Subsequences: A014186 (square of palindromes), A076750 (product of a non-palindrome and its reversal, where leading zeros are not allowed).
Cf. A061917, A325151 (some square roots of this sequence).

Programs

  • Maple
    isA305231 := proc(n)
        local d;
        for d in numtheory[divisors](n) do
            if d = digrev(n/d) then
                return true ;
            end if;
        end do:
        false ;
    end proc:
    n := 1;
    for i from 0 to 4000 do
        i2 := i^2 ;
        if isA305231(i2) then
            printf("%d %d\n",n,i2) ;
            n := n+1 ;
        end if;
    end do: # R. J. Mathar, Aug 09 2019
  • Mathematica
    {0}~Join~Select[Range[10^3]^2,(d1=Select[Divisors[n=#],#<=Sqrt@n&];Or@@Table[d1[[k]]==(IntegerReverse/@(n/d1))[[k]],{k,Length@d1}])&] (* Giorgos Kalogeropoulos, Jun 09 2021 *)
  • Python
    from sympy import divisors
    A325148_list = [0]
    for n in range(10**6):
        n2 = n**2
        for m in divisors(n2):
            if m > n:
                break
            if m == int(str(n2//m)[::-1]):
                A325148_list.append(n2)
                break # Chai Wah Wu, Jun 09 2021

Formula

Intersection of A305231 and A000290. - R. J. Mathar, Aug 09 2019

Extensions

Definition corrected by N. J. A. Sloane, Aug 01 2019

A233010 In balanced ternary notation, either a palindrome or becomes a palindrome if trailing 0's are omitted.

Original entry on oeis.org

0, 1, 3, 4, 7, 9, 10, 12, 13, 16, 21, 27, 28, 30, 36, 39, 40, 43, 48, 52, 61, 63, 73, 81, 82, 84, 90, 91, 103, 108, 112, 117, 120, 121, 124, 129, 144, 156, 160, 183, 189, 196, 208, 219, 243, 244, 246, 252, 270, 273, 280, 292, 309, 324, 328, 336, 351, 360, 363
Offset: 1

Views

Author

Lei Zhou, Dec 13 2013

Keywords

Comments

Symmetric strings of -1, 0, and 1, including as many leading as trailing zeros.

Examples

			10 is included since in balanced ternary notation 10 = (101)_bt is a palindrome;
144 is included since 144 = (1TT100)_bt, where we use T to represent -1.  When trailing zeros removed, 1TT1 is a palindrome.
		

Crossrefs

Programs

  • Mathematica
    BTDigits[m_Integer, g_] :=
    Module[{n = m, d, sign, t = g},
      If[n != 0, If[n > 0, sign = 1, sign = -1; n = -n];
       d = Ceiling[Log[3, n]]; If[3^d - n <= ((3^d - 1)/2), d++];
       While[Length[t] < d, PrependTo[t, 0]]; t[[Length[t] + 1 - d]] = sign;
       t = BTDigits[sign*(n - 3^(d - 1)), t]]; t];
    BTpaleQ[n_Integer] := Module[{t, trim = n/3^IntegerExponent[n, 3]},
      t = BTDigits[trim, {0}]; t == Reverse[t]];
    Select[Range[0, 363], BTpaleQ[#] &]

A233571 In balanced ternary notation, reverse digits of a(n) equals to -a(n).

Original entry on oeis.org

0, 2, 8, 20, 26, 32, 56, 80, 104, 146, 164, 182, 224, 242, 260, 302, 320, 338, 416, 488, 560, 656, 728, 800, 896, 968, 1040, 1172, 1226, 1280, 1406, 1460, 1514, 1640, 1694, 1748, 1898, 1952, 2006, 2132, 2186, 2240, 2366, 2420, 2474, 2624, 2678, 2732, 2858
Offset: 1

Views

Author

Lei Zhou, Dec 13 2013

Keywords

Examples

			In balanced ternary notation, 8=(10T)_bt, where we use T to represent -1.  Reverse digits of (10T)_bt is (T01)_bt = -8. So 8 is in this sequence.
Similarly, 2240 = (1001T00T)_bt, whose reverse digits is (T00T1001)_bt = -2240.  So 2240 is in this sequence.
		

Crossrefs

Programs

  • Mathematica
    BTDigits[m_Integer, g_] :=
    Module[{n = m, d, sign, t = g},
      If[n != 0, If[n > 0, sign = 1, sign = -1; n = -n];
       d = Ceiling[Log[3, n]]; If[3^d - n <= ((3^d - 1)/2), d++];
       While[Length[t] < d, PrependTo[t, 0]]; t[[Length[t] + 1 - d]] = sign;
       t = BTDigits[sign*(n - 3^(d - 1)), t]]; t];
    ct = 1; n = 0; m = 0; dg = 0; switch = 1; res = {0}; While[ct < 50, n++;
      bits = BTDigits[n, {0}]; If[lb = Length[bits]; lb > dg,
      If[switch == 0, n = m; switch = 1; OK = 0, dg = lb; m = n - 1;
       switch = 0; OK = 1], OK = 1];  If[OK == 1, rbt = -Reverse[bits];
      If[switch == 1, nb = Join[bits, {0}], nb = bits];
      nb = Join[nb, rbt]; nb = Reverse[nb]; data = 0;
      Do[data = data + 3^(i - 1)*nb[[i]], {i, 1, Length[nb]}]; ct++;
      AppendTo[res, data]]]; res

A169824 Numbers n such that n is divisible by n-with-its-digits-reversed.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 20, 22, 30, 33, 40, 44, 50, 55, 60, 66, 70, 77, 80, 88, 90, 99, 100, 101, 110, 111, 121, 131, 141, 151, 161, 171, 181, 191, 200, 202, 212, 220, 222, 232, 242, 252, 262, 272, 282, 292, 300, 303, 313, 323, 330, 333, 343, 353, 363, 373, 383, 393
Offset: 1

Views

Author

N. J. A. Sloane, May 29 2010

Keywords

Comments

If n is a term, then so is n*10^k. Positive terms in A002113 is a subsequence. - Chai Wah Wu, Sep 28 2017
a(n) = A061917(n+1) for 1 <= n < 78, but a(78) = 510 differs from A061917(79) = 515. - Georg Fischer, Oct 28 2018

Examples

			40 is divisible by 4.
		

Crossrefs

Cf. A031877.
Cf. A002113. - Robert G. Wilson v, Jun 10 2010

Programs

  • Mathematica
    fQ[n_] := Mod[n, FromDigits@ Reverse@ IntegerDigits@ n] == 0; Select[ Range@ 399, fQ@# &] (* Robert G. Wilson v, Jun 10 2010 *)
  • Python
    A169824_list = [n for n in range(1,1000) if not n % int(str(n)[::-1])] # Chai Wah Wu, Sep 28 2017

A233572 In balanced ternary notation, if prepending same numbers of zeros, reverse digits of a(n) equals to -a(n).

Original entry on oeis.org

0, 2, 6, 8, 18, 20, 24, 26, 32, 54, 56, 60, 72, 78, 80, 96, 104, 146, 162, 164, 168, 180, 182, 216, 224, 234, 240, 242, 260, 288, 302, 312, 320, 338, 416, 438, 486, 488, 492, 504, 540, 546, 560, 648, 656, 672, 702, 720, 726, 728, 780, 800, 864, 896, 906, 936
Offset: 1

Views

Author

Lei Zhou, Dec 13 2013

Keywords

Comments

A233571 is a subset of this sequence.

Examples

			In balanced ternary notation, 18 = (1T00)_bt, where we use T to represent -1.  Patching two zeros before it, (1T00)_bt=(001T00)_bt.  The reverse digits of (001T00)_bt is (00T100)_bt = -18.  So 18 is in this sequence.
		

Crossrefs

Programs

  • Mathematica
    BTDigits[m_Integer, g_] :=
    Module[{n = m, d, sign, t = g},
      If[n != 0, If[n > 0, sign = 1, sign = -1; n = -n];
       d = Ceiling[Log[3, n]]; If[3^d - n <= ((3^d - 1)/2), d++];
       While[Length[t] < d, PrependTo[t, 0]]; t[[Length[t] + 1 - d]] = sign;
       t = BTDigits[sign*(n - 3^(d - 1)), t]]; t];
    BTrteQ[n_Integer] :=
    Module[{t, trim = n/3^IntegerExponent[n, 3]},
      t = BTDigits[trim, {0}]; DeleteDuplicates[t + Reverse[t]] == {0}];
    sb = Select[Range[0, 950], BTrteQ[#] &]

A233573 Number of ways n can be partitioned as A233010(i)+A233572(j), where i,j >= 1.

Original entry on oeis.org

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

Views

Author

Lei Zhou, Dec 13 2013

Keywords

Comments

Number in sequence A233010 takes palindrome form when written in balanced ternary notation and left patch same number of zeros as number of trailing zeros, which means that if we slice the balanced ternary notation number with left zero padding in the middle, the left part is a mirrored image of the right part. This is a feature like an even function.
Number in sequence A233571 takes "reversed palindrome form" when written in balanced ternary notation and left patch same number of zeros as number of trailing zeros, which means that if we slice the balanced ternary notation number with left zero padding in the middle, the left part is a mirrored image of the right part with sign changes. This is a feature like an odd function.
This sequence gives the number of possibilities of such partitions.
In the first 10000 terms, 152 zeros found.

Examples

			0=0+0=A233010(1)+A233572(1). This is the only valid partition by definition. So a(0)=1.
3=3+0=A233010(3)+A233572(1), as well 3=1+2=A233010(2)+A233572(2).
  Two valid partitions found. So a(3)=2.
9=9+0=7+2=3+6=1+8, four valid partitions found. So a(9)=4.
		

Crossrefs

Programs

  • Mathematica
    BTDigits[m_Integer, g_] :=
    (*This is to determine digits of a number in balanced ternary notation.*)
    Module[{n = m, d, sign, t = g},
      If[n != 0, If[n > 0, sign = 1, sign = -1; n = -n];
       d = Ceiling[Log[3, n]]; If[3^d - n <= ((3^d - 1)/2), d++];
       While[Length[t] < d, PrependTo[t, 0]]; t[[Length[t] + 1 - d]] = sign;
         t = BTDigits[sign*(n - 3^(d - 1)), t]]; t];
    BTpaleQ[n_Integer] :=
    (*This is to query if a number is an element of sequence A233010.*)
    Module[{t, trim = n/3^IntegerExponent[n, 3]},
      t = BTDigits[trim, {0}]; t == Reverse[t]];
    BTrteQ[n_Integer] :=
    (*This is to query if a number is an element of sequence A233572.*)
    Module[{t, trim = n/3^IntegerExponent[n, 3]},
      t = BTDigits[trim, {0}]; DeleteDuplicates[t + Reverse[t]] == {0}];
    sa = Select[Range[0, 11000], BTpaleQ[#] &];
    (*This is to generate a limited list of A233010.*)
    sb = Select[Range[0, 11000], BTrteQ[#] &];
    (*This is to generate a limited list of A233572.*)
    range = 86; Table[ct = 0; i1 = 0;
    While[i1++; sa[[i1]] <= n, i2 = 0;
      While[i2++; (sa[[i1]] + sb[[i2]]) <= n,
       If[(sa[[i1]] + sb[[i2]]) == n, ct++]]]; ct, {n, 0, range}]

A281625 Numbers m>0 such that m = k*(reversal of k*m) for some k<=m.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 20, 22, 30, 33, 40, 44, 50, 55, 60, 66, 70, 77, 80, 88, 90, 99, 100, 101, 110, 111, 121, 131, 141, 151, 161, 171, 181, 191, 200, 202, 212, 220, 222, 232, 242, 252, 262, 272, 282, 292, 300, 303, 313, 323, 330, 333, 343, 353
Offset: 1

Views

Author

Jaroslav Krizek, Feb 11 2017

Keywords

Comments

Generalization of palindrome numbers in base 10.
Sequence is not the same as A061917 or A169824; a(188) = 3267 is not a term of these sequences.
Supersequence of A002113 (palindromes in base 10) and A061917.
Sequences a(n)_k of numbers m such that m = k*(reversal of k*m) for k <= 30 and n >= 1:
a(n)_1 = A002113(n+1) (palindromes > 0 in base 10);
a(n)_2 = 4356, 43956, 439956, 4399956, 43999956, 439999956, ...;
a(n)_3 = 3267, 32967, 329967, 3299967, 32999967, 329999967, ...;
a(n)_5 = a(n)_20 = 10*a(n)_2 = 43560, 439560, 4399560, 43999560, ...;
a(n)_8 = 6600, 6606600, 66006600, 660006600, ...;
a(n)_10 = 10*A002113(n+1): 10, 20, 30, 40, 50, 60, 70, 80, 90, 110, ... ;
a(n)_30 = 10*a(n)_3 = 32670, 329670, 3299670, 32999670, ...

Examples

			3267 is in the sequence because 3267 = 3*(reversal of 3*3267) = 3*(reversal of 9801) = 3*1089.
		

Crossrefs

Programs

  • Magma
    [n: k in [1..n], n in [1..1000] | n eq k * Seqint(Reverse(Intseq(k*n)))];
  • Maple
    read("transforms") :
    isA281625 := proc(n)
        for k from 1 to n do
            if k*digrev(k*n) = n then
                return true ;
            end if;
        end do:
        false;
    end proc:
    A281625 := proc(n)
        option remember ;
        if n = 1 then
            1;
        else
            for a from procname(n-1)+1 do
                if isA281625(a) then
                    return a;
                end if;
            end do:
        end if;
    end proc:
    seq(A281625(n),n=1..100) ; # R. J. Mathar, Aug 06 2019
  • Mathematica
    Select[Range@ 353, Function[n, Total@ Boole@ Map[Function[k, n == k FromDigits@ Reverse[IntegerDigits[k n]]], Range@ n] > 0]] (* Michael De Vlieger, Feb 11 2017 *)
Showing 1-10 of 16 results. Next