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 86 results. Next

A265510 a(n) = largest base-2 palindrome m <= 2n+1 such that every base-2 digit of m is <= the corresponding digit of 2n+1; m is written in base 2.

Original entry on oeis.org

1, 11, 101, 111, 1001, 1001, 1001, 1111, 10001, 10001, 10101, 10101, 10001, 11011, 10101, 11111, 100001, 100001, 100001, 100001, 100001, 100001, 101101, 101101, 100001, 110011, 100001, 110011, 100001, 110011, 101101, 111111, 1000001, 1000001, 1000001, 1000001, 1001001, 1001001, 1001001, 1001001, 1000001, 1000001
Offset: 0

Views

Author

N. J. A. Sloane, Dec 09 2015

Keywords

Comments

a(n) = A007088(A265509(n)). - Reinhard Zumkeller, Dec 11 2015

Crossrefs

Sequences related to palindromic floor and ceiling: A175298, A206913, A206914, A261423, A262038, and the large block of consecutive sequences beginning at A265509.
Cf. A007088.

Programs

A265525 a(n) = largest base-10 palindrome m <= n such that every base-10 digit of m is <= the corresponding digit of n.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Dec 09 2015

Keywords

Crossrefs

Sequences related to palindromic floor and ceiling: A175298, A206913, A206914, A261423, A262038, and the large block of consecutive sequences beginning at A265509.

Programs

  • Haskell
    a265525 n = a265525_list !! n
    a265525_list = f a031298_tabf [[]] where
       f (ds:dss) pss = y : f dss pss' where
         y = foldr (\d v -> 10 * v + d) 0 ys
         (ys:_) = dropWhile (\ps -> not $ and $ zipWith (<=) ps ds) pss'
         pss' = if ds /= reverse ds then pss else ds : pss
    -- Reinhard Zumkeller, Dec 11 2015
  • Maple
    ispal := proc(n) # test for base-b palindrome
    local L, Ln, i;
    global b;
    L := convert(n, base, b);
    Ln := nops(L);
    for i to floor(1/2*Ln) do
    if L[i] <> L[Ln + 1 - i] then return false end if
    end do;
    return true
    end proc
    # find max pal <= n and in base-b shadow of n, write in base 10
    under10:=proc(n) global b;
    local t1,t2,i,m,sw1,L2;
    if n mod b = 0 then return(0); fi;
    t1:=convert(n,base,b);
    for m from n by -1 to 0 do
    if ispal(m) then
    t2:=convert(m,base,b);
    L2:=nops(t2);
    sw1:=1;
    for i from 1 to L2 do
    if t2[i] > t1[i] then sw1:=-1; break; fi;
    od:
    if sw1=1 then return(m); fi;
    fi;
    od;
    end proc;
    b:=10; [seq(under10(n),n=0..144)]; # Gives A265525

A265543 a(n) = smallest base-2 palindrome m >= n such that every base-2 digit of n is <= the corresponding digit of m; m is written in base 2.

Original entry on oeis.org

0, 1, 11, 11, 101, 101, 111, 111, 1001, 1001, 1111, 1111, 1111, 1111, 1111, 1111, 10001, 10001, 11011, 11011, 10101, 10101, 11111, 11111, 11011, 11011, 11011, 11011, 11111, 11111, 11111, 11111, 100001, 100001, 110011, 110011, 101101, 101101, 111111, 111111, 101101, 101101, 111111, 111111, 101101, 101101, 111111
Offset: 0

Views

Author

N. J. A. Sloane, Dec 09 2015

Keywords

Crossrefs

Sequences related to palindromic floor and ceiling: A175298, A206913, A206914, A261423, A262038, and the large block of consecutive sequences beginning at A265509.
See A206913 for the values of m written in base 10.

