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-4 of 4 results.

A075686 In base 4, n sets a new record for the number of Reverse and Add! steps needed to reach a palindrome starting with n.

Original entry on oeis.org

0, 4, 7, 26, 28, 127, 199, 296, 511, 3119, 16861, 18164, 19453, 20468, 270824
Offset: 0

Views

Author

Klaus Brockhaus, Sep 24 2002

Keywords

Comments

RECORDS transform of A075685. - Base-4 analog of A065198 (base 10) and A066144 (base 2). Integers like 290, for which a palindrome is (presumably) never reached (cf. A075420), are of course disregarded. A075687 gives the corresponding records.

Examples

			Starting with 26, 3 Reverse and Add! steps are needed to reach a palindrome; starting with n < 26, less (at most 2) steps are needed.
		

Crossrefs

A075687 In base 4, records for the number of Reverse and Add! steps needed to reach a palindrome.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 16, 17, 29, 35, 37, 38, 79, 80, 107
Offset: 0

Views

Author

Klaus Brockhaus, Sep 24 2002

Keywords

Comments

RECORDS transform of A075685. Base-4 analog of A065199 (base 10) and A066145 (base 2). A075686 gives the corresponding starting points.

Examples

			Starting with 26, 3 Reverse and Add! steps are needed to reach a palindrome; starting with n < 26, less (at most 2) steps are needed.
		

Crossrefs

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

Original entry on oeis.org

0, 0, 0, 1, 0, 2, 1, 2, 0, 1, 0, 2, 1, 0, 2, 3, 0, 4, 1, 2, 0, 1, 2, 0, 3, 4, 0, 1, 0, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 0, 2, 3, 3, 2, 1, 1, 2, 3, 3, 2, 3, 0, 18, 1, 2, 0, 1, 2, 4, 1, 2, 2, 1, 2, 4, 1, 2, 0, 3, 2, 4, 1, 2, 2, 3, 2, 4, 17, 18, 0, 1, 0, 2, 1, 1, 2, 1, 1, 3, 1, 0, 2, 1, 1, 16, 1, 1, 2, 2, 0, 2, 4, -1, 16, 3, 15, 2, 1, 1, 2, 1, 0, 3, 3, 3, 2, 1, 1, 16, 1
Offset: 0

Views

Author

Klaus Brockhaus, Nov 05 2002

Keywords

Comments

Base-3 analog of A066057 (base 2), A075685 (base 4) and A033665 (base 10). a(103) = -1 is a conjecture (cf. A066450, A077408). For values of n such that presumably a(n) = -1 see A077404.

Examples

			17 (decimal) = 122 -> 122 + 221 = 1120 -> 1120 + 211 = 2101 -> 2101 + 1012 = 10120 -> 10120 + 2101 = 12221 (palindrome) = 160 (decimal) requires 4 steps, so a(17) = 4.
		

Crossrefs

Programs

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

A077441 In base 4, smallest number that requires n Reverse and Add! steps to reach a palindrome.

Original entry on oeis.org

0, 4, 7, 26, 28, 127, 306, 348, 398, 301, 308, 203, 311, 783, 294, 350, 199, 296, 4268, 16595, 5326, 4253, 17399, 8235, 6189, 4270, 3107, 1270, 1532, 511, 67816, 65975, 24670, 12395, 4282, 3119, 28799, 16861, 18164, 66268, 45087, 71164, 309234
Offset: 0

Views

Author

Klaus Brockhaus, Nov 05 2002

Keywords

Comments

Base-4 analog of A066058 (base 2) and A023109 (base 10).

Examples

			7 is the smallest number which requires two steps to reach a base 4 palindrome (cf. A075685), so a(2) = 5; 7 (decimal) = 13 -> 13 + 31 = 110 -> 110 + 011 = 121 (palindrome) = 25 (decimal).
		

Crossrefs

Programs

  • PARI
    {m=46; v=[]; for(j=1,m+1,v=concat(v,-1)); mc=m+1; n=0; while(mc>0,a=-1; c=0; k=n; while(c0,d=divrem(q,4); q=d[1]; rev=4*rev+d[2]); if(k==rev,a=c; c=m+1,c++; k=k+rev)); if(0<=a&&a<=m,if(v[a+1]<0,v[a+1]=n; mc--; print1([a,n]))); n++); print(); for(j=1,m+1,print1(v[j],","))}
    
  • Python
    from gmpy2 import digits
    def A077441(n):
        if n > 0:
            k = 0
            while True:
                m = k
                for i in range(n):
                    s = digits(m,4)
                    if s == s[::-1]:
                        break
                    m += int(s[::-1],4)
                else:
                    s = digits(m,4)
                    if s == s[::-1]:
                        return k
                k += 1
        else:
            return 0 # Chai Wah Wu, Jan 17 2015
Showing 1-4 of 4 results.