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

A342725 Numbers that are palindromic in base i-1.

Original entry on oeis.org

0, 1, 13, 17, 189, 205, 257, 273, 3005, 3069, 3277, 3341, 4033, 4097, 4305, 4369, 48061, 48317, 49149, 49405, 52173, 52429, 53261, 53517, 64449, 64705, 65537, 65793, 68561, 68817, 69649, 69905, 768957, 769981, 773309, 774333, 785405, 786429, 789757, 790781, 834509
Offset: 1

Views

Author

Amiram Eldar, Mar 19 2021

Keywords

Crossrefs

Similar sequences: A002113 (decimal), A006995 (binary), A014190 (base 3), A014192 (base 4), A029952 (base 5), A029953 (base 6), A029954 (base 7), A029803 (base 8), A029955 (base 9), A046807 (factorial base), A094202 (Zeckendorf), A331191 (dual Zeckendorf), A331891 (negabinary), A333423 (primorial base).

Programs

  • Mathematica
    v = {{0, 0, 0, 0}, {0, 0, 0, 1}, {1, 1, 0, 0}, {1, 1, 0, 1}}; q[n_] := PalindromeQ @ FromDigits[Flatten @ v[[1 + Reverse @ Most[Mod[NestWhileList[(# - Mod[#, 4])/-4 &, n, # != 0 &], 4]]]]]; Select[Range[0, 10^4], q]

Formula

13 is a term since its base-(i-1) presentation is 100010001 which is palindromic.

A048703 Numbers which in base 4 are palindromes and have an even number of digits.

Original entry on oeis.org

0, 5, 10, 15, 65, 85, 105, 125, 130, 150, 170, 190, 195, 215, 235, 255, 1025, 1105, 1185, 1265, 1285, 1365, 1445, 1525, 1545, 1625, 1705, 1785, 1805, 1885, 1965, 2045, 2050, 2130, 2210, 2290, 2310, 2390
Offset: 0

Views

Author

Antti Karttunen, Mar 07 1999

Keywords

Comments

In quaternary base (base 4) the terms look like 0, 11, 22, 33, 1001, 1111, 1221, 1331, 2002, 2112, 2222, 2332, 3003, 3113, 3223, 3333, 100001, 101101, 102201, ..., which is a subsequence of A118595.
Zero is included as a(0) because we can consider it as having zero digits after leading zeros have been excluded.

Examples

			Each a(n) is obtained by concatenating the original base-4 expansion of n (which comes to the left hand, i.e., the most significant side) with its mirror-image (which comes to the right hand, i.e., the least significant side). For example, for a(4) we have 4 = '10' in base 4, which concatenated with its reversal '01' yields '1001', which when converted back to decimal yields 1*64 + 0*16 + 0*4 + 1*1 = 65, thus a(4)=65.
		

Crossrefs

Subsequence of A014192 (all numbers which are palindromes in base 4, including also those of odd number of digits).
Cf. also A048704 (this sequence divided by 5), A048701 (binary palindromes of even length), A055948, A110591, A118595, A030103, A007090, A000302.

Programs

  • Maple
    A048703(n) := (n) -> (2^(floor_log_2_coarse(n)+1))*n + sum('(bit_i(n, i+((-1)^i))*(2^(floor_log_2_coarse(n)-i)))', 'i'=0..floor_log_2_coarse(n));
    bit_i := (x,i) -> `mod`(floor(x/(2^i)),2);
    # Following is like floor_log_2 but even results are incremented by one:
    floor_log_2_coarse := proc(n) local nn,i: nn := n; for i from -1 to n do if(0 = nn) then RETURN(i+(1-(i mod 2))); fi: nn := floor(nn/2); od: end:
  • Mathematica
    q[n_] := EvenQ[IntegerLength[n, 4]] && PalindromeQ[IntegerDigits[n, 4]]; Select[Range[0, 2400, 5], q] (* Amiram Eldar, May 27 2024 *)
  • Python
    def A048703(n):
        s = bin(n-1)[2:]
        if len(s) % 2: s = '0'+s
        t = [s[i:i+2] for i in range(0,len(s),2)]
        return int(''.join(t+t[::-1]),2) # Chai Wah Wu, Feb 26 2021

Formula

a(0) = 0, and for n >= 1, a(n) = A030103(n) + (n * A000302(A110591(n))). - Antti Karttunen, Oct 30 2013
a(n) = 5*A048704(n). [This is just a consequence of the definition of A048704.] - Antti Karttunen, Jul 25 2013

A075685 Reverse and Add! carried out in base 4; number of steps needed to reach a palindrome, or -1 if no palindrome is ever reached.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 1, 2, 1, 1, 0, 1, 1, 2, 1, 0, 1, 0, 1, 2, 1, 0, 1, 2, 2, 0, 3, 2, 4, 0, 4, 3, 1, 1, 0, 1, 1, 1, 0, 4, 2, 3, 0, 2, 3, 4, 0, 4, 1, 2, 1, 0, 1, 2, 4, 0, 3, 2, 2, 0, 4, 3, 4, 0, 1, 0, 1, 2, 1, 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, 2, 1, 1, 1, 2, 1, 0, 1, 3, 1, 1, 1, 2, 2, 3, 3, 2, 1, 1, 1, 3, 1, 1, 1, 2, 2
Offset: 0

Views

Author

Klaus Brockhaus, Sep 24 2002

Keywords

Comments

Base-4 analog of A033665 (base 10) and A066057 (base 2). For values of n such that presumably a(n) = -1 see A075420.

Examples

			26 (decimal) = 122 -> 122 + 221 = 1003 -> 1003 + 3001 = 10010 -> 10010 + 01001 = 11011 (palindrome) = 325 (decimal) requires 3 steps, so a(26) = 3.
		

Crossrefs

Programs

  • ARIBAS
    m := 105; stop := 1000; for n := 0 to m do c := 0; k := n; v := -1; while c < stop do a := k; rev := 0; while a > 0 do rev := 4*rev + (a mod 4); a := a div 4; end; if k = rev then v := c; c := stop; else inc(c); k := k + rev; end; end; write(v," "); end;.

A333423 Numbers that are palindromes in primorial base.

Original entry on oeis.org

0, 1, 3, 7, 9, 11, 31, 39, 47, 211, 217, 223, 229, 235, 243, 249, 255, 261, 267, 275, 281, 287, 293, 299, 2311, 2347, 2383, 2419, 2455, 2523, 2559, 2595, 2631, 2667, 2735, 2771, 2807, 2843, 2879, 30031, 30061, 30091, 30121, 30151, 30181, 30211, 30247, 30277, 30307
Offset: 1

Views

Author

Amiram Eldar, Mar 20 2020

Keywords

Examples

			3 is a term since its representation in primorial base is 11 (1 * 2# + 1) which is a palindrome.
7 is a term since its representation in primorial base is 101 (1 * 3# + 0 * 2# + 1 = 6 + 1) which is a palindrome.
		

Crossrefs

Programs

  • Mathematica
    max = 6; bases = Prime @ Range[max, 1, -1]; nmax = Times @@ bases - 1; Select[Range[0, nmax], PalindromeQ @ IntegerDigits[#, MixedRadix[bases]] &]

A091680 Smallest number whose base-4 Reverse and Add! trajectory (presumably) contains exactly n base-4 palindromes, or -1 if there is no such number.

Original entry on oeis.org

290, 78, 18, 6, 3, 36, 21, 19, 7, 8, 4, 2, 1, -1, -1, -1, -1, -1, -1, -1, -1
Offset: 0

Views

Author

Klaus Brockhaus, Jan 28 2004

Keywords

Comments

Conjecture 1: For each k > 0 the trajectory of k eventually leads to a term in the trajectory of some j which belongs to A075421, i.e., whose trajectory (presumably) never leads to a palindrome. Conjecture 2: There is no k > 0 such that the trajectory of k contains more than twelve palindromes, i.e., a(n) = -1 for n > 12.
Base-4 analog of A077594.

Examples

			a(4) = 3 since the trajectory of 3 contains the four palindromes 3, 15, 975, 64575 (3, 33, 33033, 3330333 in base 4) and at 20966400 joins the trajectory of 318 = A075421(2) and the trajectories of 1 (A035524) and 2 do not contain exactly four palindromes.
		

Crossrefs

A319584 Numbers that are palindromic in bases 2, 4, and 8.

Original entry on oeis.org

0, 1, 3, 5, 63, 65, 195, 325, 341, 4095, 4097, 4161, 12291, 12483, 20485, 20805, 21525, 21845, 258111, 262143, 262145, 266305, 786435, 798915, 1310725, 1311749, 1331525, 1332549, 1376277, 1377301, 1397077, 1398101, 16515135, 16777215, 16777217, 16781313
Offset: 1

Views

Author

Jeremias M. Gomes, Sep 23 2018

Keywords

Comments

Intersection of A006995, A014192, and A029803.
From A.H.M. Smeets, Jun 08 2019: (Start)
Intersection of A006995 and A259382.
Intersection of A014192 and A259380.
Intersection of A029803 and A097856.
All repunit numbers in base 2 with 6*k digits are included in this sequence, i.e., all terms A000225(6*k) for k >= 0.
All repunit numbers in base 4 with 2+3*k digits are included in this sequence, i.e., all terms A002450(2+3*k) for k >= 0.
All terms A000051(6*k) for k > 0 are included in this sequence.
All terms A052539(3*k) for k > 0 are included in this sequence.
In general, for sequences with palindromic numbers in the set of bases {b, b^2, ..., b^k}, gaps of size 2 occur at the term pairs (b^(k!) - 1, b^(k!) + 1). See also A319598 for b = 2 and k = 4.
The terms occur in bursts with large gaps in between as shown in the scatterplots of log_b(a(n)-a(n-1)) versus log_b(n) and log_b(1-a(n-1)/a(n)) versus log_b(n). Terms of this sequence are those with b = 2 and k = 3. For comparison, terms with b = 3 and k = 3 are also shown in these plots.
(End)

Examples

			89478485 = 101010101010101010101010101_2 = 11111111111111_4 = 525252525_8.
		

Crossrefs

Cf. A006995 (base 2), A014192 (base 4), A029803 (base 8), A097956 (bases 2 and 4), A259380 (bases 2 and 8), A259382 (bases 4 and 8), A319598 (bases 2, 4, 8 and 16).

Programs

  • Magma
    [n: n in [0..2*10^7] | Intseq(n, 2) eq Reverse(Intseq(n, 2)) and Intseq(n, 4) eq Reverse(Intseq(n, 4)) and Intseq(n, 8) eq Reverse(Intseq(n, 8))]; // Vincenzo Librandi, Sep 24 2018
    
  • Mathematica
    palQ[n_, b_] := PalindromeQ[IntegerDigits[n, b]];
    Reap[Do[If[palQ[n, 2] && palQ[n, 4] && palQ[n, 8], Print[n]; Sow[n]], {n, 0, 10^6}]][[2, 1]] (* Jean-François Alcover, Sep 25 2018 *)
    Select[Range[0,168*10^5],AllTrue[Table[IntegerDigits[#,d],{d,{2,4,8}}],PalindromeQ]&] (* Harvey P. Dale, Jan 27 2024 *)
  • PARI
    ispal(n, b) = my(d=digits(n, b)); Vecrev(d) == d;
    isok(n) = ispal(n, 2) && ispal(n, 4) && ispal(n, 8); \\ Michel Marcus, Jun 11 2019
  • Python
    def nextpal(n, base): # m is the first palindrome successor of n in base base
        m, pl = n+1, 0
        while m > 0:
            m, pl = m//base, pl+1
        if n+1 == base**pl:
            pl = pl+1
        n = n//(base**(pl//2))+1
        m, n = n, n//(base**(pl%2))
        while n > 0:
            m, n = m*base+n%base, n//base
        return m
    def rev(n, b):
        m = 0
        while n > 0:
            n, m = n//b, m*b+n%b
        return m
    n, a = 1, 0
    while n <= 100:
        if a == rev(a, 4) == rev(a, 2):
            print(a)
            n += 1
        a = nextpal(a, 8) # A.H.M. Smeets, Jun 08 2019
    
  • Sage
    [n for n in (0..1000) if Word(n.digits(2)).is_palindrome() and Word(n.digits(4)).is_palindrome() and Word(n.digits(8)).is_palindrome()]
    

A319598 Numbers in base 10 that are palindromic in bases 2, 4, 8, and 16.

Original entry on oeis.org

0, 1, 3, 5, 4095, 4097, 12291, 20485, 21845, 16777215, 16777217, 16781313, 50331651, 50343939, 83886085, 83906565, 89458005, 89478485, 68702703615, 68719476735, 68719476737, 68736258049, 206158430211, 206208774147, 343597383685, 343602954245, 343681290245
Offset: 1

Views

Author

Jeremias M. Gomes, Sep 24 2018

Keywords

Comments

Intersection of A006995, A014192, A029803, and A029730.
This sequence is infinite because it contains terms of the forms 4096^k-1 (k>=0) and 4096^k+1 (k>0). - Bruno Berselli, Sep 24 2018

Examples

			4095 = 111111111111_2 = 333333_4 = 7777_8 = FFF_16. Hence 4095 is in the sequence.
		

Crossrefs

Cf. A006995 (base 2), A014192 (base 4), A029803 (base 8), and A029730 (base 16).

Programs

  • Mathematica
    palQ[n_, b_] := PalindromeQ[IntegerDigits[n, b]];
    Reap[Do[If[palQ[n, 2] && palQ[n, 4] && palQ[n, 8] && palQ[n, 16], Print[n]; Sow[n]], {n, 0, 10^6}]][[2, 1]] (* Jean-François Alcover, Sep 25 2018 *)
  • Sage
    [n for n in (0..100000) if Word(n.digits(2)).is_palindrome() and Word(n.digits(4)).is_palindrome() and Word(n.digits(8)).is_palindrome() and Word(n.digits(16)).is_palindrome()]

Extensions

a(19)-a(27) from Rémy Sigrist, Nov 15 2018

A260184 Numbers n written in base 10 that are palindromic in exactly three bases b, 2 <= b <= 10 and not simultaneously bases 2, 4 and 8.

Original entry on oeis.org

9, 10, 21, 40, 55, 80, 85, 100, 130, 154, 164, 178, 191, 203, 235, 242, 255, 257, 273, 282, 292, 300, 328, 400, 455, 585, 656, 819, 910, 2709, 6643, 8200, 14762, 32152, 53235, 74647, 428585, 532900, 1181729, 1405397, 4210945, 5259525, 27711772, 719848917, 43253138565
Offset: 1

Views

Author

Keywords

Examples

			273 is in the sequence because 100010001_2 = 101010_3 = 10101_4 = 2043_5 = 1133_6 = 540_7 = 421_8 = 333_9 = 273_10 and three of the bases, namely 2, 4 & 9, yield palindromes.
		

Crossrefs

Programs

  • Mathematica
    (* see A214425 and set all terms as lst, then *)
    gQ[n_] := Count[ palQ[n,#] & /@ {2, 4, 8}, True];
    Select[ lst, gQ[#] != 3 &]

Formula

The intersection of A006995, A014190, A014192, A029952, A029953, A029954, A029803, A029955 & A002113 which yields just three members, not simultaneously bases 2, 4 and 8.

A319583 Numbers in base 10 that are palindromic in bases 2, 4, and 16.

Original entry on oeis.org

0, 1, 3, 5, 15, 17, 51, 85, 255, 257, 273, 771, 819, 1285, 1365, 3855, 4095, 4097, 4369, 12291, 13107, 20485, 21845, 61455, 65535, 65537, 65793, 69649, 69905, 196611, 197379, 208947, 209715, 327685, 328965, 348245, 349525, 983055, 986895, 1044735, 1048575
Offset: 1

Views

Author

Jeremias M. Gomes, Sep 23 2018

Keywords

Comments

Intersection of A006995, A014192, and A029730.
This sequence is infinite as it contains 15*(1 + 16^k) for any k > 0. - Rémy Sigrist, Sep 23 2018
Palindromes in base 16 whose nonzero base-16 digits are either all 1, all 3, all 5 or all F (15). - Robert Israel, Nov 12 2023

Examples

			255 is 11111111 in binary, 3333 in quaternary and FF in hexadecimal. Hence 255 is in the sequence.
Although 21 is 10101 in binary and 111 in quaternary, it is 15 in hexadecimal and therefore not in the sequence.
		

Crossrefs

Cf. A006995 (base 2), A014192 (base 4), and A029730 (base 16).

Programs

  • Magma
    [n: n in [0..2*10^7] | Intseq(n, 2) eq Reverse(Intseq(n, 2)) and Intseq(n, 4) eq Reverse(Intseq(n, 4)) and Intseq(n, 16) eq Reverse(Intseq(n, 16))]; // Vincenzo Librandi, Sep 24 2018
  • Maple
    extend:= proc(x, d)
      local a,b,m;
      if d::odd then
        m:= (d-1)/2;
        a:= x mod 16^(m+1);
        b:= floor(x/16^m);
        a + 16^(m+1)*b
      else
        m:= d/2;
        a:= x mod 16^m;
        b:= floor(x/16^m);
        (a + 16^(m+1)*b, a + 16^m * (a mod 16) + 16^(m+1)*b)
      fi
    end proc:
    V:= [1,3,5,15]: R:= 0, op(V):
    for d from 1 to 6 do
      V:= map(extend,V,d);
      R:= R, op(V);
    od:
    R; # Robert Israel, Nov 12 2023
  • Mathematica
    palQ[n_, b_] := PalindromeQ[IntegerDigits[n, b]];
    Reap[Do[If[palQ[n, 2] && palQ[n, 4] && palQ[n, 16], Print[n]; Sow[n]], {n, 0, 10^6}]][[2, 1]] (* Jean-François Alcover, Sep 25 2018 *)
  • Sage
    [n for n in (0..1000) if Word(n.digits(2)).is_palindrome() and Word(n.digits(4)).is_palindrome() and Word(n.digits(16)).is_palindrome()]
    

A043263 Sum of the digits of the n-th base 4 palindrome.

Original entry on oeis.org

0, 1, 2, 3, 2, 4, 6, 2, 3, 4, 5, 4, 5, 6, 7, 6, 7, 8, 9, 2, 4, 6, 8, 4, 6, 8, 10, 6, 8, 10, 12, 2, 3, 4, 5, 4, 5, 6, 7, 6, 7, 8, 9, 8, 9, 10, 11, 4, 5, 6, 7, 6, 7, 8, 9, 8, 9, 10, 11, 10, 11, 12, 13, 6, 7, 8, 9, 8, 9, 10, 11, 10, 11, 12, 13, 12, 13, 14, 15, 2, 4
Offset: 1

Views

Author

Keywords

Crossrefs

A014192 (base 4 palindromes)
Previous Showing 21-30 of 31 results. Next