Programs

  • Maple
    ispal:= proc(n) global b; # test if n is base-b palindrome
      local L, Ln, i;
      L:= convert(n, base, b);
      Ln:= nops(L);
    for i from 1 to floor(Ln/2) do
    if L[i] <> L[Ln+1-i] then return(false); fi;
    od:
    return(true);
    end proc;
    # find min pal >= n and with n in base-b shadow, write in base 10
    over10:=proc(n) global b;
    local t1,t2,i,m,sw1,L1;
    t1:=convert(n,base,b);
    L1:=nops(t1);
    for m from n to 10*n do
    if ispal(m) then
       t2:=convert(m,base,b);
       sw1:=1;
       for i from 1 to L1 do
          if t1[i] > t2[i] then sw1:=-1; break; fi;
                          od:
       if sw1=1 then return(m); fi;
    fi;
                           od;
    lprint("no solution in over10 for n = ", n);
    end proc;
    # find min pal >= n and with n in base-b shadow, write in base 10
    overb:=proc(n) global b;
    local t1,t2,i,m,mb,sw1,L1;
    t1:=convert(n,base,b);
    L1:=nops(t1);
    for m from n to 10*n do
    if ispal(m) then
       t2:=convert(m,base,b);
       sw1:=1;
       for i from 1 to L1 do
          if t1[i] > t2[i] then sw1:=-1; break; fi;
                          od:
       if sw1=1 then mb:=add(t2[i]*10^(i-1), i=1..nops(t2)); return(mb); fi;
    fi;
                           od;
    lprint("no solution in over10 for n = ", n);
    end proc;
    b:=2;
    [seq(over10(n),n=0..144)]; # A175298
    [seq(overb(n),n=0..144)]; # A265543
  • Mathematica
    sb2p[n_]:=Module[{m=n},While[!PalindromeQ[IntegerDigits[m,2]]|| Min[ IntegerDigits[ m,2]-IntegerDigits[n,2]]<0,m++];FromDigits[ IntegerDigits[ m,2]]]; Array[sb2p,50,0] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Oct 15 2017 *)

A265558 a(n) = smallest base-10 palindrome m >= n such that every base-10 digit of n is <= the corresponding digit of m.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Dec 10 2015

Keywords

Crossrefs

Sequences related to palindromic floor and ceiling: A175298, A206913, A206914, A261423, A262038, and the large block of consecutive sequences beginning at A265509.
Cf. A265525.

