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 21-30 of 55 results. Next

A341191 Number of ways to write n as an ordered sum of 2 nonzero decimal palindromes.

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Feb 06 2021

Keywords

Crossrefs

Programs

  • Mathematica
    nmax = 90; CoefficientList[Series[Sum[Boole[PalindromeQ[k]] x^k, {k, 1, nmax}]^2, {x, 0, nmax}], x] // Drop[#, 2] &

A341192 Number of ways to write n as an ordered sum of 3 nonzero decimal palindromes.

Original entry on oeis.org

1, 3, 6, 10, 15, 21, 28, 36, 45, 52, 60, 66, 70, 72, 72, 70, 66, 60, 55, 45, 39, 34, 30, 27, 25, 24, 24, 24, 27, 27, 25, 27, 27, 27, 27, 27, 27, 27, 27, 30, 27, 27, 30, 30, 30, 30, 30, 30, 30, 30, 33, 27, 30, 33, 33, 33, 33, 33, 33, 33, 33, 36, 27, 34, 36, 36, 36, 36
Offset: 3

Views

Author

Ilya Gutkovskiy, Feb 06 2021

Keywords

Crossrefs

Programs

  • Mathematica
    nmax = 70; CoefficientList[Series[Sum[Boole[PalindromeQ[k]] x^k, {k, 1, nmax}]^3, {x, 0, nmax}], x] // Drop[#, 3] &

A341193 Number of ways to write n as an ordered sum of 4 nonzero decimal palindromes.

Original entry on oeis.org

1, 4, 10, 20, 35, 56, 84, 120, 165, 216, 274, 336, 399, 460, 516, 564, 601, 624, 636, 628, 609, 580, 544, 504, 463, 424, 390, 360, 345, 332, 324, 324, 327, 332, 338, 344, 350, 352, 356, 364, 361, 364, 370, 376, 382, 388, 394, 400, 402, 412, 418, 412, 418, 424, 430, 436, 442
Offset: 4

Views

Author

Ilya Gutkovskiy, Feb 06 2021

Keywords

Crossrefs

Programs

  • Mathematica
    nmax = 60; CoefficientList[Series[Sum[Boole[PalindromeQ[k]] x^k, {k, 1, nmax}]^4, {x, 0, nmax}], x] // Drop[#, 4] &

A047813 Largest palindromic substring of n.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

a(n) = A262188(n,A262190(n)-1). - Reinhard Zumkeller, Sep 14 2015

Examples

			a(1313) = Max{1,3,131,313} = 313.
		

Crossrefs