Programs

  • Maple
    For Maple code see A265543.
  • PARI
    a(n,base=10) = { my (d=digits(n,base)); for (k=1, #d\2, d[k]=d[#d+1-k]=max(d[k],d[#d+1-k])); fromdigits(d,base) } \\ Rémy Sigrist, Jun 24 2022

A261916 Smallest p such that n can be written as n = p+q+r where p>=q>=r>=0 are palindromes.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Sep 11 2015

Keywords

Comments

Every number is the sum of three palindromes.

Examples

			Initial values of n,p,q,r are:
0 0 0 0
1 1 0 0
2 1 1 0
3 1 1 1
4 2 1 1
5 2 2 1
6 2 2 2
7 3 3 1
...
25 9 9 7
26 9 9 8
27 9 9 9
28 11 11 6
29 11 11 7
30 11 11 8
...
33 11 11 11
34 22 11 1
...
		

Crossrefs

If "smallest" is changed to "largest" we get a sequence which agrees with the palindromic floor function A261423 for at least 300 terms.

Extensions

Edited by Alois P. Heinz, Dec 29 2018

A265511 a(n) = largest base-3 palindrome m <= n such that every base-3 digit of m is <= the corresponding digit of n; m is written in base 10.

Original entry on oeis.org

0, 1, 2, 0, 4, 4, 0, 4, 8, 0, 10, 10, 0, 13, 13, 0, 16, 16, 0, 10, 20, 0, 13, 23, 0, 16, 26, 0, 28, 28, 0, 28, 28, 0, 28, 28, 0, 28, 28, 0, 40, 40, 0, 40, 40, 0, 28, 28, 0, 40, 40, 0, 52, 52, 0, 28, 56, 0, 28, 56, 0, 28, 56, 0, 28, 56, 0, 40, 68, 0, 40, 68, 0, 28, 56, 0, 40, 68, 0, 52, 80, 0, 82, 82, 0, 82, 82, 0, 82
Offset: 0

Views

Author

N. J. A. Sloane, Dec 09 2015

Keywords

Crossrefs

Sequences related to palindromic floor and ceiling: A175298, A206913, A206914, A261423, A262038, and the large block of consecutive sequences beginning at A265509.

Programs

  • Maple
    F:= proc(n) local L;
      L:= convert(n,base,3);
      if L[1] = 0 then return 0 fi;
      add(min(L[i],L[-i])*3^(i-1),i=1..nops(L))
    end proc:
    map(F, [$0..100]); # Robert Israel, Jan 13 2020

A265523 a(n) = largest base-9 palindrome m <= n such that every base-9 digit of m is <= the corresponding digit of n; m is written in base 10.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 10, 10, 10, 10, 10, 10, 10, 10, 0, 10, 20, 20, 20, 20, 20, 20, 20, 0, 10, 20, 30, 30, 30, 30, 30, 30, 0, 10, 20, 30, 40, 40, 40, 40, 40, 0, 10, 20, 30, 40, 50, 50, 50, 50, 0, 10, 20, 30, 40, 50, 60, 60, 60, 0, 10, 20, 30, 40, 50, 60, 70, 70, 0, 10, 20, 30, 40, 50, 60, 70, 80, 0, 82, 82
Offset: 0

Views

Author

N. J. A. Sloane, Dec 09 2015

Keywords

Crossrefs

Sequences related to palindromic floor and ceiling: A175298, A206913, A206914, A261423, A262038, and the large block of consecutive sequences beginning at A265509.

Programs

  • Maple
    F:= proc(n) local L;
      L:= convert(n,base,9);
    if L[1] = 0 then return 0 fi;
      add(min(L[i],L[-i])*9^(i-1),i=1..nops(L))
    end proc:
    map(F, [$0..100]); # Robert Israel, Jan 13 2020

A265526 Largest base-2 palindrome m <= n, written in base 2.

Original entry on oeis.org

0, 1, 1, 11, 11, 101, 101, 111, 111, 1001, 1001, 1001, 1001, 1001, 1001, 1111, 1111, 10001, 10001, 10001, 10001, 10101, 10101, 10101, 10101, 10101, 10101, 11011, 11011, 11011, 11011, 11111, 11111, 100001, 100001, 100001, 100001, 100001, 100001, 100001, 100001, 100001, 100001, 100001, 100001, 101101, 101101, 101101
Offset: 0

Views

Author

N. J. A. Sloane, Dec 09 2015

Keywords

Crossrefs

Sequences related to palindromic floor and ceiling: A175298, A206913, A206914, A261423, A262038, and the large block of consecutive sequences beginning at A265509.

Programs

  • Maple
    ispal:= proc(n) global b; # test for base-b palindrome
      local L, Ln, i;
      L:= convert(n, base, b);
      Ln:= nops(L);
    for i from 1 to floor(Ln/2) do
    if L[i] <> L[Ln+1-i] then return(false); fi;
    od:
    return(true);
    end proc;
    # find max pal <= n, write in base 10
    less10:=proc(n) global b;
    local t1,t2,i,m,sw1,L2;
    t1:=convert(n,base,b);
    for m from n by -1 to 0 do
    if ispal(m) then return(m); fi;
                            od;
    end proc;
    # find max pal <= n, write in base b
    lessb:=proc(n) global b;
    local t1,t2,i,m,mb,sw1,L2;
    t1:=convert(n,base,b);
    for m from n by -1 to 0 do
    if ispal(m) then
       t2:=convert(m,base,b);
       L2:=nops(t2);
       mb:=add(t2[i]*10^(i-1), i=1..L2); return(mb); fi;
                            od;
    end proc;
    b:=2;
    [seq(less10(n),n=0..100)]; # A206913
    [seq(lessb(n),n=0..100)]; # A265526
    [seq(less10(2*n),n=0..100)]; # A265527
    [seq(lessb(2*n),n=0..100)]; # A265528
    b:=10;
    [seq(less10(n),n=0..100)]; # A261423

A265527 Largest base-2 palindrome m <= 2n, written in base 10.

Original entry on oeis.org

0, 1, 3, 5, 7, 9, 9, 9, 15, 17, 17, 21, 21, 21, 27, 27, 31, 33, 33, 33, 33, 33, 33, 45, 45, 45, 51, 51, 51, 51, 51, 51, 63, 65, 65, 65, 65, 73, 73, 73, 73, 73, 73, 85, 85, 85, 85, 93, 93, 93, 99, 99, 99, 99, 107, 107, 107, 107, 107, 107, 119, 119, 119, 119, 127, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129
Offset: 0

Views

Author

N. J. A. Sloane, Dec 09 2015

Keywords

Crossrefs

Sequences related to palindromic floor and ceiling: A175298, A206913, A206914, A261423, A262038, and the large block of consecutive sequences beginning at A265509.

A265528 Largest base-2 palindrome m <= 2n, written in base 2.

Original entry on oeis.org

0, 1, 11, 101, 111, 1001, 1001, 1001, 1111, 10001, 10001, 10101, 10101, 10101, 11011, 11011, 11111, 100001, 100001, 100001, 100001, 100001, 100001, 101101, 101101, 101101, 110011, 110011, 110011, 110011, 110011, 110011, 111111, 1000001, 1000001, 1000001, 1000001, 1001001, 1001001, 1001001, 1001001, 1001001, 1001001
Offset: 0

Views

Author

N. J. A. Sloane, Dec 09 2015

Keywords

Crossrefs

Sequences related to palindromic floor and ceiling: A175298, A206913, A206914, A261423, A262038, and the large block of consecutive sequences beginning at A265509.
Previous Showing 21-30 of 86 results. Next