Programs

  • Haskell
    a047813 = last . a262188_row
    -- Reinhard Zumkeller, Sep 14 2015, Aug 23 2011
    
  • Mathematica
    palQ[n_Integer, base_Integer] := Module[{idn = IntegerDigits[n, base]}, idn == Reverse[ idn]]; f[n_] := Block[{id = IntegerDigits@ n, mx = -Infinity}, k = Length@ id; While[k > 0 && mx == -Infinity, mx = Max[mx, Select[ FromDigits@# & /@ Partition[id, k, 1], palQ[#, 10] &]]; k--]; mx] (* Robert G. Wilson v, Aug 24 2011 *)
    lps[n_]:=Module[{idn=IntegerDigits[n]},Max[FromDigits/@Select[ Flatten[ Table[ Partition[ idn,i,1],{i,Length[idn]}],1],#==Reverse[#]&]]]; Array[ lps,100,0] (* Harvey P. Dale, Jan 09 2015 *)
  • Python
    def c(s): return (s[0] != "0" or s == "0") and s == s[::-1]
    def a(n):
        s = str(n)
        ss = (s[i:j] for i in range(len(s)) for j in range(i+1, len(s)+1))
        return max(int(w) for w in ss if c(w))
    print([a(n) for n in range(96)]) # Michael S. Branicky, Sep 18 2022

A062293 Smallest multiple k*n of n which has even digits and is a palindrome or becomes a palindrome when 0's are added on the left (e.g., 10 becomes 010, which is a palindrome).

Original entry on oeis.org

0, 2, 2, 6, 4, 20, 6, 686, 8, 666, 20, 22, 60, 2002, 686, 60, 80, 646, 666, 646, 20, 6006, 22, 828, 600, 200, 2002, 8886888, 868, 464, 60, 868, 800, 66, 646, 6860, 828, 222, 646, 6006, 40, 22222, 6006, 68886, 44, 6660, 828, 282, 4224, 686, 200, 42024, 4004, 424, 8886888, 220, 8008, 68286, 464, 68086, 60
Offset: 0

Views

Author

Amarnath Murthy, Jun 18 2001

Keywords

Comments

Every integer n has a multiple of the form 99...9900...00. To see that n has a multiple that's a palindrome (allowing 0's on the left) with even digits, let 9n divide 99...9900...00; then n divides 22...2200...00. - Dean Hickerson, Jun 29 2001

Examples

			a(7) = 686 as 686 = 98*7 is the smallest palindrome multiple of 7 with even digits.
		

Crossrefs

Cf. A062279. Values of k are given in A061797.

Programs

  • ARIBAS
    stop := 500000; for n := 0 to 60 do k := 1; test := true; while test and k < stop do m := omit_trailzeros(n*k); if test := not all_even(m) or m <> int_reverse(m) then inc(k); end; end; if k < stop then write(n*k," "); else write(-1," "); end; end;
    
  • Haskell
    a062293 0 = 0
    a062293 n = head [x | x <- map (* n) [1..],
                     all (`elem` "02468") $ show x, a136522 (a004151 x) == 1]
    -- Reinhard Zumkeller, Feb 01 2012

Extensions

Corrected and extended by Klaus Brockhaus, Jun 21 2001

A015976 One iteration of Reverse and Add is needed to reach a palindrome.

Original entry on oeis.org

1, 2, 3, 4, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36, 38, 40, 41, 42, 43, 44, 45, 47, 50, 51, 52, 53, 54, 56, 60, 61, 62, 63, 65, 70, 71, 72, 74, 80, 81, 83, 90, 92, 100, 101, 102, 103, 104, 105, 106
Offset: 1

Views

Author

Keywords

Comments

The number of iterations starts at 1, so palindromes (cf. A002113) are not excluded. The corresponding sequence excluding palindromes is A065206.

Crossrefs

Programs

  • Haskell
    a015976 n = a015976_list !! (n-1)
    a015976_list = filter ((== 1) . a136522 . a056964) [1..]
    -- Reinhard Zumkeller, Oct 14 2011
  • Mathematica
    rev[n_] := FromDigits[Reverse[IntegerDigits[n]]]; Select[Range[106], rev[x = # + rev[#]] == x &] (* Jayanta Basu, Jul 24 2013 *)
    Select[Range[120],PalindromeQ[#+IntegerReverse[#]]&] (* Harvey P. Dale, Jul 04 2022 *)

Extensions

Offset corrected by Reinhard Zumkeller, Oct 14 2011

A078715 Palindromic Roman numerals.

Original entry on oeis.org

1, 2, 3, 5, 10, 19, 20, 30, 50, 100, 190, 200, 300, 500, 1000, 1900, 2000, 3000
Offset: 1

Views

Author

Rick L. Shepherd, Dec 19 2002

Keywords

Comments

This sequence is consistent with the Roman numerals as expressed in the Schildberger link. 4 (usually IV now) could be included in a variant of this sequence as IIII is sometimes used (especially on clock faces). To make this or similar sequences well-defined for numbers larger than 3999, it must be decided whether and how to handle the apostrophus (backward-C), the vinculum (bar), the frame, or even other multiplier notations used at various times in representations of larger Roman numerals. Recalling the "Y2K crisis", will there be a(n even milder) "Y4M crisis"? In particular, is 4000 to be represented as MMMM, (I)(I)(I)(I) (where parentheses are used to represent C and the apostrophus), MV (with vinculum over the V), IV (with vinculum over both I and V) or IIII with vinculum over all four I's? If there is no general agreement, could Roman civilization be at risk (once again)?
Indices of terms in A061493 which are also in A002113. - M. F. Hasler, Jan 12 2015

Examples

			I, II, III, V, X, XIX, XX, XXX, L, C, CXC, CC, CCC, D, M, MCM, MM, MMM
		

References

  • Encyclopaedia Britannica, 1981 ed., Vol. 11, "Mathematics, History of", p. 647.
  • Webster's Third New International Dictionary (Unabridged), 1976 ed., "Cardinal Numbers Table" and footnotes, p. 1549.

Crossrefs

Cf. A061493, A006968 (Roman numerals main entry), A002113 (Palindromic Arabic numerals).
Subsequence of A093703.

Programs

  • Haskell
    a078715 n = a078715_list !! (n-1)
    a078715_list = filter ((== 1) . a136522 . a061493) [1..3999]
    -- Reinhard Zumkeller, Apr 14 2013
    
  • Mathematica
    Select[Range[3000], PalindromeQ[RomanNumeral[#]] &] (* Paolo Xausa, Mar 03 2024 *)
  • PARI
    is_A078715(n)=Vecrev(n=Str(A061493(n)))==Vec(n) \\ M. F. Hasler, Jan 12 2015

Formula

A136522(A061493(a(n))) = 1. - Reinhard Zumkeller, Apr 14 2013

A030147 Palindromes in which parity of digits alternates.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 101, 121, 141, 161, 181, 212, 232, 252, 272, 292, 303, 323, 343, 363, 383, 414, 434, 454, 474, 494, 505, 525, 545, 565, 585, 616, 636, 656, 676, 696, 707, 727, 747, 767, 787, 818, 838, 858, 878, 898, 909, 929, 949
Offset: 1

Views

Author

Keywords

Comments

All terms have an odd number of digits. - Alonso del Arte, Jan 31 2020

Crossrefs

Intersection of A002113 and A030141.
Subsequence of A001633.

Programs

  • Haskell
    a030147 n = a030147_list !! (n-1)
    a030147_list = filter ((== 1) . a228710) a002113_list
    -- Reinhard Zumkeller, Aug 31 2013
    
  • Mathematica
    palQ[n_, b_:10] := (IntegerDigits[n, b] == Reverse[IntegerDigits[n, b]]); alternParQ[n_, b_:10] := (Union[BlockMap[Xor @@ # &, OddQ[IntegerDigits[n, b]], 2, 1]] == {True}); Join[Range[0, 9], Select[Range[1000], palQ[#] && alternParQ[#] &]] (* Alonso del Arte, Feb 02 2020 *)
    Join[Range[0,9],Select[Range[100000],PalindromeQ[#]&&Union[Total/@Partition[Boole[ EvenQ[ IntegerDigits[ #]]],2,1]] =={1}&]] (* Harvey P. Dale, Jul 04 2023 *)
  • Scala
    def isPal(n: Int) = (n.toString == n.toString.reverse)
    def alternsPar(n: Int): Boolean = {
      val dPars = Integer.toString(n).toList.map(_ % 2 == 0)
      val scanPars = (dPars zip dPars.tail).map{ case (x, y) => x ^ y }
      scanPars.toSet == Set(true)
    }
    (0 to 9) ++: (10 to 999).filter(isPal).filter(alternsPar) // Alonso del Arte, Feb 02 2020

Formula

A136522(a(n)) * A228710(a(n)) = 1. - Reinhard Zumkeller, Aug 31 2013

A262188 Table read by rows: row n contains all distinct palindromes contained as substrings in decimal representation of n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 1, 11, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 1, 9, 0, 2, 1, 2, 2, 22, 2, 3, 2, 4, 2, 5, 2, 6, 2, 7, 2, 8, 2, 9, 0, 3, 1, 3, 2, 3, 3, 33, 3, 4, 3, 5, 3, 6, 3, 7, 3, 8, 3, 9, 0, 4, 1, 4, 2, 4, 3, 4, 4, 44, 4, 5, 4, 6, 4
Offset: 0

Views

Author

Reinhard Zumkeller, Sep 14 2015

Keywords

Comments

Length of row n = A262190(n);
T(n,0) = A054054(n);
T(n,A262190(n)-1) = A047813(n).

Examples

			.     n |  T(n,*)           n |  T(n,*)              n |  T(n,*)
.  -----+-----------    ------+-------------    -------+--------------
.   100 |  0,1           1000 |  0,1             10000 |  0,1
.   101 |  0,1,101       1001 |  0,1,1001        10001 |  0,1,10001
.   102 |  0,1,2         1002 |  0,1,2           10002 |  0,1,2
.   103 |  0,1,3         1003 |  0,1,3           10003 |  0,1,3
.   104 |  0,1,4         1004 |  0,1,4           10004 |  0,1,4
.   105 |  0,1,5         1005 |  0,1,5           10005 |  0,1,5
.   106 |  0,1,6         1006 |  0,1,6           10006 |  0,1,6
.   107 |  0,1,7         1007 |  0,1,7           10007 |  0,1,7
.   108 |  0,1,8         1008 |  0,1,8           10008 |  0,1,8
.   109 |  0,1,9         1009 |  0,1,9           10009 |  0,1,9
.   110 |  0,1,11        1010 |  0,1,101         10010 |  0,1,1001
.   111 |  1,11,111      1011 |  0,1,11,101      10011 |  0,1,11,1001
.   112 |  1,2,11        1012 |  0,1,2,101       10012 |  0,1,2,1001
.   113 |  1,3,11        1013 |  0,1,3,101       10013 |  0,1,3,1001
.   114 |  1,4,11        1014 |  0,1,4,101       10014 |  0,1,4,1001
.   115 |  1,5,11        1015 |  0,1,5,101       10015 |  0,1,5,1001
.   116 |  1,6,11        1016 |  0,1,6,101       10016 |  0,1,6,1001
.   117 |  1,7,11        1017 |  0,1,7,101       10017 |  0,1,7,1001
.   118 |  1,8,11        1018 |  0,1,8,101       10018 |  0,1,8,1001
.   119 |  1,9,11        1019 |  0,1,9,101       10019 |  0,1,9,1001
.   120 |  0,1,2         1020 |  0,1,2           10020 |  0,1,2
.   121 |  1,2,121       1021 |  0,1,2           10021 |  0,1,2
.   122 |  1,2,22        1022 |  0,1,2,22        10022 |  0,1,2,22
.   123 |  1,2,3         1023 |  0,1,2,3         10023 |  0,1,2,3
.   124 |  1,2,4         1024 |  0,1,2,4         10024 |  0,1,2,4
.   125 |  1,2,5         1025 |  0,1,2,5         10025 |  0,1,2,5  .
		

Crossrefs

Cf. A262190 (row lengths), A054054 (left edge), A047813 (right edge), A136522, A002113.

Programs

  • Haskell
    import Data.List (inits, tails, nub, sort)
    a262188 n k = a262188_tabf !! n !! k
    a262188_row n = a262188_tabf !! n
    a262188_tabf = map (sort . nub . map (foldr (\d v -> 10 * v + d) 0) .
       filter (\xs -> length xs == 1 || last xs > 0 && reverse xs == xs) .
              concatMap (tail . inits) . tails) a031298_tabf
    
  • PARI
    A262188_row(n,b=10)=Set(concat(vector(logint(n+!n,b)+1,m,m=n\=b^(m>1);select(is_A002113,vector(logint(m+!m,b)+1,k,m%b^k))))) \\ M. F. Hasler, Jun 19 2018

A341184 Number of ways to write n as an ordered sum of 5 nonzero decimal palindromes.

Original entry on oeis.org

1, 5, 15, 35, 70, 126, 210, 330, 495, 710, 981, 1310, 1695, 2130, 2605, 3106, 3615, 4110, 4575, 4980, 5311, 5555, 5705, 5760, 5725, 5611, 5435, 5210, 4975, 4735, 4511, 4320, 4170, 4065, 4005, 3986, 4005, 4040, 4100, 4175, 4241, 4310, 4380, 4450, 4520, 4590, 4665, 4740, 4810
Offset: 5

Views

Author

Ilya Gutkovskiy, Feb 06 2021

Keywords

Crossrefs

Programs

  • Mathematica
    nmax = 53; CoefficientList[Series[Sum[Boole[PalindromeQ[k]] x^k, {k, 1, nmax}]^5, {x, 0, nmax}], x] // Drop[#, 5] &
Previous Showing 21-30 of 55 results. Next